Public report of crabbuild/crab, published 16 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, 16 November 2026, 21:44 UTC · Survey ID cd_00407349728044758a5fed6d0ba6d741
crabbuild/crab
Measured 16 November 2026, 21:42 UTC, at code version cc2e4e2
Code coverage is not measured: JavaScript/TypeScript suite (CouldNotMeasureNoCollector).
CAI scoreAt risk
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 800,115 lines of product code in 28 projects, tests not counted · Estimated rebuild effort: about 6.7 person-years · Weakest lens: Production Readiness, 50.2
Findings by how serious they are
181 critical4478 serious198 minor
8 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
16 November 2026, 21:42 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
94of 94 dimensions measured by tools.
4794of 4857 findings point to an exact file and line, so you can open each one in the code. The other 63 concern the repository as a whole, such as missing documentation.
94dimensions across 9 lenses, read from 800,115 lines of product code in 28 projects.
crabbuild/crab is rated At risk because critical security findings are open, most of them in the build pipeline. It scores 58.0 out of 100, which the At risk rating leaves unchanged.
Production Readiness, at 50.2, is the weakest lens and counts most in the score. The best first step is replacing the two exposed passwords or keys and switching the old ones off, worth about 5.7 points. Adding tests for the code no test reaches would lift Production Readiness itself, worth about 3.6 points. Raising Production Readiness to 70 would lift the score to about 63.2.
119 pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Thirty-two known security holes in the packages the code depends on can be used by attackers, and twelve settings leave the servers or containers unsafe. Pinning each tool to an exact version, updating the vulnerable packages and correcting the unsafe settings would close these risks. Fixing the weaknesses the scanner points to would fix the five security weaknesses in the code, and passing outside input through environment variables would deal with the four pipeline steps that put outside input straight into a shell command. Moving the write out of the read operation would take care of the two read operations that also write data.
The product code is 800,115 lines, about €970,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 50.2 to 70, the lowest score rated Strong, the score would rise from 58.0 to about 63.2.
Code composition: what the lines of code are
Product code 86%Tests 14%
Rebuild cost: about €970,000 · Estimate
Cost to rebuild
€320,000 to €1,600,000, for 5,368 to 17,028 hours of work, about 6.7 person-years for 3 to 13 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
Very large: 800,115 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: We price the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2).
Raises the score by about 5.7 points · Low effort · Secret Scanning
2
Add tests that import the unreached modules (directly or through their public entry).
Raises the score by about 3.6 points · Medium effort · Test Coverage
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 €970,000 to build again, about 6.7 person-years of work. Its weakest lens is Production Readiness, at 50.2 (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
Resolve the 2 Leaked secret finding(s) in Secret Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 5.7 points for low effort, because it clears the 2 Secret Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 5% to 10% on every change. The history of the code shows how much it changes: about 1,393,043 lines over the last 90 days, which is about 5,649,563 lines a year. At that pace, the extra work comes to an estimated 649 to 3894.3 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.
932 modules, with 2277 dependencies between them. 19 loops run through 86 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 892 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.
crab.core.config uses crab_types.storage, so a change to crab_types.storage can break crab.core.config, while a change to crab.core.config can't break crab_types.storage.
Position
Below the diagonal: crab.core.config uses a module listed above it, which is the healthy direction.
crab_remote_git.runtime uses crab_metadata.manifests, so a change to crab_metadata.manifests can break crab_remote_git.runtime, while a change to crab_remote_git.runtime can't break crab_metadata.manifests.
Position
Below the diagonal: crab_remote_git.runtime uses a module listed above it, which is the healthy direction.
13→19 crab_remote_git.runtime uses crab_remote_git.repositorypart of a loop✕
Connections
7 pairs of types, where a type in crab_remote_git.runtime uses a type in crab_remote_git.repository.
crab_remote_git.runtime uses crab_remote_git.repository, so a change to crab_remote_git.repository can break crab_remote_git.runtime, while a change to crab_remote_git.runtime can't break crab_remote_git.repository.
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.
14→22 crab_sdk.local uses crab_sdk.clientpart of a loop✕
Connections
2 pairs of types, where a type in crab_sdk.local uses a type in crab_sdk.client.
crab_sdk.local uses crab_sdk.client, so a change to crab_sdk.client can break crab_sdk.local, while a change to crab_sdk.local can't break crab_sdk.client.
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.
crab_storage.layout uses crab_types.storage, so a change to crab_types.storage can break crab_storage.layout, while a change to crab_storage.layout can't break crab_types.storage.
Position
Below the diagonal: crab_storage.layout uses a module listed above it, which is the healthy direction.
crab_storage.store uses crab_types.storage, so a change to crab_types.storage can break crab_storage.store, while a change to crab_storage.store can't break crab_types.storage.
Position
Below the diagonal: crab_storage.store uses a module listed above it, which is the healthy direction.
crab_storage.store uses crab_storage.layout, so a change to crab_storage.layout can break crab_storage.store, while a change to crab_storage.store can't break crab_storage.layout.
Position
Below the diagonal: crab_storage.store uses a module listed above it, which is the healthy direction.
crab_cache_store uses crab_cache.local_cache, so a change to crab_cache.local_cache can break crab_cache_store, while a change to crab_cache_store can't break crab_cache.local_cache.
Position
Below the diagonal: crab_cache_store uses a module listed above it, which is the healthy direction.
crab_cache_store uses crab_storage.store, so a change to crab_storage.store can break crab_cache_store, while a change to crab_cache_store can't break crab_storage.store.
Position
Below the diagonal: crab_cache_store uses a module listed above it, which is the healthy direction.
crab_metadata.manifest_store uses crab_metadata.manifests, so a change to crab_metadata.manifests can break crab_metadata.manifest_store, while a change to crab_metadata.manifest_store can't break crab_metadata.manifests.
Position
Below the diagonal: crab_metadata.manifest_store uses a module listed above it, which is the healthy direction.
crab_metadata.manifest_store uses crab_storage.layout, so a change to crab_storage.layout can break crab_metadata.manifest_store, while a change to crab_metadata.manifest_store can't break crab_storage.layout.
Position
Below the diagonal: crab_metadata.manifest_store uses a module listed above it, which is the healthy direction.
crab_metadata.manifest_store uses crab_storage.store, so a change to crab_storage.store can break crab_metadata.manifest_store, while a change to crab_metadata.manifest_store can't break crab_storage.store.
Position
Below the diagonal: crab_metadata.manifest_store uses a module listed above it, which is the healthy direction.
crab_remote_git.repository uses crab_remote_git.runtime, so a change to crab_remote_git.runtime can break crab_remote_git.repository, while a change to crab_remote_git.repository can't break crab_remote_git.runtime.
Position
Below the diagonal: crab_remote_git.repository uses a module listed above it, which is the healthy direction.
crab_remote_git.repository uses crab_storage.layout, so a change to crab_storage.layout can break crab_remote_git.repository, while a change to crab_remote_git.repository can't break crab_storage.layout.
Position
Below the diagonal: crab_remote_git.repository uses a module listed above it, which is the healthy direction.
crab_remote_git.repository uses crab_storage.store, so a change to crab_storage.store can break crab_remote_git.repository, while a change to crab_remote_git.repository can't break crab_storage.store.
Position
Below the diagonal: crab_remote_git.repository uses a module listed above it, which is the healthy direction.
crab_remote_git.repository uses crab_metadata.manifest_store, so a change to crab_metadata.manifest_store can break crab_remote_git.repository, while a change to crab_remote_git.repository can't break crab_metadata.manifest_store.
Position
Below the diagonal: crab_remote_git.repository uses a module listed above it, which is the healthy direction.
19→21 crab_remote_git.repository uses crab_remote_git.operationpart of a loop✕
Connections
4 pairs of types, where a type in crab_remote_git.repository uses a type in crab_remote_git.operation.
crab_remote_git.repository uses crab_remote_git.operation, so a change to crab_remote_git.operation can break crab_remote_git.repository, while a change to crab_remote_git.repository can't break crab_remote_git.operation.
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.
crab_http_server.server uses crab_cache.cache_client.availability, so a change to crab_cache.cache_client.availability can break crab_http_server.server, while a change to crab_http_server.server can't break crab_cache.cache_client.availability.
Position
Below the diagonal: crab_http_server.server uses a module listed above it, which is the healthy direction.
crab_http_server.server uses crab_remote_git.runtime, so a change to crab_remote_git.runtime can break crab_http_server.server, while a change to crab_http_server.server can't break crab_remote_git.runtime.
Position
Below the diagonal: crab_http_server.server uses a module listed above it, which is the healthy direction.
crab_http_server.server uses crab_storage.layout, so a change to crab_storage.layout can break crab_http_server.server, while a change to crab_http_server.server can't break crab_storage.layout.
Position
Below the diagonal: crab_http_server.server uses a module listed above it, which is the healthy direction.
crab_http_server.server uses crab_storage.store, so a change to crab_storage.store can break crab_http_server.server, while a change to crab_http_server.server can't break crab_storage.store.
Position
Below the diagonal: crab_http_server.server uses a module listed above it, which is the healthy direction.
crab_http_server.server uses crab_remote_git.repository, so a change to crab_remote_git.repository can break crab_http_server.server, while a change to crab_http_server.server can't break crab_remote_git.repository.
Position
Below the diagonal: crab_http_server.server uses a module listed above it, which is the healthy direction.
20→24 crab_http_server.server uses crab_http_server.authpart of a loop✕
Connections
3 pairs of types, where a type in crab_http_server.server uses a type in crab_http_server.auth.
crab_http_server.server uses crab_http_server.auth, so a change to crab_http_server.auth can break crab_http_server.server, while a change to crab_http_server.server can't break crab_http_server.auth.
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.
crab_remote_git.operation uses crab_remote_git.runtime, so a change to crab_remote_git.runtime can break crab_remote_git.operation, while a change to crab_remote_git.operation can't break crab_remote_git.runtime.
Position
Below the diagonal: crab_remote_git.operation uses a module listed above it, which is the healthy direction.
crab_remote_git.operation uses crab_storage.layout, so a change to crab_storage.layout can break crab_remote_git.operation, while a change to crab_remote_git.operation can't break crab_storage.layout.
Position
Below the diagonal: crab_remote_git.operation uses a module listed above it, which is the healthy direction.
crab_remote_git.operation uses crab_metadata.manifest_store, so a change to crab_metadata.manifest_store can break crab_remote_git.operation, while a change to crab_remote_git.operation can't break crab_metadata.manifest_store.
Position
Below the diagonal: crab_remote_git.operation uses a module listed above it, which is the healthy direction.
crab_remote_git.operation uses crab_remote_git.repository, so a change to crab_remote_git.repository can break crab_remote_git.operation, while a change to crab_remote_git.operation can't break crab_remote_git.repository.
Position
Below the diagonal: crab_remote_git.operation uses a module listed above it, which is the healthy direction.
crab_sdk.client uses crab_remote_git.runtime, so a change to crab_remote_git.runtime can break crab_sdk.client, while a change to crab_sdk.client can't break crab_remote_git.runtime.
Position
Below the diagonal: crab_sdk.client uses a module listed above it, which is the healthy direction.
crab_sdk.client uses crab_sdk.local, so a change to crab_sdk.local can break crab_sdk.client, while a change to crab_sdk.client can't break crab_sdk.local.
Position
Below the diagonal: crab_sdk.client uses a module listed above it, which is the healthy direction.
crab_sdk.client uses crab_storage.store, so a change to crab_storage.store can break crab_sdk.client, while a change to crab_sdk.client can't break crab_storage.store.
Position
Below the diagonal: crab_sdk.client uses a module listed above it, which is the healthy direction.
crab_sdk.client uses crab_remote_git.repository, so a change to crab_remote_git.repository can break crab_sdk.client, while a change to crab_sdk.client can't break crab_remote_git.repository.
Position
Below the diagonal: crab_sdk.client uses a module listed above it, which is the healthy direction.
crab.cmd.mirror.history uses crab_storage.layout, so a change to crab_storage.layout can break crab.cmd.mirror.history, while a change to crab.cmd.mirror.history can't break crab_storage.layout.
Position
Below the diagonal: crab.cmd.mirror.history uses a module listed above it, which is the healthy direction.
crab.cmd.mirror.history uses crab_metadata.manifest_store, so a change to crab_metadata.manifest_store can break crab.cmd.mirror.history, while a change to crab.cmd.mirror.history can't break crab_metadata.manifest_store.
Position
Below the diagonal: crab.cmd.mirror.history uses a module listed above it, which is the healthy direction.
crab.cmd.mirror.history uses crab_remote_git.repository, so a change to crab_remote_git.repository can break crab.cmd.mirror.history, while a change to crab.cmd.mirror.history can't break crab_remote_git.repository.
Position
Below the diagonal: crab.cmd.mirror.history uses a module listed above it, which is the healthy direction.
crab.cmd.mirror.history uses crab_remote_git.operation, so a change to crab_remote_git.operation can break crab.cmd.mirror.history, while a change to crab.cmd.mirror.history can't break crab_remote_git.operation.
Position
Below the diagonal: crab.cmd.mirror.history uses a module listed above it, which is the healthy direction.
crab_http_server.auth uses crab_cache.cache_client.availability, so a change to crab_cache.cache_client.availability can break crab_http_server.auth, while a change to crab_http_server.auth can't break crab_cache.cache_client.availability.
Position
Below the diagonal: crab_http_server.auth uses a module listed above it, which is the healthy direction.
crab_http_server.auth uses crab_storage.store, so a change to crab_storage.store can break crab_http_server.auth, while a change to crab_http_server.auth can't break crab_storage.store.
Position
Below the diagonal: crab_http_server.auth uses a module listed above it, which is the healthy direction.
crab_http_server.auth uses crab_http_server.server, so a change to crab_http_server.server can break crab_http_server.auth, while a change to crab_http_server.auth can't break crab_http_server.server.
Position
Below the diagonal: crab_http_server.auth uses a module listed above it, which is the healthy direction.
crab_remote.prepare uses crab_metadata.manifests, so a change to crab_metadata.manifests can break crab_remote.prepare, while a change to crab_remote.prepare can't break crab_metadata.manifests.
Position
Below the diagonal: crab_remote.prepare uses a module listed above it, which is the healthy direction.
crab_remote.prepare uses crab_storage.layout, so a change to crab_storage.layout can break crab_remote.prepare, while a change to crab_remote.prepare can't break crab_storage.layout.
Position
Below the diagonal: crab_remote.prepare uses a module listed above it, which is the healthy direction.
crab_remote.prepare uses crab_metadata.manifest_store, so a change to crab_metadata.manifest_store can break crab_remote.prepare, while a change to crab_remote.prepare can't break crab_metadata.manifest_store.
Position
Below the diagonal: crab_remote.prepare uses a module listed above it, which is the healthy direction.
crab_remote.prepare uses crab_remote_git.repository, so a change to crab_remote_git.repository can break crab_remote.prepare, while a change to crab_remote.prepare can't break crab_remote_git.repository.
Position
Below the diagonal: crab_remote.prepare uses a module listed above it, which is the healthy direction.
crab_remote.prepare uses crab_remote_git.operation, so a change to crab_remote_git.operation can break crab_remote.prepare, while a change to crab_remote.prepare can't break crab_remote_git.operation.
Position
Below the diagonal: crab_remote.prepare uses a module listed above it, which is the healthy direction.
crab_s3_gateway.gateway uses crab_cache.local_cache, so a change to crab_cache.local_cache can break crab_s3_gateway.gateway, while a change to crab_s3_gateway.gateway can't break crab_cache.local_cache.
Position
Below the diagonal: crab_s3_gateway.gateway uses a module listed above it, which is the healthy direction.
crab_s3_gateway.gateway uses crab_types.storage, so a change to crab_types.storage can break crab_s3_gateway.gateway, while a change to crab_s3_gateway.gateway can't break crab_types.storage.
Position
Below the diagonal: crab_s3_gateway.gateway uses a module listed above it, which is the healthy direction.
crab_s3_gateway.gateway uses crab_remote_git.runtime, so a change to crab_remote_git.runtime can break crab_s3_gateway.gateway, while a change to crab_s3_gateway.gateway can't break crab_remote_git.runtime.
Position
Below the diagonal: crab_s3_gateway.gateway uses a module listed above it, which is the healthy direction.
crab_s3_gateway.gateway uses crab_storage.layout, so a change to crab_storage.layout can break crab_s3_gateway.gateway, while a change to crab_s3_gateway.gateway can't break crab_storage.layout.
Position
Below the diagonal: crab_s3_gateway.gateway uses a module listed above it, which is the healthy direction.
crab_s3_gateway.gateway uses crab_storage.store, so a change to crab_storage.store can break crab_s3_gateway.gateway, while a change to crab_s3_gateway.gateway can't break crab_storage.store.
Position
Below the diagonal: crab_s3_gateway.gateway uses a module listed above it, which is the healthy direction.
crab_s3_gateway.gateway uses crab_cache_store, so a change to crab_cache_store can break crab_s3_gateway.gateway, while a change to crab_s3_gateway.gateway can't break crab_cache_store.
Position
Below the diagonal: crab_s3_gateway.gateway uses a module listed above it, which is the healthy direction.
crab_s3_gateway.gateway uses crab_remote_git.repository, so a change to crab_remote_git.repository can break crab_s3_gateway.gateway, while a change to crab_s3_gateway.gateway can't break crab_remote_git.repository.
Position
Below the diagonal: crab_s3_gateway.gateway uses a module listed above it, which is the healthy direction.
crab_s3_gateway.gateway uses crab_remote_git.operation, so a change to crab_remote_git.operation can break crab_s3_gateway.gateway, while a change to crab_s3_gateway.gateway can't break crab_remote_git.operation.
Position
Below the diagonal: crab_s3_gateway.gateway uses a module listed above it, which is the healthy direction.
crab.core.error uses crab_git.lfs_pointer, so a change to crab_git.lfs_pointer can break crab.core.error, while a change to crab.core.error can't break crab_git.lfs_pointer.
Position
Below the diagonal: crab.core.error uses a module listed above it, which is the healthy direction.
crab.core.error uses crab_metadata.error, so a change to crab_metadata.error can break crab.core.error, while a change to crab.core.error can't break crab_metadata.error.
Position
Below the diagonal: crab.core.error uses a module listed above it, which is the healthy direction.
crab.core.error uses crab_types.pointer, so a change to crab_types.pointer can break crab.core.error, while a change to crab.core.error can't break crab_types.pointer.
Position
Below the diagonal: crab.core.error uses a module listed above it, which is the healthy direction.
crab.core.error uses crab_cache_store, so a change to crab_cache_store can break crab.core.error, while a change to crab.core.error can't break crab_cache_store.
Position
Below the diagonal: crab.core.error uses a module listed above it, which is the healthy direction.
crab.core.error uses crab.cmd.mirror.history, so a change to crab.cmd.mirror.history can break crab.core.error, while a change to crab.core.error can't break crab.cmd.mirror.history.
Position
Below the diagonal: crab.core.error uses a module listed above it, which is the healthy direction.
crab_http_server.app uses crab_cache.cache_client.availability, so a change to crab_cache.cache_client.availability can break crab_http_server.app, while a change to crab_http_server.app can't break crab_cache.cache_client.availability.
Position
Below the diagonal: crab_http_server.app uses a module listed above it, which is the healthy direction.
crab_http_server.app uses crab_http_server.server, so a change to crab_http_server.server can break crab_http_server.app, while a change to crab_http_server.app can't break crab_http_server.server.
Position
Below the diagonal: crab_http_server.app uses a module listed above it, which is the healthy direction.
crab_http_server.app uses crab_http_server.auth, so a change to crab_http_server.auth can break crab_http_server.app, while a change to crab_http_server.app can't break crab_http_server.auth.
Position
Below the diagonal: crab_http_server.app uses a module listed above it, which is the healthy direction.
crab.core.output uses crab.core.error, so a change to crab.core.error can break crab.core.output, while a change to crab.core.output can't break crab.core.error.
Position
Below the diagonal: crab.core.output uses a module listed above it, which is the healthy direction.
crab.storage.store uses crab_types.storage, so a change to crab_types.storage can break crab.storage.store, while a change to crab.storage.store can't break crab_types.storage.
Position
Below the diagonal: crab.storage.store uses a module listed above it, which is the healthy direction.
crab.storage.store uses crab_storage.layout, so a change to crab_storage.layout can break crab.storage.store, while a change to crab.storage.store can't break crab_storage.layout.
Position
Below the diagonal: crab.storage.store uses a module listed above it, which is the healthy direction.
crab.storage.store uses crab_storage.store, so a change to crab_storage.store can break crab.storage.store, while a change to crab.storage.store can't break crab_storage.store.
Position
Below the diagonal: crab.storage.store uses a module listed above it, which is the healthy direction.
crab.storage.store uses crab.core.error, so a change to crab.core.error can break crab.storage.store, while a change to crab.storage.store can't break crab.core.error.
Position
Below the diagonal: crab.storage.store uses a module listed above it, which is the healthy direction.
crab.cmd.exp uses crab_workflow.stage_name, so a change to crab_workflow.stage_name can break crab.cmd.exp, while a change to crab.cmd.exp can't break crab_workflow.stage_name.
Position
Below the diagonal: crab.cmd.exp uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in crab.cmd.exp uses a type in crab.core.config.
The types involved
crab.cmd.exp.exp$module → crab.core.config.Config
Direction
crab.cmd.exp uses crab.core.config, so a change to crab.core.config can break crab.cmd.exp, while a change to crab.cmd.exp can't break crab.core.config.
Position
Below the diagonal: crab.cmd.exp uses a module listed above it, which is the healthy direction.
crab.cmd.exp uses crab.core.output, so a change to crab.core.output can break crab.cmd.exp, while a change to crab.cmd.exp can't break crab.core.output.
Position
Below the diagonal: crab.cmd.exp uses a module listed above it, which is the healthy direction.
crab.cmd.exp uses crab.storage.store, so a change to crab.storage.store can break crab.cmd.exp, while a change to crab.cmd.exp can't break crab.storage.store.
Position
Below the diagonal: crab.cmd.exp uses a module listed above it, which is the healthy direction.
crab.cmd.metadb uses crab_metadata.manifests, so a change to crab_metadata.manifests can break crab.cmd.metadb, while a change to crab.cmd.metadb can't break crab_metadata.manifests.
Position
Below the diagonal: crab.cmd.metadb uses a module listed above it, which is the healthy direction.
crab.cmd.metadb uses crab_types.storage, so a change to crab_types.storage can break crab.cmd.metadb, while a change to crab.cmd.metadb can't break crab_types.storage.
Position
Below the diagonal: crab.cmd.metadb uses a module listed above it, which is the healthy direction.
crab.cmd.metadb uses crab.core.config, so a change to crab.core.config can break crab.cmd.metadb, while a change to crab.cmd.metadb can't break crab.core.config.
Position
Below the diagonal: crab.cmd.metadb uses a module listed above it, which is the healthy direction.
crab.cmd.metadb uses crab_storage.layout, so a change to crab_storage.layout can break crab.cmd.metadb, while a change to crab.cmd.metadb can't break crab_storage.layout.
Position
Below the diagonal: crab.cmd.metadb uses a module listed above it, which is the healthy direction.
crab.cmd.metadb uses crab.core.error, so a change to crab.core.error can break crab.cmd.metadb, while a change to crab.cmd.metadb can't break crab.core.error.
Position
Below the diagonal: crab.cmd.metadb uses a module listed above it, which is the healthy direction.
crab.cmd.metadb uses crab.core.output, so a change to crab.core.output can break crab.cmd.metadb, while a change to crab.cmd.metadb can't break crab.core.output.
Position
Below the diagonal: crab.cmd.metadb uses a module listed above it, which is the healthy direction.
crab.cmd.metadb uses crab.storage.store, so a change to crab.storage.store can break crab.cmd.metadb, while a change to crab.cmd.metadb can't break crab.storage.store.
Position
Below the diagonal: crab.cmd.metadb uses a module listed above it, which is the healthy direction.
crab.git.remote_helper uses crab.core.metrics, so a change to crab.core.metrics can break crab.git.remote_helper, while a change to crab.git.remote_helper can't break crab.core.metrics.
Position
Below the diagonal: crab.git.remote_helper uses a module listed above it, which is the healthy direction.
crab.git.remote_helper uses crab_metadata.manifests, so a change to crab_metadata.manifests can break crab.git.remote_helper, while a change to crab.git.remote_helper can't break crab_metadata.manifests.
Position
Below the diagonal: crab.git.remote_helper uses a module listed above it, which is the healthy direction.
crab.git.remote_helper uses crab.core.config, so a change to crab.core.config can break crab.git.remote_helper, while a change to crab.git.remote_helper can't break crab.core.config.
Position
Below the diagonal: crab.git.remote_helper uses a module listed above it, which is the healthy direction.
crab.git.remote_helper uses crab_storage.layout, so a change to crab_storage.layout can break crab.git.remote_helper, while a change to crab.git.remote_helper can't break crab_storage.layout.
Position
Below the diagonal: crab.git.remote_helper uses a module listed above it, which is the healthy direction.
crab.git.remote_helper uses crab_cache_store, so a change to crab_cache_store can break crab.git.remote_helper, while a change to crab.git.remote_helper can't break crab_cache_store.
Position
Below the diagonal: crab.git.remote_helper uses a module listed above it, which is the healthy direction.
crab.git.remote_helper uses crab.core.error, so a change to crab.core.error can break crab.git.remote_helper, while a change to crab.git.remote_helper can't break crab.core.error.
Position
Below the diagonal: crab.git.remote_helper uses a module listed above it, which is the healthy direction.
crab.git.remote_helper uses crab.core.output, so a change to crab.core.output can break crab.git.remote_helper, while a change to crab.git.remote_helper can't break crab.core.output.
Position
Below the diagonal: crab.git.remote_helper uses a module listed above it, which is the healthy direction.
crab.git.remote_helper uses crab.storage.store, so a change to crab.storage.store can break crab.git.remote_helper, while a change to crab.git.remote_helper can't break crab.storage.store.
Position
Below the diagonal: crab.git.remote_helper uses a module listed above it, which is the healthy direction.
33→37 crab.git.remote_helper uses crab.git.pushpart of a loop✕
Connections
2 pairs of types, where a type in crab.git.remote_helper uses a type in crab.git.push.
crab.git.remote_helper uses crab.git.push, so a change to crab.git.push can break crab.git.remote_helper, while a change to crab.git.remote_helper can't break crab.git.push.
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.
crab.replication uses crab_metadata.manifests, so a change to crab_metadata.manifests can break crab.replication, while a change to crab.replication can't break crab_metadata.manifests.
Position
Below the diagonal: crab.replication uses a module listed above it, which is the healthy direction.
crab.replication uses crab.core.config, so a change to crab.core.config can break crab.replication, while a change to crab.replication can't break crab.core.config.
Position
Below the diagonal: crab.replication uses a module listed above it, which is the healthy direction.
crab.replication uses crab_storage.layout, so a change to crab_storage.layout can break crab.replication, while a change to crab.replication can't break crab_storage.layout.
Position
Below the diagonal: crab.replication uses a module listed above it, which is the healthy direction.
crab.replication uses crab.cmd.mirror.history, so a change to crab.cmd.mirror.history can break crab.replication, while a change to crab.replication can't break crab.cmd.mirror.history.
Position
Below the diagonal: crab.replication uses a module listed above it, which is the healthy direction.
crab.replication uses crab.core.error, so a change to crab.core.error can break crab.replication, while a change to crab.replication can't break crab.core.error.
Position
Below the diagonal: crab.replication uses a module listed above it, which is the healthy direction.
crab.replication uses crab.storage.store, so a change to crab.storage.store can break crab.replication, while a change to crab.replication can't break crab.storage.store.
Position
Below the diagonal: crab.replication uses a module listed above it, which is the healthy direction.
34→40 crab.replication uses crab.cmd.replicapart of a loop✕
Connections
1 pair of types, where a type in crab.replication uses a type in crab.cmd.replica.
crab.replication uses crab.cmd.replica, so a change to crab.cmd.replica can break crab.replication, while a change to crab.replication can't break crab.cmd.replica.
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.
crab.cmd.gc uses crab_metadata.manifests, so a change to crab_metadata.manifests can break crab.cmd.gc, while a change to crab.cmd.gc can't break crab_metadata.manifests.
Position
Below the diagonal: crab.cmd.gc uses a module listed above it, which is the healthy direction.
crab.cmd.gc uses crab_storage.layout, so a change to crab_storage.layout can break crab.cmd.gc, while a change to crab.cmd.gc can't break crab_storage.layout.
Position
Below the diagonal: crab.cmd.gc uses a module listed above it, which is the healthy direction.
crab.cmd.gc uses crab.storage.store, so a change to crab.storage.store can break crab.cmd.gc, while a change to crab.cmd.gc can't break crab.storage.store.
Position
Below the diagonal: crab.cmd.gc uses a module listed above it, which is the healthy direction.
crab.cmd.run uses crab.core.metrics, so a change to crab.core.metrics can break crab.cmd.run, while a change to crab.cmd.run can't break crab.core.metrics.
Position
Below the diagonal: crab.cmd.run uses a module listed above it, which is the healthy direction.
crab.cmd.run uses crab_workflow.stage_name, so a change to crab_workflow.stage_name can break crab.cmd.run, while a change to crab.cmd.run can't break crab_workflow.stage_name.
Position
Below the diagonal: crab.cmd.run uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in crab.cmd.run uses a type in crab.core.config.
The types involved
crab.cmd.run.run$module → crab.core.config.Config
Direction
crab.cmd.run uses crab.core.config, so a change to crab.core.config can break crab.cmd.run, while a change to crab.cmd.run can't break crab.core.config.
Position
Below the diagonal: crab.cmd.run uses a module listed above it, which is the healthy direction.
crab.cmd.run uses crab.core.output, so a change to crab.core.output can break crab.cmd.run, while a change to crab.cmd.run can't break crab.core.output.
Position
Below the diagonal: crab.cmd.run uses a module listed above it, which is the healthy direction.
crab.git.push uses crab.core.metrics, so a change to crab.core.metrics can break crab.git.push, while a change to crab.git.push can't break crab.core.metrics.
Position
Below the diagonal: crab.git.push uses a module listed above it, which is the healthy direction.
crab.git.push uses crab_cache.local_cache, so a change to crab_cache.local_cache can break crab.git.push, while a change to crab.git.push can't break crab_cache.local_cache.
Position
Below the diagonal: crab.git.push uses a module listed above it, which is the healthy direction.
crab.git.push uses crab_metadata.manifests, so a change to crab_metadata.manifests can break crab.git.push, while a change to crab.git.push can't break crab_metadata.manifests.
Position
Below the diagonal: crab.git.push uses a module listed above it, which is the healthy direction.
crab.git.push uses crab.core.config, so a change to crab.core.config can break crab.git.push, while a change to crab.git.push can't break crab.core.config.
Position
Below the diagonal: crab.git.push uses a module listed above it, which is the healthy direction.
crab.git.push uses crab_storage.layout, so a change to crab_storage.layout can break crab.git.push, while a change to crab.git.push can't break crab_storage.layout.
Position
Below the diagonal: crab.git.push uses a module listed above it, which is the healthy direction.
crab.git.push uses crab_cache_store, so a change to crab_cache_store can break crab.git.push, while a change to crab.git.push can't break crab_cache_store.
Position
Below the diagonal: crab.git.push uses a module listed above it, which is the healthy direction.
crab.git.push uses crab_metadata.manifest_store, so a change to crab_metadata.manifest_store can break crab.git.push, while a change to crab.git.push can't break crab_metadata.manifest_store.
Position
Below the diagonal: crab.git.push uses a module listed above it, which is the healthy direction.
crab.git.push uses crab.core.error, so a change to crab.core.error can break crab.git.push, while a change to crab.git.push can't break crab.core.error.
Position
Below the diagonal: crab.git.push uses a module listed above it, which is the healthy direction.
crab.git.push uses crab.storage.store, so a change to crab.storage.store can break crab.git.push, while a change to crab.git.push can't break crab.storage.store.
Position
Below the diagonal: crab.git.push uses a module listed above it, which is the healthy direction.
crab.git.push uses crab.git.remote_helper, so a change to crab.git.remote_helper can break crab.git.push, while a change to crab.git.push can't break crab.git.remote_helper.
Position
Below the diagonal: crab.git.push uses a module listed above it, which is the healthy direction.
crab.cmd.add uses crab.core.output, so a change to crab.core.output can break crab.cmd.add, while a change to crab.cmd.add can't break crab.core.output.
Position
Below the diagonal: crab.cmd.add uses a module listed above it, which is the healthy direction.
crab.cmd.hydrate uses crab.core.metrics, so a change to crab.core.metrics can break crab.cmd.hydrate, while a change to crab.cmd.hydrate can't break crab.core.metrics.
Position
Below the diagonal: crab.cmd.hydrate uses a module listed above it, which is the healthy direction.
crab.cmd.hydrate uses crab_types.pointer, so a change to crab_types.pointer can break crab.cmd.hydrate, while a change to crab.cmd.hydrate can't break crab_types.pointer.
Position
Below the diagonal: crab.cmd.hydrate uses a module listed above it, which is the healthy direction.
crab.cmd.hydrate uses crab.core.config, so a change to crab.core.config can break crab.cmd.hydrate, while a change to crab.cmd.hydrate can't break crab.core.config.
Position
Below the diagonal: crab.cmd.hydrate uses a module listed above it, which is the healthy direction.
crab.cmd.hydrate uses crab_storage.layout, so a change to crab_storage.layout can break crab.cmd.hydrate, while a change to crab.cmd.hydrate can't break crab_storage.layout.
Position
Below the diagonal: crab.cmd.hydrate uses a module listed above it, which is the healthy direction.
crab.cmd.hydrate uses crab_cache_store, so a change to crab_cache_store can break crab.cmd.hydrate, while a change to crab.cmd.hydrate can't break crab_cache_store.
Position
Below the diagonal: crab.cmd.hydrate uses a module listed above it, which is the healthy direction.
crab.cmd.hydrate uses crab.core.error, so a change to crab.core.error can break crab.cmd.hydrate, while a change to crab.cmd.hydrate can't break crab.core.error.
Position
Below the diagonal: crab.cmd.hydrate uses a module listed above it, which is the healthy direction.
crab.cmd.hydrate uses crab.core.output, so a change to crab.core.output can break crab.cmd.hydrate, while a change to crab.cmd.hydrate can't break crab.core.output.
Position
Below the diagonal: crab.cmd.hydrate uses a module listed above it, which is the healthy direction.
crab.cmd.hydrate uses crab.storage.store, so a change to crab.storage.store can break crab.cmd.hydrate, while a change to crab.cmd.hydrate can't break crab.storage.store.
Position
Below the diagonal: crab.cmd.hydrate uses a module listed above it, which is the healthy direction.
crab.cmd.hydrate uses crab.cmd.add, so a change to crab.cmd.add can break crab.cmd.hydrate, while a change to crab.cmd.hydrate can't break crab.cmd.add.
Position
Below the diagonal: crab.cmd.hydrate uses a module listed above it, which is the healthy direction.
crab.cmd.replica uses crab.core.config, so a change to crab.core.config can break crab.cmd.replica, while a change to crab.cmd.replica can't break crab.core.config.
Position
Below the diagonal: crab.cmd.replica uses a module listed above it, which is the healthy direction.
crab.cmd.replica uses crab.core.error, so a change to crab.core.error can break crab.cmd.replica, while a change to crab.cmd.replica can't break crab.core.error.
Position
Below the diagonal: crab.cmd.replica uses a module listed above it, which is the healthy direction.
crab.cmd.replica uses crab.core.output, so a change to crab.core.output can break crab.cmd.replica, while a change to crab.cmd.replica can't break crab.core.output.
Position
Below the diagonal: crab.cmd.replica uses a module listed above it, which is the healthy direction.
crab.cmd.replica uses crab.cmd.exp, so a change to crab.cmd.exp can break crab.cmd.replica, while a change to crab.cmd.replica can't break crab.cmd.exp.
Position
Below the diagonal: crab.cmd.replica uses a module listed above it, which is the healthy direction.
28 pairs of types, where a type in crab.cmd.replica uses a type in crab.replication. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
crab.cmd.replica uses crab.replication, so a change to crab.replication can break crab.cmd.replica, while a change to crab.cmd.replica can't break crab.replication.
Position
Below the diagonal: crab.cmd.replica uses a module listed above it, which is the healthy direction.
crab.cmd.replica uses crab.cmd.add, so a change to crab.cmd.add can break crab.cmd.replica, while a change to crab.cmd.replica can't break crab.cmd.add.
Position
Below the diagonal: crab.cmd.replica uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 58.1 · Adequate · gated by D2, R3 ·
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
147
High / Critical
A03:2025 — Software Supply Chain Failures
110
High / Critical
A02:2025 — Security Misconfiguration
67
High / Critical
A07:2025 — Authentication Failures
2
High / Critical
Roadmap
Top priorities: Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2); Add tests that import the unreached modules (directly or through their public entry); 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
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2).
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.
Bring the 5 bodies over 120 down to 120 or less in Cognitive Complexity — start with App.RepositoryPage (cognitive 372), crab::run_cli_stub (cognitive 289), crab::cmd::add::execute_add (cognitive 141).
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 — 181
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 — 4478
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 — 198
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 8
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
This survey is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. All 94 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 — 94 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, 4794 of 4857 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.
D10 Test Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 44 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 300 test source file(s) (.rs, .py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability NOT SCORED: this repository's production source includes .rs, and the rust executor ran against the .rs half and never executed — so reliability was not measured for the repository as a whole. The JavaScript/TypeScript (vitest via `npm ci --ignore-scripts` in packages/ui/ (61 tests); vitest via `npm ci --ignore-scripts` in packages/web/ (10 tests)): measured (0 flaky) suite(s) did re-run, and came back with 0 flaky across 1 measured tier(s) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
D12 Dependency Hygiene — 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. Currency was graded against Maven Central, but whether an artifact is DEPRECATED is not: Maven Central publishes no deprecation marker, exactly as rubygems.org does not. Whether one is UNMAINTAINED is not graded either — no registry publishes a maintenance status, and release age does not stand in for one. Two of this dimension's four signals are therefore unread on a Maven tree, and its score reflects currency alone.
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-contributor repository — bus factor is not applicable (1 contributor(s) across 494 commit(s) sampled, automation and bot accounts excluded). Concentration needs a team to concentrate: with one contributor there is nobody to spread the knowledge to, so 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.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D21 Naming Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated per language (docs/plans/deterministic-engine.md, P5; C# and each NeutralApiArms arm pass): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `packages/ui/src/api.ts`, `packages/ui/src/content.tsx`, `packages/ui/src/duckdb-query.ts`, `packages/ui/src/sqlite-query.worker.ts`, `packages/web/.source/browser.ts`, … (+3 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D41 Kernel & Syscall Confinement — 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. Crates/crab-http-server/deploy/helm/crab-http-server/templates/deployment.yaml:14, crates/crab-s3-gateway/deploy/helm/crab-s3-gateway/templates/deployment.yaml:2 did not read as a pod spec (a templated manifest such as Helm's that is not YAML until rendered, or a workload whose pod spec this check does not locate), so the seccomp/AppArmor profile in force there was not judged and no row about them can appear on this card.
AX6 Interface segregation — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
AXR1 Runtime accessibility — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (crates/crab-s3-gateway/deploy/compose.yaml). compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.gateway-standby.environment.AWS_ACCESS_KEY_ID: required variable RUSTFS_ACCESS_KEY is missing a value: set RUSTFS_ACCESS_KEY; runtime evidence skipped.
M4 Documentation accuracy — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9), and artefact counts an order of magnitude off. Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
R10 Code Duplication — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 53 further occurrence(s) are not listed individually; the score already reflects all 93.
R2 Cyclomatic Complexity — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 16 further occurrence(s) are not listed individually; the score already reflects all 56.
R4 Test Coverage — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 106 further occurrence(s) are not listed individually; the score already reflects all 146.
X10 Duplicated predicate — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 50 further occurrence(s) are not listed individually; the score already reflects all 90.
X17 Uncapped recursion over a caller-supplied document — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 41 further occurrence(s) are not listed individually; the score already reflects all 81.
X24 Document value interpolated into markup unescaped — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X3 Exception handling — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 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.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned REDACTED, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
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.
AC4 Keyboard semantics: Keyboard semantics are inferred from markup attributes — interactivity wired purely in script, focus managed at runtime, and component-level handlers are invisible. A clean result means "no static keyboard-trap shape", not a keyboard-operability proof.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
C3 Audit Trail: This control is scored from in-repo evidence only — a working control configured outside the repository leaves no signal a static scan can credit.
C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
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.
363 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was crab::run_cli_stub at 252. A further 42 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 crab::core::error_catalog::error_code at 163 — they are counted neither in the figure above nor in this dimension's score. 19 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: crab/src/core/error_catalog.rs (crab::core::error_catalog::error_code at 163), crab/src/core/error.rs (CrabError::code at 162), crates/crab-http-server/src/app.rs (Error::into_response at 44), crab/src/storage/retry.rs (crab::storage::retry::retry_class at 31), crates/crab-http-server/src/contents.rs (Error::into_response at 23), and 14 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 168 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with crab::run_cli_stub (cyclomatic 252). — Refactoring it lifts Cyclomatic Complexity from 5.0 to about 5.8/10.
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.
+ 259 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 5 bodies over 120 down to 120 or less in Cognitive Complexity — start with App.RepositoryPage (cognitive 372), crab::run_cli_stub (cognitive 289), crab::cmd::add::execute_add (cognitive 141). — 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 5 together lifts Cognitive Complexity from 2.5 to about 4.4/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.1 / 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 243 FunctionTooLong finding(s) in God Classes — start with page.tsx (11), replica.rs (7), metadb.rs (6). — One of this dimension's main actionable groups (243 warning-level).
Resolve the 224 FileTooLong finding(s) in God Classes — start with mod.rs (5), metrics.rs (5), page.tsx (4). — One of this dimension's main actionable groups (224 warning-level).
Resolve the 61 MethodTooLong finding(s) in God Classes — start with index.rs (15), error.rs (6), gateway.rs (4). — One of this dimension's main actionable groups (61 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.
1349 duplicated block group(s) detected. 6.9 % of the production lines (55,395 of 800,115) are in a reported copy. A further 854 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 10 of the 2203 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.
+ 357 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 130 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with pack.rs (8), index.rs (8), mod.rs (6). — One of this dimension's main actionable groups (130 warning-level).
Resolve the 102 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with mod.rs (7), push.rs (5), migrate.rs (4). — One of this dimension's main actionable groups (102 warning-level).
Resolve the 92 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with metrics.rs (5), lib.rs (4), pull_review_threads.rs (3). — One of this dimension's main actionable groups (92 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling7.4 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
28 production modules (Maven+Cargo+npm), 0 dependency cycle(s), 1 unstable depended-on module(s). Read from the build's own module declarations; 8 module(s) off the main sequence, with abstractness counted on 27 of the 28 (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: crab-types · ×8
Unstable project crab-vfs
What to do
Resolve the 8 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 1 Unstable project crab-vfs finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 6 Low cohesion finding(s) in Cohesion (LCOM4) — start with local.rs (2), mirror.rs, store.rs. — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Detailed fixes: d7_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 44 tests. Measured on the JavaScript/TypeScript suite only — at least 300 test source file(s) (.rs, .py) went unread, so its test quality is unmeasured and is not in these counts.
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.
44 outdated artifact(s) of 47 resolved by the build, graded against Maven Central. Whether any of these is DEPRECATED is not graded — Maven Central publishes no deprecation marker, exactly as rubygems.org does not. Whether any is UNMAINTAINED is not graded either: no registry publishes a maintenance status, and release age does not stand in for one. Known CVEs in this graph are D30's question, read from the manifest there.
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.
1 secret(s) detected. 1 detection(s) were excluded as holding no minted credential in material that runs: a name, reference or comparison rather than a value, a readable phrase or pattern, a value that declares itself fake, or development, test, example, mock or demo material.
REDACTED
What to do
Resolve the 2 Leaked secret finding(s) in Secret Scanning — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
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 874 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. A further 6 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: crab/src/git/push.rs (47×62=2914); crab/src/cmd/add.rs (13×74=962); crab/src/cmd/metadb.rs (24×40=960) Repeated repair below the complexity floor: crab/src/cmd/mount.rs (4 of 6 changes were fixes); crab/src/cmd/lfs/checkout.rs (3 of 3 changes were fixes); crates/crab-vfs/src/engine.rs (3 of 3 changes were fixes)
Resolve the 77 Hotspot finding(s) in Churn × Complexity Hotspots — start with config.rs (3), push.rs (2), repack.rs (2). — One of this dimension's main actionable groups (77 warning-level).
Resolve the 4 Repeated repair finding(s) in Churn × Complexity Hotspots — start with mount.rs, checkout.rs, engine.rs. — One of this dimension's main actionable groups (4 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.
5 deducted task-comment markers across 800115 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
TodoComment · ×5REDACTED:379
What to do
Resolve the 5 TodoComment finding(s) in Explicit Debt — start with REDACTED, gcs.rs, s3.rs. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 354 document(s) read across 3 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality9.8 / 10Exemplary✓ 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.
1 of 13 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question, a date that is no calendar day). How well each record argues its case is not measured.
ADR declares no statusplans/018-product-readiness-roadmap.md:1detected by adr-integrity
✓ On the Gold path — maintain.
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
7 of 28 build units (Cargo, Python, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion · ×7crab/Cargo.toml:1
What to do
Resolve the 7 Projects may be oversized for their cohesion finding(s) in Project Cohesion — start with Cargo.toml (6), REDACTED. — One of this dimension's main actionable groups (7 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).
147 finding(s): 0 critical, 129 high, 6 medium, 12 low. 119 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 32 file(s) — `crab/scripts/check-architecture-gates.py`, `crab/scripts/check-replica-feature-matrix.sh` (line 130), `crab/scripts/e2e/run_cache_service_rustfs_smoke.py`, `crab/scripts/run-mount-large-macos-rustfs-smoke.sh` (lines 465–469, lines 470–471), `crab/src/coordination/pipelined_commit.rs` (line 121, line 144, line 169, …), … (+27 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 10 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
+ 8 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 4 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (2). — One of this dimension's main actionable groups (2 issue-level).
No action in Static Analysis (SAST) — all 119 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 (119 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.
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 22 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (18), REDACTED (3), REDACTED. — One of this dimension's main actionable groups (22 issue-level).
Resolve the 6 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (6 issue-level).
Resolve the 3 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 42 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (19), REDACTED (8), REDACTED (8). — One of this dimension's main actionable groups (42 warning-level).
Resolve the 11 High IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (11 issue-level).
Resolve the 1 Critical IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 issue-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 975 of the 1129 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.
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.
+ 2 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 (2). — 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 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:12
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 3 platform declaration(s) and 19 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 alternatives6.5 / 10Adequate✓ 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.
Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation). — packages/ui/src/file-preview.tsx:280
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 structure7.9 / 10Strong✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one. — packages/web/app/landing-page-client.tsx:296
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether interactive behaviour is keyboard-reachable — no click handler on a non-interactive element lacking a role, tabindex and key handler, no element the repo's own CSS styles `cursor: pointer` without giving it any of the three, no unfocusable element whose only binding is a mouse enter/leave pair or a double-click, no positive tabindex, no href-less anchor, no placeholder-href (#/javascript) link acting as a button. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: click handlers on non-interactive elements lacking role+tabindex+key handler, positive tabindex values, and href-less anchors. Components skipped, spreads suppressed. Deterministic, hard fact per element.
Coverage: Population: elements that pose a keyboard-semantics question, in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) — a non-natively-interactive element carrying a click handler, a double-click or hover enter/leave binding, a pointer-only gesture on a tabindex="0" element, or `cursor: pointer` from the repo's own CSS; an href-less or placeholder-href (#, javascript:) anchor; and any element with a positive tabindex. Natively interactive elements used correctly (<button>, <a href>, form controls) are NOT in the population — there is nothing to judge — so a page of nothing but correct controls gives AC4 nothing to measure. Keyboard reachability is judged from the markup, never from a rendered page. ★ An interactive element declared in a tagged-template (html`…`) or hyperscript frontend is NOT in this population — no producer reads either — so an empty population is reported as an analyzer gap, never as "this repository has no interactive elements".
This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus. — packages/web/components/marketing/testimonials-carousel.tsx:135
This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close. — packages/web/components/navigation/mobile-nav.tsx:93
What to do
Make custom controls keyboard-operable (role + tabindex + key handler), drop positive tabindex, and give anchors a real href.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade. — packages/web/components/library/knowledge-check.tsx:120
<span> moves — its `animate-[typing-cursor-blink_1s_step-end_infinite]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:. — packages/web/components/marketing/typing-code.tsx:232
`.tree-search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/style.css:4516
`.code-symbols-search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/style.css:5013
`.data-search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/style.css:5188
`.data-schema-search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible. — packages/ui/src/style.css:5656
`.inline-review-annotation` moves (`transition: background-color 120ms ease,
border-color 120ms ease,
transform 120ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce. — packages/ui/src/style.css:795
What to do
Keep a visible focus style (don't remove the outline without a replacement), guard animation with prefers-reduced-motion, and raise low-contrast colour pairs to at least 4.5:1.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
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.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
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.
`Authentication.load_git_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/crab-http-server/src/auth.rs:50
`ref_registry$module.load_ref_registry_summary` 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/crab-metadata/src/ref_registry.rs:591
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?
C1 · Data Protection6.5 / 10Adequate✓ Tool-verified
Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
What to do
Strengthen data-at-rest protection: vault your keys (AWS KMS / Secrets Manager, GCP KMS / Secret Manager, Azure Key Vault, HashiCorp Vault — not a key read from an environment variable beside the data) and encrypt the most sensitive columns (an AEAD over the field before Diesel/sqlx write it, SQLCipher, pgcrypto) — partial coverage still leaves gaps.
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.
Do you agree with this assessment?
C3 · Audit Trail7.5 / 10Strong✓ Tool-verified
Other · Security — Whether changes to sensitive data are recorded (who, what, when) for compliance + incident response.
An audit mechanism is present, but the trail is not yet complete — missing: a write-side hook every change flows through (a SeaORM ActiveModelBehavior hook or a database trigger recording each change, or an event-sourced store), per-entity coverage (an event-sourced aggregate, or a hook on each entity that needs a who-changed-what trail).
What to do
Back the audit convention with a structural mechanism: a SeaORM ActiveModelBehavior before_save/after_save hook or a database trigger writing each sensitive change to an audit-log table, with the acting user and time on every entry.
Do you agree with this assessment?
C4 · Data Retention7.5 / 10Strong✓ Tool-verified
Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).
Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.
A retention mechanism is present, but the data-lifecycle is not yet complete — missing: an expiry limit — a declared maximum age / TTL after which the data is no longer kept.
What to do
Complete the data-lifecycle story: an expiry limit (a declared maximum age for the stored data — a retention-age setting, or a store-level TTL where your storage offers one), a scheduled purge/cleanup job that enforces it, and a documented retention period covering the personal data.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model8.0 / 10Strong✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
`ComputedPaths` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside. — crates/crab-vfs/src/daemon.rs:166
What to do
Move the domain logic onto the entity (invariant-enforcing `&mut self` commands) instead of a foreign service.
Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Other · Code Health — Unreviewed-generation residue in this repository's Rust: functions whose whole body is still `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, and placeholder text (lorem ipsum, changeme/replace_me…) left in strings of non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords, in this repository's Rust: functions whose body is `todo!()`/`unimplemented!()` or only panics with a "not implemented" message, match arms and branches left as `todo!()`, functions that take inputs and return a constant (`Ok(())`, `None`, `Default::default()`, an empty `Vec`) or do nothing, and impls most of whose methods are holes.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`remove_temporary` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crab/src/cmd/data.rs:1818
`print_mixed_pointer_content` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crab/src/cmd/diff_driver.rs:339
`print_row` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crab/src/cmd/du.rs:380
`print_row_with_count` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crab/src/cmd/du.rs:384
`check_object_lock` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crab/src/cmd/gc/class_aware.rs:211
`print_root_help` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crab/src/cmd/help.rs:104
`generate_bash_completion` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crab/src/cmd/install.rs:673
`generate_zsh_completion` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crab/src/cmd/install.rs:695
`generate_fish_completion` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crab/src/cmd/install.rs:738
`skip_missing_lfs_content` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crab/src/cmd/lfs/checkout.rs:128
`print_extension` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crab/src/cmd/lfs/ext.rs:32
`render_failover_automation_policy` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crab/src/cmd/replica.rs:12427
`print_summary` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crab/src/cmd/status.rs:1052
`no_attrs` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crab/src/core/pathmatch.rs:135
`trace_phase` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crab/src/core/perf_phase.rs:124
`record_failure_stage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crab/src/git/push.rs:16308
`clear_readiness_cache_invalidation` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crab/src/replication/mod.rs:9262
`append_metric_header` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/crab-cache-server/src/metrics.rs:860
`log_request_summary` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/crab-cache-server/src/metrics.rs:906
`sector_size` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/crab-cache/src/private_fs/platform/database/file.rs:261
`observe_storage_read` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/crab-remote-git/src/reader.rs:1843
`insert_pack_index_source_size` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/crab-remote-git/src/runtime.rs:769
`debug_file_summary` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/crab-staging/src/add_push_plan.rs:272
`report_completion` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it. — crates/crab-xet/src/upload_concurrency.rs:102
`verify_compressed_chunk` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — crates/crab-xet/src/xorb/parser.rs:297
What to do
Finish or delete the unfinished stubs (functions that throw "not implemented", or whose body is empty or a bare constant) — they are dead surface that looks live.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
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.
`diagram/crab-internal-architecture/crab-internal-architecture.svg` draws the system's parts, and the drawing no longer matches the code: it leaves out `crab-auth-server`, `crab-auth-store`, `crab-cache-store`, `crab-coordination`, `crab-diff`, `crab-http-server`, `crab-remote-git`, `crab-s3-gateway`, `crab-sdk`, `crab-types`, `crab-write`, `crab-xet`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — diagram/crab-internal-architecture/crab-internal-architecture.svg:2
`crab/docs/architecture/multi-crate-transition.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `crab-auth-store`, `crab-http-server`, `crab-s3-gateway`, `crab-staging`, `crab-vfs`, `crab-write`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape. — crab/docs/architecture/multi-crate-transition.md:1836
What to do
Update diagram/crab-internal-architecture/crab-internal-architecture.svg so it draws the parts the code has today: add crab-auth-server, crab-auth-store, crab-cache-store, crab-coordination, crab-diff, crab-http-server, crab-remote-git, crab-s3-gateway, crab-sdk, crab-types, crab-write, crab-xet.
Update crab/docs/architecture/multi-crate-transition.md so it draws the parts the code has today: add crab-auth-store, crab-http-server, crab-s3-gateway, crab-staging, crab-vfs, crab-write.
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.
packages/web/README.md links to `../README.md`, but `packages/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — packages/web/README.md:353
crab/docs/architecture/README.md links to `decisions/README.md`, but `crab/docs/architecture/decisions/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/architecture/README.md:24
crab/docs/guides/README.md links to `crab-init.md`, but `crab/docs/guides/crab-init.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:10
crab/docs/guides/README.md links to `crab-clone.md`, but `crab/docs/guides/crab-clone.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:11
crab/docs/guides/README.md links to `crab-import.md`, but `crab/docs/guides/crab-import.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:13
crab/docs/guides/README.md links to `crab-install.md`, but `crab/docs/guides/crab-install.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:15
crab/docs/guides/README.md links to `crab-track.md`, but `crab/docs/guides/crab-track.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:16
crab/docs/guides/README.md links to `crab-add.md`, but `crab/docs/guides/crab-add.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:22
crab/docs/guides/README.md links to `crab-reset.md`, but `crab/docs/guides/crab-reset.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:23
crab/docs/guides/README.md links to `crab-hydrate.md`, but `crab/docs/guides/crab-hydrate.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:24
crab/docs/guides/README.md links to `crab-dehydrate.md`, but `crab/docs/guides/crab-dehydrate.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:25
crab/docs/guides/README.md links to `crab-status.md`, but `crab/docs/guides/crab-status.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:26
crab/docs/guides/README.md links to `crab-diff.md`, but `crab/docs/guides/crab-diff.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:27
crab/docs/guides/README.md links to `crab-fetch.md`, but `crab/docs/guides/crab-fetch.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:28
crab/docs/guides/README.md links to `crab-worktree.md`, but `crab/docs/guides/crab-worktree.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:29
crab/docs/guides/README.md links to `crab-ls-files.md`, but `crab/docs/guides/crab-ls-files.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:35
crab/docs/guides/README.md links to `crab-du.md`, but `crab/docs/guides/crab-du.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:36
crab/docs/guides/README.md links to `crab-stat.md`, but `crab/docs/guides/crab-stat.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:37
crab/docs/guides/README.md links to `crab-lock.md`, but `crab/docs/guides/crab-lock.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:43
crab/docs/guides/README.md links to `crab-gc.md`, but `crab/docs/guides/crab-gc.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:49
crab/docs/guides/README.md links to `crab-fsck.md`, but `crab/docs/guides/crab-fsck.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:50
crab/docs/guides/README.md links to `crab-repack.md`, but `crab/docs/guides/crab-repack.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:51
crab/docs/guides/README.md links to `crab-prune.md`, but `crab/docs/guides/crab-prune.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:57
crab/docs/guides/README.md links to `crab-staging.md`, but `crab/docs/guides/crab-staging.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:58
crab/docs/guides/README.md links to `crab-cache.md`, but `crab/docs/guides/crab-cache.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:59
crab/docs/guides/README.md links to `crab-migrate.md`, but `crab/docs/guides/crab-migrate.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:60
crab/docs/guides/README.md links to `crab-mount.md`, but `crab/docs/guides/crab-mount.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crab/docs/guides/README.md:66
What to do
Reconcile the README with reality: packages/web/README.md links to `../README.md`, but `packages/README.md` does not exist; crab/docs/architecture/README.md links to `decisions/README.md`, but `crab/docs/architecture/decisions/README.md` does not exist; crab/docs/guides/README.md links to `crab-init.md`, but `crab/docs/guides/crab-init.md` does not exist; crab/docs/guides/README.md links to `crab-clone.md`, but `crab/docs/guides/crab-clone.md` does not exist; crab/docs/guides/README.md links to `crab-import.md`, but `crab/docs/guides/crab-import.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.
1 public type in `crab.import.versions` is marked as implementation by its own namespace, folder or name: `VersionedListImpl` (crab/src/import/versions.rs:161, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers. — crab/src/import/versions.rs:161
What to do
Hide `crab.import.versions` (`VersionedListImpl`) (Rust: `pub(crate)`, or keep the module private): its own namespace, folder or name already says it is implementation, and hidden it can change without breaking a consumer.
Only 24/26 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `packages/web`.
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.
`REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`. — REDACTED:15
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Do you agree with this assessment?
P5 · DR & Backup10.0 / 10Exemplary✓ 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.
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.
`requests.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. — crab/scripts/qualify_sdk.py:141
`reqwest::blocking::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — crab/src/cmd/data.rs:355, crab/src/cmd/data.rs:813
`reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×5) — crab/src/replication/mod.rs:3206, crates/crab-coordination/src/cosmosdb_coordinator.rs:220, crates/crab-coordination/src/cosmosdb_coordinator.rs:882, …
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 · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from 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.
Do you agree with this assessment?
R1 · Type Safety9.9 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
React / JS · Code Health — The share of the scored frontend lines inside a near-exact copy-pasted block of substantial extent (the D4 clone algorithm over JS/TS tokens, D-386; each line once, 10 at none and 0 at a quarter of the lines, as D4): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Scored on the share of the scored frontend lines inside a reported copy, on the same curve as D4. Deterministic.
14 duplicated blocks under packages/web/app/ have copies in at least two of the sibling directories auth, blog, cache, cli, library, pricing (+1 more sibling(s) not listed) — 8 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 14 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/web/app/auth/page.tsx:277
13 duplicated blocks under packages/web/ have copies in at least two of the sibling directories app, components — 2 of them are reported below, and 11 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 13 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 13 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 13 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/web/app/blog/[slug]/page.tsx:218
6 duplicated blocks under packages/web/components/ have copies in at least two of the sibling directories blog, library, marketing, navigation — 0 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — packages/web/components/blog/lfs-compatibility-visuals.tsx:188
packages/ui/src/issues.tsx:41 · packages/ui/src/pulls.tsx:212 — the two spans are one implementation copied and then locally edited — 1542 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/issues.tsx:41
packages/web/app/auth/page.tsx:277 · packages/web/app/remote-services/page.tsx:110 — the two spans are one implementation copied and then locally edited — 234 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/web/app/auth/page.tsx:277
packages/ui/src/discussion-labels.tsx:115 · packages/ui/src/discussion-metadata.tsx:101 — the two spans are one implementation copied and then locally edited — 272 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/discussion-labels.tsx:115
packages/ui/src/issues.tsx:386 · packages/ui/src/issues.tsx:709 — the two spans are one implementation copied and then locally edited — 264 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/issues.tsx:386
packages/ui/src/refs.tsx:124 · packages/ui/src/releases.tsx:225 — the two spans are one implementation copied and then locally edited — 157 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/ui/src/refs.tsx:124
packages/web/app/cli/page.tsx:488 · packages/web/app/cli/page.tsx:607 — the two spans are one implementation copied and then locally edited — 150 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/web/app/cli/page.tsx:488
packages/web/app/diagrams/auth-internals-svg.tsx:85 · packages/web/app/diagrams/auth-internals-svg.tsx:208 — the two spans are one implementation copied and then locally edited — 592 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/web/app/diagrams/auth-internals-svg.tsx:85
packages/web/app/blog/[slug]/page.tsx:26 · packages/web/app/library/[slug]/page.tsx:58 — the two spans are one implementation copied and then locally edited — 223 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — packages/web/app/blog/[slug]/page.tsx:26
packages/web/components/blog/push-pipeline-visuals.tsx:540 · packages/web/components/blog/push-pipeline-visuals.tsx:584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/web/components/blog/push-pipeline-visuals.tsx:540
packages/ui/src/pulls.tsx:1224 · packages/ui/src/pulls.tsx:1521 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/ui/src/pulls.tsx:1224
packages/web/app/diagrams/cost-breakdown-svg.tsx:86 · packages/web/app/diagrams/cost-breakdown-svg.tsx:127 · packages/web/app/diagrams/cost-breakdown-svg.tsx:169 — 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. — packages/web/app/diagrams/cost-breakdown-svg.tsx:86
packages/web/components/marketing/counter.tsx:35 · packages/web/components/marketing/typing-code.tsx:77 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/web/components/marketing/counter.tsx:35
packages/web/app/diagrams/cache-hierarchy-svg.tsx:1 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:1 · packages/web/app/diagrams/cli-push-pipeline-svg.tsx:1 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — packages/web/app/diagrams/cache-hierarchy-svg.tsx:1
packages/ui/src/discussion-labels.tsx:210 · packages/ui/src/discussion-labels.tsx:325 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/ui/src/discussion-labels.tsx:210
packages/web/app/cache/page.tsx:532 · packages/web/app/cli/page.tsx:542 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/web/app/cache/page.tsx:532
packages/ui/src/content-editor.tsx:272 · packages/ui/src/content-editor.tsx:552 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/content-editor.tsx:272
packages/web/app/diagrams/cache-hierarchy-svg.tsx:76 · packages/web/app/diagrams/cache-hierarchy-svg.tsx:158 · packages/web/app/diagrams/remote-helper-flow-svg.tsx:104 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/web/app/diagrams/cache-hierarchy-svg.tsx:76
packages/web/app/diagrams/cache-hierarchy-svg.tsx:191 · packages/web/app/diagrams/cache-hierarchy-svg.tsx:272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/web/app/diagrams/cache-hierarchy-svg.tsx:191
packages/ui/src/content-editor.tsx:401 · packages/ui/src/content-editor.tsx:660 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/content-editor.tsx:401
packages/web/app/diagrams/cache-hierarchy-svg.tsx:21 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:20 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/web/app/diagrams/cache-hierarchy-svg.tsx:21
packages/web/app/diagrams/cache-hierarchy-svg.tsx:127 · packages/web/app/diagrams/cache-hierarchy-svg.tsx:209 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:86 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:287 · +3 more site(s) not listed — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/web/app/diagrams/cache-hierarchy-svg.tsx:127
packages/ui/src/content-editor.tsx:487 · packages/ui/src/content-editor.tsx:600 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/content-editor.tsx:487
packages/web/app/auth/page.tsx:695 · packages/web/app/pricing/page.tsx:589 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/web/app/auth/page.tsx:695
packages/web/components/blog/cache-visuals.tsx:427 · packages/web/components/blog/reconstruction-visuals.tsx:367 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/web/components/blog/cache-visuals.tsx:427
packages/web/app/auth/page.tsx:543 · packages/web/app/remote-services/page.tsx:156 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/web/app/auth/page.tsx:543
packages/web/app/cache/page.tsx:423 · packages/web/app/cache/page.tsx:573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/web/app/cache/page.tsx:423
packages/ui/src/content-editor.tsx:566 · packages/ui/src/content-editor.tsx:670 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/content-editor.tsx:566
packages/ui/src/release-api.ts:57 · packages/ui/src/release-api.ts:92 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — packages/ui/src/release-api.ts:57
packages/web/app/diagrams/remote-helper-flow-svg.tsx:10 · packages/web/app/landing-svgs.tsx:8 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/web/app/diagrams/remote-helper-flow-svg.tsx:10
packages/web/components/blog/gc-visuals.tsx:508 · packages/web/components/blog/lazy-checkout-visuals.tsx:406 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/web/components/blog/gc-visuals.tsx:508
packages/web/components/ui/alert.tsx:34 · packages/web/components/ui/card.tsx:33 · packages/web/components/ui/card.tsx:53 · packages/web/components/ui/table.tsx:19 · +2 more site(s) not listed — the 6 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/web/components/ui/alert.tsx:34
packages/web/components/ui/dropdown-menu.tsx:166 · packages/web/components/ui/dropdown-menu.tsx:206 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/web/components/ui/dropdown-menu.tsx:166
packages/ui/src/App.tsx:781 · packages/ui/src/App.tsx:842 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/ui/src/App.tsx:781
packages/ui/src/pulls.tsx:1063 · packages/ui/src/pulls.tsx:1097 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/ui/src/pulls.tsx:1063
packages/web/app/cli/page.tsx:569 · packages/web/app/cli/page.tsx:644 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — packages/web/app/cli/page.tsx:569
packages/web/app/diagrams/cache-hierarchy-svg.tsx:237 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:60 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:154 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:217 · +5 more site(s) not listed — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — packages/web/app/diagrams/cache-hierarchy-svg.tsx:237
packages/web/components/marketing/comparison-section.tsx:130 · packages/web/components/marketing/comparison-section.tsx:155 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — packages/web/components/marketing/comparison-section.tsx:130
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Architecture — Conformance to the detected frontend architecture layout (feature-sliced / layered src) plus cross-package deep-import rules (D-386).
Method: Conformance to the detected frontend layout (feature-sliced / layered src) plus cross-package deep-import rules, over the module graph. Deterministic.
packages/ui/src/App.tsx:78 reaches into another package with a relative path (../../web/crab.optimized.svg) — import the package by name instead. — packages/ui/src/App.tsx:78
packages/ui/src/duckdb-query.ts:2 imports @duckdb/duckdb-wasm/dist/duckdb-mvp.wasm?url, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/ui/src/duckdb-query.ts:2
packages/ui/src/duckdb-query.ts:3 imports @duckdb/duckdb-wasm/dist/duckdb-browser-mvp.worker.js?url, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/ui/src/duckdb-query.ts:3
packages/ui/src/pdf-preview.tsx:8 imports pdfjs-dist/build/pdf.worker.min.mjs?url, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/ui/src/pdf-preview.tsx:8
packages/ui/src/sqlite-query.worker.ts:2 imports sql.js/dist/sql-wasm.wasm?url, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead. — packages/ui/src/sqlite-query.worker.ts:2
What to do
Fix the listed violations: import through public entries (package exports / slice index), never reach into another layer or package's internals.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
(anonymous) has cyclomatic complexity 60 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/App.tsx:865
(anonymous) has cyclomatic complexity 50 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/tests/browser/repository.e2e.ts:195
RepositoryPage has cyclomatic complexity 47 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/App.tsx:511
(anonymous) has cyclomatic complexity 35 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/tests/browser/pulls.e2e.ts:127
(anonymous) has cyclomatic complexity 35 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/content.tsx:269
DataWorkbench has cyclomatic complexity 31 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/data-workbench.tsx:301
ReviewThreadCard has cyclomatic complexity 28 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pulls.tsx:1139
MergePanel has cyclomatic complexity 25 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pulls.tsx:1761
(anonymous) has cyclomatic complexity 22 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pulls.tsx:651
(anonymous) has cyclomatic complexity 21 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/tests/browser/releases.e2e.ts:33
statementBoundary has cyclomatic complexity 21 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/data-query.ts:64
HeroSection has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/web/components/marketing/hero-section.tsx:107
pull has cyclomatic complexity 20 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/tests/browser/pulls.e2e.ts:57
(anonymous) has cyclomatic complexity 20 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/web/components/library/knowledge-check.tsx:95
App has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/App.tsx:124
GitImport has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/git-import.tsx:19
NewRelease has cyclomatic complexity 17 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/release-form.tsx:375
RefsPage has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/refs.tsx:171
MemberSettings has cyclomatic complexity 16 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/settings.tsx:148
IssueDetail has cyclomatic complexity 16 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/issues.tsx:304
RevisionPicker has cyclomatic complexity 16 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/revision-picker.tsx:23
run has cyclomatic complexity 15 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/discussion-mutations.tsx:22
repositoryTarget has cyclomatic complexity 15 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/repository-markdown.tsx:28
NewPull has cyclomatic complexity 15 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pulls.tsx:462
compareCells has cyclomatic complexity 14 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/data-explorer.tsx:10
codeSymbolLanguage has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/code-symbols.ts:35
(anonymous) has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/content.tsx:974
DefaultBranchSettings has cyclomatic complexity 14 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/settings.tsx:587
(anonymous) has cyclomatic complexity 13 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/tests/browser/labels.e2e.ts:14
clonePath has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/git-import-source.ts:21
RefRow has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/refs.tsx:29
RepositoryTree has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/tree.tsx:25
(anonymous) has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. (×2) — packages/web/components/blog/git-architecture-player.tsx:488, packages/web/components/blog/git-architecture-player.tsx:524
Releases has cyclomatic complexity 13 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/releases.tsx:432
replaceSelectedLines has cyclomatic complexity 13 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/pull-review-model.ts:10
containingName has cyclomatic complexity 12 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/code-symbols.worker.ts:102
formatMarkdown has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/discussion.tsx:108
ArchiveSettings has cyclomatic complexity 12 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/ui/src/settings.tsx:776
(anonymous) has cyclomatic complexity 12 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — packages/web/app/pricing/page.tsx:372
Do you agree with this assessment?
R3 · Large Files2.7 / 10Weak✓ Tool-verified
React / JS · Code Health — How many source files exceed the large-file threshold.
Method: Components/modules exceeding the large-file threshold, counted exhaustively across the frontend source tree. Deterministic.
packages/ui/src/pulls.tsx has 2190 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/pulls.tsx:1
packages/ui/src/App.tsx has 1350 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/App.tsx:1
packages/ui/src/settings.tsx has 1188 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/settings.tsx:1
packages/ui/src/content.tsx has 1066 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/content.tsx:1
packages/web/components/blog/push-pipeline-visuals.tsx has 847 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/push-pipeline-visuals.tsx:1
packages/web/components/library/first-workflow-learning-labs.tsx has 810 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/library/first-workflow-learning-labs.tsx:1
packages/ui/src/issues.tsx has 785 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/issues.tsx:1
packages/web/app/cache/page.tsx has 730 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/app/cache/page.tsx:1
packages/ui/src/content-editor.tsx has 725 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/content-editor.tsx:1
packages/ui/src/data-workbench.tsx has 719 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/data-workbench.tsx:1
packages/web/app/cli/page.tsx has 698 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/app/cli/page.tsx:1
packages/web/app/auth/page.tsx has 691 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/app/auth/page.tsx:1
packages/web/components/blog/blog-diagrams.tsx has 661 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/blog-diagrams.tsx:1
packages/web/app/pricing/page.tsx has 625 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/app/pricing/page.tsx:1
packages/web/app/diagrams/use-case-visuals.tsx has 622 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/app/diagrams/use-case-visuals.tsx:1
packages/web/components/blog/lazy-checkout-visuals.tsx has 613 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/lazy-checkout-visuals.tsx:1
packages/web/components/blog/git-architecture-player.tsx has 591 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/git-architecture-player.tsx:1
packages/web/components/library/ml-workflow-visuals.tsx has 590 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/library/ml-workflow-visuals.tsx:1
packages/web/components/blog/cache-visuals.tsx has 553 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/cache-visuals.tsx:1
packages/ui/src/file-preview.tsx has 551 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/file-preview.tsx:1
packages/web/components/blog/consistency-visuals.tsx has 548 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/consistency-visuals.tsx:1
packages/ui/src/release-form.tsx has 546 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/release-form.tsx:1
packages/web/components/blog/reconstruction-visuals.tsx has 543 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/reconstruction-visuals.tsx:1
packages/web/components/blog/deduplication-visuals.tsx has 533 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/deduplication-visuals.tsx:1
packages/web/components/blog/gc-visuals.tsx has 531 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/gc-visuals.tsx:1
packages/ui/src/releases.tsx has 496 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/releases.tsx:1
packages/web/components/blog/lfs-compatibility-visuals.tsx has 491 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/lfs-compatibility-visuals.tsx:1
packages/web/components/blog/large-file-scale-explorer.tsx has 479 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/large-file-scale-explorer.tsx:1
packages/web/app/use-cases/page.tsx has 478 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/app/use-cases/page.tsx:1
packages/web/components/blog/blog-process-player.tsx has 475 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/blog-process-player.tsx:1
packages/web/app/library/page.tsx has 463 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/app/library/page.tsx:1
packages/web/app/page.tsx has 445 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/app/page.tsx:1
packages/web/components/blog/mount-visuals.tsx has 436 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/mount-visuals.tsx:1
packages/ui/src/api.ts has 421 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/api.ts:1
packages/web/components/blog/blog-detail-diagrams.tsx has 419 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/components/blog/blog-detail-diagrams.tsx:1
packages/web/app/library/[slug]/page.tsx has 409 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/web/app/library/[slug]/page.tsx:1
packages/ui/src/discussion-labels.tsx has 403 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/discussion-labels.tsx:1
packages/ui/src/tree.tsx has 401 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — packages/ui/src/tree.tsx:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage2.7 / 10Weak✓ Tool-verified
React / JS · Readiness — Static test reachability (D-386): the share of production files reachable from any test via the import graph — measured without running anything.
Method: Static test reachability: the share of production files reachable from any test via the import graph — measured without running anything. Deterministic.
No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one. (×40) — packages/web/components/blog/push-pipeline-visuals.tsx:1, packages/web/components/library/first-workflow-learning-labs.tsx:1, packages/web/app/cache/page.tsx:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each REDACTED script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: REDACTED scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code8.8 / 10Strong✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
Unreachable from the 54 application, 8 tooling and 21 test entry point(s) detected in this repo. Gate removals on `npm run build` — an undetected custom entry would make these reachable.
no import path from any entry point (54 application, 8 tooling, 21 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make (×10) — packages/web/app/landing-page-client.tsx, packages/web/components/ui/dropdown-menu.tsx, packages/web/components/marketing/community-section.tsx, …
Nothing imports this binding — it is safe to review for removal. (×5) — packages/ui/src/file-preview-model.ts:100, packages/web/components/marketing/loading-fallback.tsx:41, REDACTED:183, …
This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it. — packages/web/app/diagrams/auth-flow-svg.tsx:15
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Imported but not declared in any reachable REDACTED — installs work only by hoisting accident. (×2) — packages/web/lib/remark-mermaid.mjs:9, packages/web/source.config.ts:4
Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it. — REDACTED:40
What to do
Remove unused dependencies, declare unlisted imports explicitly, and demote type-/test-only packages to devDependencies.
React / JS · Architecture — Import cycles in the module graph (D-386) — files that can only be understood and changed together.
Method: Import cycles in the module graph, detected exhaustively over JS/TS imports (the same cycle detection as the .NET coupling dimension). Deterministic.
Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository commits the configuration that serves its own HTTP surface, so that configuration was read in full for the security response headers it sets. This repository serves HTTP itself (`.serve_connection(` (crates/crab-s3-gateway/src/server.rs:145)), 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. (×22) — crab/src/git/pack.rs:1197, crates/crab-git/src/incoming_pack.rs:522, crates/crab-git/src/incoming_pack.rs:554, …
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `vercel.json` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.) — packages/web/vercel.json:1
What to do
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 22 sites, not one: `crab/src/git/pack.rs:1197` (`Sha1::new`), `crates/crab-git/src/incoming_pack.rs:522` (`Sha1::new`), `crates/crab-git/src/incoming_pack.rs:554` (`Sha1::new`), `crates/crab-git/src/incoming_pack/prepared.rs:346` (`Sha1::new`), `crates/crab-git/src/incoming_pack/prepared.rs:612` (`Sha1::new`), `crates/crab-git/src/pack.rs:158` (`Sha1::new`), `crates/crab-git/src/pack.rs:936` (`Sha1::new`), `crates/crab-git/src/pack_locator.rs:206` (`Sha1::digest`), and 14 further site(s). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Set security response headers on the surface this repository serves: an `add_header` directive per header in the nginx/Caddy/Apache config, a `_headers` / `vercel.json` / `netlify.toml` entry for a static host, or `helmet()` in the HTTP server. `Content-Security-Policy` is the one that pays for itself first — it is what contains an injected script once one reaches the page — followed by `X-Content-Type-Options: nosniff` and a frame policy (`X-Frame-Options: DENY`, or CSP `frame-ancestors`). Where the app is served from a build container, the header configuration belongs in the image beside the built assets, so it ships with them rather than depending on where it lands.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader3.5 / 10Weak✓ Tool-verified
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.
`num_chunks` is read from the bytes being parsed at line 522 (`u32::from_le_bytes`), then used to size a `Vec::with_capacity` at line 557 — and nowhere in its scope is `num_chunks` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `num_chunks` against the bytes actually remaining and a maximum the format allows before allocating. — crab/src/git/push.rs:557
What to do
Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document1.1 / 10Critical✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`load_vars` is public, takes a document from its caller (line 118) and hands it to `merge_var_value`, which recurses at line 311 through `merge_var_mapping` and back with a piece of the document (and at line 324) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `merge_var_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-workflow/src/template/context.rs:311
`expand_matrix` is public, takes a document from its caller (line 46) and hands it to `substitute_template`, which recurses at line 235 through `substitute_command_template` and back with a piece of the document (and at line 239, line 241, line 250, line 269) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `substitute_template` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-workflow/src/template/matrix.rs:235
`with_operation` is public and takes a `Error` as its receiver from its caller, and it calls itself at line 80 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_operation` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-sdk/src/error.rs:80
`after_interruption` is public and takes a `Error` as its receiver from its caller, and it calls itself at line 475 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `after_interruption` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-remote-git/src/error.rs:475
`fmt` is public and takes a `GeneratedPackLeaseError` as its receiver from its caller, and it calls itself at line 203 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `fmt` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-remote-git/src/pack.rs:203
`latest` is public and takes a `PathStateIndex` as its receiver from its caller, and it calls itself at line 75 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `latest` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-remote-git/src/path_state.rs:75
`spawn_blocking` is public and takes a `RemoteGitRuntime` as its receiver from its caller, and it calls itself at line 449 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `spawn_blocking` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-remote-git/src/runtime.rs:449
`charge` is public and takes a `SharedBudget` as its receiver from its caller, and it calls itself at line 155 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `charge` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-remote-git/src/budget/shared.rs:155
`insert` is public and takes a `TreeEdits` as its receiver from its caller, and it calls itself at line 173 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `insert` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-remote/src/objects.rs:173
`apply_to_empty` is public, takes a document from its caller (line 198) and hands it to `build`, which calls itself at line 264 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `build` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-remote/src/objects.rs:264
`canonical_spec` is public and takes a `UploadPackFilter` as its receiver from its caller, and it calls itself at line 295 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `canonical_spec` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-read/src/upload_pack.rs:295
`is_catalog_exact` is public and takes a `UploadPackFilter` as its receiver from its caller, and it calls itself at line 317 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_catalog_exact` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-read/src/upload_pack.rs:317
`managed_openapi_breaking_changes` is public, takes a document from its caller (line 549) and hands it to `compare_schema`, which calls itself at line 717 with a piece of the document (and at line 727, line 746) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `compare_schema` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crates/crab-auth/src/managed/openapi.rs:717
`redact_details` is public, takes a document from its caller (line 152) and hands it to `redact_value`, which calls itself at line 164 with a piece of the document (and at line 170) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `redact_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/audit.rs:164
`retry_class` is public and takes `err: &CrabError` from its caller, and it calls itself at line 59 with a piece of the document (and at line 81, line 82) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `retry_class` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/retry.rs:59
`storage_scope` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 331 with a piece of the document (and at line 406) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `storage_scope` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:331
`with_bucket_identity` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 367 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_bucket_identity` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:367
`with_target_identity` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 373 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_target_identity` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:373
`with_signer` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 379 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_signer` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:379
`with_multipart` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 389 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_multipart` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:389
`has_resumable_multipart` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 395 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `has_resumable_multipart` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:395
`with_storage_scope` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 400 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_storage_scope` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:400
`with_read_routes` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 411 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_read_routes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:411
`with_read_byte_observer` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 417 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_read_byte_observer` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:417
`with_staging_writes` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 423 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_staging_writes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:423
`with_staging_write_store` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 435 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_staging_write_store` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:435
`staging_write_prefix` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 441 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `staging_write_prefix` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:441
`staged_writes` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 446 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `staged_writes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:446
`flush_staged_writes` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 450 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `flush_staged_writes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:450
`flush_staging_object` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 454 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `flush_staging_object` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:454
`bucket_identity` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 459 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `bucket_identity` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:459
`inner` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 464 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `inner` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:464
`put` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 468 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `put` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:468
`put_if_absent` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 473 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `put_if_absent` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:473
`create_strict` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 480 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `create_strict` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:480
`create_strict_with_etag` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 487 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `create_strict_with_etag` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:487
`put_overwrite` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 494 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `put_overwrite` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:494
`update` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 501 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `update` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:501
`put_exact` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 508 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `put_exact` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:508
`get_with_etag` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 515 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `get_with_etag` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — crab/src/storage/store.rs:515
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
`file_index_lookup` (line 124) is a `SharedFileIndexLookup` this function owns and never releases: no `close()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `SharedFileIndexLookup` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/crab-read/src/term_resolver.rs:124
`file_index_lookup` (line 271) is a `SharedFileIndexLookup` this function owns and never releases: no `close()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `SharedFileIndexLookup` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crates/crab-read/src/term_resolver.rs:271
`ticket` (line 49) is a `FixedSlotAdmissionTicket` released by `release()` only on the path that reaches line 58; the `return` on line 58 leaves before that with a success value, and on that path `FixedSlotAdmissionTicket` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure). — crates/crab-http-server/src/transfer_admission.rs:49
`file.into_raw_fd()` (line 761) gives up ownership in exchange for a raw handle — the value's `Drop` will no longer run — and the pointer it returns is thrown away on the spot, so nothing can ever hand it back. The memory or descriptor stays allocated until the process ends, once per call. Pair the hand-out with its reclaim (a `free` function that rebuilds the owner with `from_raw` and drops it), or keep the owning value. — crates/crab-cache/src/private_fs.rs:761
`std::mem::forget(connection)` (line 70) takes `connection` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done. — crates/crab-cache/src/private_fs/platform/database.rs:70
`journal` (line 198) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crab/src/import/coordinator.rs:198
`journal` (line 1855) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crab/src/import/coordinator.rs:1855
`journal` (line 698) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crab/src/cmd/run.rs:698
`journal` (line 1370) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crab/src/cmd/run.rs:1370
`journal` (line 1506) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crab/src/cmd/run.rs:1506
`journal` (line 2147) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crab/src/cmd/run.rs:2147
`journal` (line 4782) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crab/src/cmd/run.rs:4782
`journal` (line 254) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends. — crab/src/cmd/workflow_journal.rs:254
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
Other · Code Health — Whether async functions that make a cancellable request accept or pass on an AbortSignal (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 5/9 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
`starCount` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/web/components/site-header.tsx:7
`loadArrowSource` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/ui/src/duckdb-query.ts:68
`mutateRelease` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/ui/src/release-api.ts:38
`changeContent` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`. — packages/ui/src/content-editor.tsx:114
What to do
Thread an AbortSignal through async functions that make requests, so the work stops when its caller gives up.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
`DeviceAuthResponse.user_code` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/auth/oidc.rs:34
`DeviceAuthResponse.verification_uri` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/auth/oidc.rs:35
`ShowArgs.no_pager` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/cmd/exp.rs:458
`ImportArgs.estimate` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/cmd/import.rs:137
`ImportArgs.source_profile` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/cmd/import.rs:177
`ImportArgs.target_profile` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/cmd/import.rs:181
`LfsExtCmd::List.names` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/cmd/lfs/mod.rs:687
`ShowArgs.higher_is_better` is offered as a command-line argument option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/cmd/metrics.rs:77
`DiffArgs.higher_is_better` is offered as a command-line argument option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/cmd/metrics.rs:152
`VerifyArgs.exhaustive` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/cmd/replica.rs:268
`ConfigOverlay.hydra` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/core/config.rs:1446
`Cli.log_level` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:74
`Cmd::Clone.no_lazy` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:218
`Cmd::Doctor.support_bundle` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:308
`Cmd::Doctor.cache_service_active_probe` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:311
`Cmd::Track.list` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:345
`Cmd::Gc.deregister` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:392
`Cmd::Gc.repair_registry` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:395
`Cmd::Gc.repair_closures` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:398
`Cmd::Completions.install` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:500
`Cmd::Hydrate.ignore_sparse` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:579
`Cmd::Hydrate.clear_speculation` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:607
`Cmd::DiffDriver.old_mode` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:663
`Cmd::DiffDriver.new_mode` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:669
`Cmd::Daemon.hydration_concurrency` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:1069
`MountCmd::Status.live_only` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:1712
`MountCmd::Status.dirty` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:1718
`MigrateCmd::GcFence.quiesced` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crab/src/main.rs:2011
`RawConfig.logging` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/crab-cache-server/src/config.rs:109
`CellReleaseCommand::Activate.minimum_eligible_nodes` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/crab-http-server/src/main.rs:118
`CellReleaseCommand::Activate.retention_grace_hours` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/crab-http-server/src/main.rs:121
`CellReleaseCommand::Activate.retention_max_deletes` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/crab-http-server/src/main.rs:128
`CellBackupCommand::Create.pin` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/crab-http-server/src/main.rs:146
`CellBackupCommand::Verify.pin` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/crab-http-server/src/main.rs:151
`CellBackupCommand::Restore.pin` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/crab-http-server/src/main.rs:156
`CellBackupCommand::Restore.destination_prefix` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/crab-http-server/src/main.rs:158
`NfsMountLifecycleStatus.server_bind_ms` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/crab-vfs/src/nfs_control.rs:59
`NfsMountLifecycleStatus.native_mount_ms` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/crab-vfs/src/nfs_control.rs:60
`NfsMountLifecycleStatus.startup_ms` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/crab-vfs/src/nfs_control.rs:61
`MountPipelineBuilder.refresh_interval` is offered as a builder setter option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing. — crates/crab-vfs/src/pipeline.rs:118
What to do
Each finding names the spans that disagree — the knob the caller supplies and the site that ignores it, whether by re-spelling its default, by falling back under the wrong key, by parsing with no format provider at all, or by printing under whatever culture the host supplies. Confirm from those spans, then decide which of the two the type meant: read the knob at the named site, or drop the knob so the signature stops advertising something the type cannot feel. Leaving both is the one option that cannot be right.
Do you agree with this assessment?
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?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `REDACTED` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`warn!` at line 79 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — crates/crab-write/src/lib.rs:79
`warn!` at line 304 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`. — crab/src/speculation/access_db.rs:304
`warn!` at line 311 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`. — crab/src/speculation/access_db.rs:311
`warn!` at line 312 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`. — crab/src/speculation/access_db.rs:312
`debug!` at line 152 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`. — crab/src/lfs/lock.rs:152
Other · Code Health — Whether Rust's absent values are handled rather than forced — `Option` and `Result` make absence a value the caller must handle in every crate, and each `.unwrap()` or `.expect()` that no guard on its path proves present is a panic the first time the value is `None` or `Err`.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
`TcpListener::bind("127.0.0.1:0")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_n` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-workflow/src/stage_runtime.rs:771
`listener.local_addr()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_n` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-workflow/src/stage_runtime.rs:772
`listener.accept()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_n` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-workflow/src/stage_runtime.rs:775
`stream.write_all(head.as_bytes())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_n` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-workflow/src/stage_runtime.rs:782
`stream.write_all(body)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_n` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-workflow/src/stage_runtime.rs:783
`TcpListener::bind("127.0.0.1:0")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_with_etag` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-workflow/src/stage_runtime.rs:794
`listener.local_addr()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_with_etag` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-workflow/src/stage_runtime.rs:795
`listener.accept()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_with_etag` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-workflow/src/stage_runtime.rs:800
`stream.write_all(head.as_bytes())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_with_etag` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-workflow/src/stage_runtime.rs:809
`stream.write_all(body)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_with_etag` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-workflow/src/stage_runtime.rs:811
`` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). (×7) — crates/crab-cache/src/cache_client/completed_body.rs:92, crates/crab-cache/src/cache_client/completed_body.rs:95, crates/crab-cache/src/cache_client/completed_body.rs:97, …
`listener.local_addr()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-cache/src/cache_client/completed_body.rs:93
`CacheClient::new(&format!("http://{address}"),&CacheServiceAuth::None,None,None,None,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-cache/src/cache_client/completed_body.rs:111
`.unwrap()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-cache/src/cache_client/completed_body.rs:116
`CacheCatalog::read_only_stats(cache.root())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `reserved` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crates/crab-cache/src/cache_client/completed_body.rs:123
`gix_config::File::from_str(text)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `cfg` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`). — crab/src/auth/gix_credentials_adapter.rs:281
What to do
Each row is a forced `Option`/`Result` no guard on its path proves present. Handle the absent case where it arises rather than forcing it: `?` to hand it to the caller, `if let` / `match` / `let … else` to branch on it, `unwrap_or` / `unwrap_or_default` / `unwrap_or_else` where a default is right. Where the value genuinely cannot be absent, say so in a way a reader can check from the line: test it first (`if x.is_none() { return … }`), look the key up with `contains_key` or the index against `len()`, or construct the value so it cannot be absent.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 15 of 55 WCAG 2.2 Level A/AA success criteria (27%; ≈30% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 40 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 40 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 27 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. A delete/anonymise identifier was seen but did not co-occur with GDPR vocabulary or a subject-id shape, so it was not credited (e.g. a save-slot DeleteAccount()). Implement erasure, data export/portability and consent tracking over the subject's records.
Not included — 38 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AX1 Captive dependencies — Not applicable: this repository's JavaScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's; 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; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
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 — AX6 reached only 9% of this repository's production lines — rust (724,751 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.gateway-standby.environment.AWS_ACCESS_KEY_ID: required variable RUSTFS_ACCESS_KEY is missing a value: set RUSTFS_ACCESS_KEY; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
D16 Bus Factor — single-contributor 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 — D21 withholds its case and prefix conventions rows: 1 candidate(s) found and not reported.
D22 Internal API Consistency — API consistency is measured on C#, TypeScript, Go only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
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) — 8 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
D8 Code Coverage — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — packages/ui/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM6 Domain ↔ infrastructure boundary — this Rust crate maps no type to a persistence framework (diesel/sea-orm/sqlx), so DM6's domain↔infrastructure fusion read has no population to be taken over
DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
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
ES1 Fold determinism — not applicable — the code was read and holds no event-replay fold, so there is nothing for this check to judge
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'.
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
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.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — X24 reached only 9% of this repository's production lines — rust (724,751 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X3 Exception handling — X3 reached only 9% of this repository's production lines — rust (724,751 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
D30 · Dependency Vulnerabilities· High vulnerability · ×3
REDACTED
REDACTED
REDACTED
AX9 · CQS / query purity· Query writes persistent state on the read path · ×2
Query writes persistent state on the read path: Authentication.load_git_token crates/crab-http-server/src/auth.rs:50— `Authentication.load_git_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.
Query writes persistent state on the read path: ref_registry$module.load_ref_registry_summary crates/crab-metadata/src/ref_registry.rs:591— `ref_registry$module.load_ref_registry_summary` 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.
AC4 · Keyboard semantics· Hover-only interaction on <div> · ×1
Hover-only interaction on <div> packages/web/components/marketing/testimonials-carousel.tsx:135— This <div> binds mouse-enter and mouse-leave and nothing else — no click, no key handler, no focus handler, and no tabIndex={0}, so it cannot even take focus. A keyboard user cannot hover, so whatever the pair reveals or highlights is reachable with a mouse only. Bind the same state to focus/blur as well, and add tabIndex={0}="0" so the element can receive that focus.
DM4 · Rich vs anemic domain model· Anemic domain model · ×1
Anemic domain model: ComputedPaths crates/crab-vfs/src/daemon.rs:166— `ComputedPaths` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside.
Unlisted import 'unist-util-visit' packages/web/lib/remark-mermaid.mjs:9— Imported but not declared in any reachable REDACTED — installs work only by hoisting accident.
FunctionTooLong: crab::core::error_catalog::lookup crab/src/core/error_catalog.rs:139— FunctionTooLong — crab::core::error_catalog::lookup runs 1149 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 1049 over it, 11.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.
FunctionTooLong: App.RepositoryPage packages/ui/src/App.tsx:511— FunctionTooLong — RepositoryPage runs 676 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 576 over it, 6.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: crab::cmd::lfs::run_lfs_with_cancel crab/src/cmd/lfs/mod.rs:727— FunctionTooLong — crab::cmd::lfs::run_lfs_with_cancel runs 567 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 467 over it, 5.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crab::cmd::add::execute_add crab/src/cmd/add.rs:932— FunctionTooLong — crab::cmd::add::execute_add runs 501 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 401 over it, 5.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: page.CachePage packages/web/app/cache/page.tsx:255— FunctionTooLong — CachePage runs 473 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 373 over it, 4.73× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: page.AuthPage packages/web/app/auth/page.tsx:283— FunctionTooLong — AuthPage runs 423 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 323 over it, 4.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.
FunctionTooLong: large-file-scale-explorer.LargeFileScaleExplorer packages/web/components/blog/large-file-scale-explorer.tsx:47— FunctionTooLong — LargeFileScaleExplorer runs 396 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 296 over it, 3.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: data-workbench.DataWorkbench packages/ui/src/data-workbench.tsx:301— FunctionTooLong — DataWorkbench runs 384 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 284 over it, 3.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: settings.MemberSettings packages/ui/src/settings.tsx:148— FunctionTooLong — MemberSettings runs 382 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 282 over it, 3.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crab_http_server::metrics::describe_metrics crates/crab-http-server/src/metrics.rs:1791— FunctionTooLong — crab_http_server::metrics::describe_metrics 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: crab::git::push_native::run_native_push_inner crab/src/git/push_native.rs:271— FunctionTooLong — crab::git::push_native::run_native_push_inner runs 366 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 266 over it, 3.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: content.FileView packages/ui/src/content.tsx:132— FunctionTooLong — FileView runs 362 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 262 over it, 3.62× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crab_workflow::executor::run_inner REDACTED:310— FunctionTooLong — crab_workflow::executor::run_inner runs 359 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 259 over it, 3.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crab::cmd::metadb::rebuild_git_object_locators crab/src/cmd/metadb.rs:2688— FunctionTooLong — crab::cmd::metadb::rebuild_git_object_locators runs 338 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 238 over it, 3.38× 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: page.PricingPage packages/web/app/pricing/page.tsx:298— FunctionTooLong — PricingPage runs 329 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 229 over it, 3.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: page.TermsOfServicePage packages/web/app/terms-of-service/page.tsx:56— FunctionTooLong — TermsOfServicePage runs 327 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 227 over it, 3.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: tree.RepositoryTree packages/ui/src/tree.tsx:25— FunctionTooLong — RepositoryTree runs 323 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 223 over it, 3.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.
FunctionTooLong: crab::cmd::push::run_push_once crab/src/cmd/push.rs:533— FunctionTooLong — crab::cmd::push::run_push_once runs 302 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 202 over it, 3.02× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: cache-service-architecture-svg.CacheServiceArchitectureSvg packages/web/app/diagrams/cache-service-architecture-svg.tsx:42— FunctionTooLong — CacheServiceArchitectureSvg runs 294 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 194 over it, 2.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.
FunctionTooLong: crab_vfs::publish::commit_overlay_with_snapshot crates/crab-vfs/src/publish.rs:253— FunctionTooLong — crab_vfs::publish::commit_overlay_with_snapshot 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.
FunctionTooLong: pulls.PullReviewThreads packages/ui/src/pulls.tsx:796— FunctionTooLong — PullReviewThreads runs 291 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 191 over it, 2.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: git-architecture-player.GitArchitecturePlayer packages/web/components/blog/git-architecture-player.tsx:301— FunctionTooLong — GitArchitecturePlayer runs 290 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 190 over it, 2.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: remote-helper-flow-svg.RemoteHelperFlowSvg packages/web/app/diagrams/remote-helper-flow-svg.tsx:32— FunctionTooLong — RemoteHelperFlowSvg runs 285 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 185 over it, 2.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: crab::cmd::history_recovery::verify_history crab/src/cmd/history_recovery.rs:680— FunctionTooLong — crab::cmd::history_recovery::verify_history runs 281 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 181 over it, 2.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: cache-hierarchy-svg.CacheHierarchySvg packages/web/app/diagrams/cache-hierarchy-svg.tsx:43— FunctionTooLong — CacheHierarchySvg runs 279 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 179 over it, 2.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
crab::run_cli_stub (cognitive 289) crab/src/main.rs:3110— crab::run_cli_stub has cognitive complexity 289 (threshold 15). Drivers by points: if/else 87 (191 pts), match/switch 33 (82 pts), boolean chains 11, loops 1 (5 pts) (nesting depth added 157). 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.
crab::cmd::add::execute_add (cognitive 141) crab/src/cmd/add.rs:932— crab::cmd::add::execute_add has cognitive complexity 141 (threshold 15). Drivers by points: if/else 57 (109 pts), loops 9 (19 pts), match/switch 4 (7 pts), boolean chains 6 (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.
crab::cmd::lfs::run_lfs_with_cancel (cognitive 139) crab/src/cmd/lfs/mod.rs:727— crab::cmd::lfs::run_lfs_with_cancel has cognitive complexity 139 (threshold 15). Drivers by points: if/else 34 (97 pts), loops 6 (26 pts), match/switch 6 (15 pts), boolean chains 1 (nesting depth added 92). 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.
crab::cmd::run::run_dag (cognitive 112) crab/src/cmd/run.rs:1471— crab::cmd::run::run_dag has cognitive complexity 112 (threshold 15). Drivers by points: if/else 35 (83 pts), boolean chains 12, loops 7 (10 pts), match/switch 3 (7 pts) (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab::lfs::transfer_agent::run_transfer_agent_with_resolver (cognitive 102) crab/src/lfs/transfer_agent.rs:216— crab::lfs::transfer_agent::run_transfer_agent_with_resolver has cognitive complexity 102 (threshold 15). Drivers by points: if/else 23 (67 pts), match/switch 14 (29 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab::git::push_native::run_native_push_inner (cognitive 80) crab/src/git/push_native.rs:271— crab::git::push_native::run_native_push_inner has cognitive complexity 80 (threshold 15). Drivers by points: if/else 39 (49 pts), match/switch 9 (17 pts), boolean chains 11, loops 1 (3 pts) (nesting depth added 20). 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.
crab::git::remote_helper::dispatch_batch (cognitive 76) crab/src/git/remote_helper.rs:1366— crab::git::remote_helper::dispatch_batch has cognitive complexity 76 (threshold 15). Drivers by points: if/else 24 (39 pts), match/switch 8 (28 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 39). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
crab::cmd::diff::run_diff (cognitive 72) crab/src/cmd/diff.rs:58— crab::cmd::diff::run_diff has cognitive complexity 72 (threshold 15). Drivers by points: if/else 35 (62 pts), match/switch 4 (6 pts), boolean chains 2, loops 2 (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.
crab::git::push_native::phase_discover (cognitive 66) crab/src/git/push_native.rs:1055— crab::git::push_native::phase_discover has cognitive complexity 66 (threshold 15). Drivers by points: if/else 22 (41 pts), match/switch 6 (14 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab::cmd::metadb::rebuild_git_object_locators (cognitive 62) crab/src/cmd/metadb.rs:2688— crab::cmd::metadb::rebuild_git_object_locators has cognitive complexity 62 (threshold 15). Drivers by points: if/else 21 (38 pts), match/switch 6 (12 pts), loops 6 (9 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab::cmd::push::run_push_once (cognitive 62) crab/src/cmd/push.rs:533— crab::cmd::push::run_push_once has cognitive complexity 62 (threshold 15). Drivers by points: if/else 24 (41 pts), match/switch 8 (16 pts), boolean chains 5 (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.
crab::lfs::migrate::migrate_import_with_store_options (cognitive 61) crab/src/lfs/migrate.rs:1395— crab::lfs::migrate::migrate_import_with_store_options has cognitive complexity 61 (threshold 15). Drivers by points: if/else 21 (44 pts), loops 8 (11 pts), boolean chains 4, match/switch 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab::cmd::replica::render_status (cognitive 58) crab/src/cmd/replica.rs:12987— crab::cmd::replica::render_status has cognitive complexity 58 (threshold 15). Drivers by points: if/else 25 (47 pts), loops 3 (6 pts), boolean chains 4, match/switch 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.
crab::diff::formatter::format_human (cognitive 57) crab/src/diff/formatter.rs:199— crab::diff::formatter::format_human has cognitive complexity 57 (threshold 15). Drivers by points: if/else 15 (30 pts), match/switch 5 (16 pts), loops 4 (9 pts), boolean chains 2 (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.
crab::cmd::gc::bucket::execute_bucket_journal (cognitive 56) crab/src/cmd/gc/bucket.rs:911— crab::cmd::gc::bucket::execute_bucket_journal has cognitive complexity 56 (threshold 15). Drivers by points: if/else 13 (35 pts), match/switch 6 (17 pts), loops 3 (4 pts) (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab::cmd::migrate::run_migrate_from_dvc_with_options (cognitive 56) crab/src/cmd/migrate.rs:922— crab::cmd::migrate::run_migrate_from_dvc_with_options has cognitive complexity 56 (threshold 15). Drivers by points: if/else 17 (42 pts), boolean chains 6, match/switch 2 (6 pts), loops 1 (2 pts) (nesting depth added 30). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
crab::cmd::hydrate::run_selected_hydration (cognitive 55) crab/src/cmd/hydrate.rs:2322— crab::cmd::hydrate::run_selected_hydration has cognitive complexity 55 (threshold 15). Drivers by points: if/else 31 (46 pts), boolean chains 5, loops 1 (2 pts), match/switch 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.
crab::lfs::migrate::migrate_export_with_options (cognitive 53) crab/src/lfs/migrate.rs:2109— crab::lfs::migrate::migrate_export_with_options has cognitive complexity 53 (threshold 15). Drivers by points: if/else 21 (38 pts), loops 7 (10 pts), boolean chains 4, match/switch 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.
crab::cmd::dehydrate::query_dirty_files_via_gix (cognitive 51) crab/src/cmd/dehydrate.rs:657— crab::cmd::dehydrate::query_dirty_files_via_gix has cognitive complexity 51 (threshold 15). Drivers by points: if/else 16 (44 pts), match/switch 2 (5 pts), loops 1 (2 pts) (nesting depth added 32). 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.
crab::cmd::setup::run_setup_at (cognitive 50) crab/src/cmd/setup.rs:95— crab::cmd::setup::run_setup_at has cognitive complexity 50 (threshold 15). Drivers by points: if/else 26 (48 pts), boolean chains 1, match/switch 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab::cmd::clone::run_clone_in (cognitive 49) crab/src/cmd/clone.rs:216— crab::cmd::clone::run_clone_in has cognitive complexity 49 (threshold 15). Drivers by points: if/else 29 (43 pts), boolean chains 5, match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab::cmd::metadb::diagnose_acceleration_health (cognitive 49) crab/src/cmd/metadb.rs:3606— crab::cmd::metadb::diagnose_acceleration_health has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (23 pts), match/switch 13 (21 pts), boolean chains 5 (nesting depth added 13). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
crab::git::upload_pack_wire::open_repository_with_visibility_requirement (cognitive 49) crab/src/git/upload_pack_wire.rs:890— crab::git::upload_pack_wire::open_repository_with_visibility_requirement has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (38 pts), match/switch 3 (8 pts), boolean chains 2, loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab::cmd::dehydrate::run_dehydrate_in (cognitive 48) crab/src/cmd/dehydrate.rs:105— crab::cmd::dehydrate::run_dehydrate_in has cognitive complexity 48 (threshold 15). Drivers by points: if/else 26 (41 pts), match/switch 3 (4 pts), loops 1 (2 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.
crab::cmd::exp::emit_diff (cognitive 47) crab/src/cmd/exp.rs:5977— crab::cmd::exp::emit_diff has cognitive complexity 47 (threshold 15). Drivers by points: loops 8 (24 pts), if/else 9 (18 pts), boolean chains 4, match/switch 1 (nesting depth added 25). 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.
FileTooLong: git/push.rs crab/src/git/push.rs— FileTooLong — 13065 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 165 free functions. The bar is 500 significant lines; this is 12565 over it, 26.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cmd/replica.rs crab/src/cmd/replica.rs— FileTooLong — 9941 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 402 free functions. The bar is 500 significant lines; this is 9441 over it, 19.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: replication/mod.rs crab/src/replication/mod.rs— FileTooLong — 7120 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 253 free functions. The bar is 500 significant lines; this is 6620 over it, 14.24× 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/index.rs crates/crab-staging/src/index.rs— FileTooLong — 6674 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: Index (2 blocks, 258-8959). The bar is 500 significant lines; this is 6174 over it, 13.35× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: cmd/exp.rs crab/src/cmd/exp.rs— FileTooLong — 4583 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 205 free functions. The bar is 500 significant lines; this is 4083 over it, 9.17× 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: scripts/verify-nfs-smoke-report.py crab/scripts/verify-nfs-smoke-report.py— FileTooLong — 4229 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 3729 over it, 8.46× 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/gateway.rs crates/crab-s3-gateway/src/gateway.rs— FileTooLong — 3731 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 82 free functions. The bar is 500 significant lines; this is 3231 over it, 7.46× 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: cmd/mount.rs crab/src/cmd/mount.rs— FileTooLong — 3572 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 166 free functions. The bar is 500 significant lines; this is 3072 over it, 7.14× 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: cmd/run.rs crab/src/cmd/run.rs— FileTooLong — 3326 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 92 free functions. The bar is 500 significant lines; this is 2826 over it, 6.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cmd/metadb.rs crab/src/cmd/metadb.rs— FileTooLong — 3065 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 62 free functions. The bar is 500 significant lines; this is 2565 over it, 6.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cmd/metrics.rs crab/src/cmd/metrics.rs— FileTooLong — 3012 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 157 free functions. The bar is 500 significant lines; this is 2512 over it, 6.02× 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/crab-staging/src/lib.rs— FileTooLong — 2834 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 55 free functions. The bar is 500 significant lines; this is 2334 over it, 5.67× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/git_visibility.rs crates/crab-metadata/src/git_visibility.rs— FileTooLong — 2810 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 2310 over it, 5.62× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: cmd/add.rs crab/src/cmd/add.rs— FileTooLong — 2790 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 81 free functions. The bar is 500 significant lines; this is 2290 over it, 5.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: core/error.rs crab/src/core/error.rs— FileTooLong — 2783 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: CrabError (33 blocks, 17-3888). The bar is 500 significant lines; this is 2283 over it, 5.57× 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/mutation.rs crates/crab-s3-gateway/src/mutation.rs— FileTooLong — 2395 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 45 free functions. The bar is 500 significant lines; this is 1895 over it, 4.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: cmd/hydrate.rs crab/src/cmd/hydrate.rs— FileTooLong — 2327 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 62 free functions. The bar is 500 significant lines; this is 1827 over it, 4.65× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: gc/mod.rs crab/src/cmd/gc/mod.rs— FileTooLong — 2301 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 44 free functions. The bar is 500 significant lines; this is 1801 over it, 4.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/pack.rs crates/crab-remote-git/src/pack.rs— FileTooLong — 2236 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 42 free functions. The bar is 500 significant lines; this is 1736 over it, 4.47× 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: cmd/recover.rs crab/src/cmd/recover.rs— FileTooLong — 2225 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 98 free functions. The bar is 500 significant lines; this is 1725 over it, 4.45× 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: cmd/migrate.rs crab/src/cmd/migrate.rs— FileTooLong — 2221 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 64 free functions. The bar is 500 significant lines; this is 1721 over it, 4.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: src/reader.rs crates/crab-remote-git/src/reader.rs— FileTooLong — 2118 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 65% of them inside a single declaration: RemoteGitReader (2 blocks, 142-1839). The bar is 500 significant lines; this is 1618 over it, 4.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: git/remote_helper.rs crab/src/git/remote_helper.rs— FileTooLong — 2065 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 58 free functions. The bar is 500 significant lines; this is 1565 over it, 4.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/dvc_inventory.rs crates/crab-workflow/src/dvc_inventory.rs— FileTooLong — 2016 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 44 free functions. The bar is 500 significant lines; this is 1516 over it, 4.03× 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/receive.rs crates/crab-auth-server/src/receive.rs— FileTooLong — 1992 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 79 free functions. The bar is 500 significant lines; this is 1492 over it, 3.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.
Duplicated block (8 lines × 2) crab/src/cmd/auth_status.rs:143— crab/src/cmd/auth_status.rs:143-150 | crab/src/cmd/doctor.rs:662-669 — 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 (8 lines × 2) crab/src/cmd/config.rs:203— crab/src/cmd/config.rs:203-210 | crab/src/cmd/config.rs:426-433 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/config.rs:203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crab/src/cmd/dehydrate.rs:1153— crab/src/cmd/dehydrate.rs:1153-1160 | crab/src/cmd/hydrate.rs:1407-1414 — before extracting anything, compare `crab/src/cmd/dehydrate.rs` and `crab/src/cmd/hydrate.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 223 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) crab/src/cmd/download.rs:411— crab/src/cmd/download.rs:411-418 | crab/src/cmd/export.rs:380-387 — 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 `crab/src/cmd/download.rs:411` it does not close everything it opens, so those 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, `crab/src/cmd/export.rs:390` calls `clone` and `crab/src/cmd/download.rs:421` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) crab/src/cmd/du.rs:311— crab/src/cmd/du.rs:311-318 | crab/src/cmd/du.rs:322-329 — both copies are in the same file, so extract the block into 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) crab/src/cmd/exp.rs:5868— crab/src/cmd/exp.rs:5868-5875 | crab/src/cmd/exp.rs:6528-6535 — both copies are in the same file, so extract the 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 `payload` to `&ExpRunPayload` in one and `&ExpSavePayload` 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) crab/src/cmd/exp_queue.rs:1378— crab/src/cmd/exp_queue.rs:1378-1385 | crates/crab-workflow/src/exp_worktree.rs:433-440 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/exp_queue.rs:1378` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/crab-workflow/src/exp_worktree.rs:442` calls `display` and `crab/src/cmd/exp_queue.rs:1387` 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 (8 lines × 2) crab/src/cmd/gc/bucket.rs:149— crab/src/cmd/gc/bucket.rs:149-156 | crab/src/cmd/gc/bucket.rs:196-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/bucket.rs:149` it does not close everything it opens, so those exact lines 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) crab/src/cmd/gc/bucket.rs:1461— crab/src/cmd/gc/bucket.rs:1461-1468 | crab/src/cmd/gc/bucket.rs:1792-1799 — both copies are in the same file, so extract the block into 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) crab/src/cmd/hydrate.rs:3130— crab/src/cmd/hydrate.rs:3130-3137 | crab/src/cmd/hydrate.rs:3169-3176 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/hydrate.rs:3130` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/lfs/dedup.rs:462— crab/src/cmd/lfs/dedup.rs:462-469 | crab/src/cmd/lfs/dedup.rs:969-976 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/lfs/dedup.rs:462` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/lfs/dedup.rs:948— crab/src/cmd/lfs/dedup.rs:948-955 | crab/src/cmd/lfs/dedup.rs:1041-1048 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/lfs/dedup.rs:948` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) crab/src/core/output/mod.rs:93— crab/src/core/output/mod.rs:93-100 | crab/src/core/output/mod.rs:114-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/core/output/mod.rs:93` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crab/src/git/clean.rs:2331— crab/src/git/clean.rs:2331-2338 | crab/src/git/clean.rs:2379-2386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/clean.rs:2331` it does not close everything it opens, so those exact lines 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) crab/src/git/pack.rs:137— crab/src/git/pack.rs:137-144 | crab/src/git/pack.rs:165-172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/pack.rs:137` it begins part-way through the construct above it, so those exact lines 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) crab/src/git/pack.rs:641— crab/src/git/pack.rs:641-649 | crab/src/git/pack.rs:1574-1581 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/pack.rs:641` it begins part-way through the construct above it, so those exact lines 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) crab/src/git/pack.rs:818— crab/src/git/pack.rs:818-825 | crab/src/git/pack.rs:942-949 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crab/src/git/pack.rs:1569— crab/src/git/pack.rs:1569-1576 | crates/crab-git/src/pack.rs:1006-1013 — 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) crab/src/git/push.rs:7190— crab/src/git/push.rs:7190-7197 | crab/src/git/remote_helper.rs:2427-2434 — 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 `crab/src/git/push.rs:7190` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) crab/src/git/push.rs:9647— crab/src/git/push.rs:9647-9654 | crab/src/git/push.rs:12390-12397 — both copies are in the same file, so extract the block into 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) crab/src/lfs/transfer_agent.rs:592— crab/src/lfs/transfer_agent.rs:592-599 | crab/src/lfs/transfer_agent.rs:710-717 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/transfer_agent.rs:592` it does not close everything it opens, so those 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, `crab/src/lfs/transfer_agent.rs:718` calls `clone` and `crab/src/lfs/transfer_agent.rs:600` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) crab/src/read/mod.rs:360— crab/src/read/mod.rs:360-367 | crab/src/read/mod.rs:397-404 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/read/mod.rs:360` it does not close everything it opens, so those exact lines 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) crab/src/replication/mod.rs:1115— crab/src/replication/mod.rs:1115-1122 | crab/src/replication/mod.rs:1271-1278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/replication/mod.rs:1115` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) crab/src/replication/mod.rs:5265— crab/src/replication/mod.rs:5265-5272 | crab/src/replication/mod.rs:5290-5297 — both copies are in the same file, so extract the block into 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) crab/src/replication/mod.rs:8799— crab/src/replication/mod.rs:8799-8806 | crab/src/replication/mod.rs:8956-8963 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/replication/mod.rs:8799` it does not close everything it opens, so those exact lines 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) crab/src/cache/add_remote_candidates.rs:219— crab/src/cache/add_remote_candidates.rs:219-225 | crab/src/cache/add_remote_candidates.rs:365-371 — both copies are in the same file, so extract the block into 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) crab/src/cache/mod.rs:52— crab/src/cache/mod.rs:52-58 | crates/crab-cache/src/shard_hints.rs:40-46 — 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) crab/src/cmd/clone.rs:1211— crab/src/cmd/clone.rs:1211-1219 | crab/src/cmd/migrate.rs:589-595 — 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 `crab/src/cmd/clone.rs:1211` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/dag.rs:300— crab/src/cmd/dag.rs:300-306 | crab/src/cmd/dag.rs:312-318 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/dag.rs:300` it does not close everything it opens, so those 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, `crab/src/cmd/dag.rs:319` calls `extend`, `consumers_of` and `crab/src/cmd/dag.rs:307` 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 × 2) crab/src/cmd/gc/mod.rs:2651— crab/src/cmd/gc/mod.rs:2651-2657 | crab/src/cmd/gc/mod.rs:2970-2976 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/mod.rs:2651` it does not close everything it opens, so those exact lines 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) crab/src/cmd/hydrate.rs:555— crab/src/cmd/hydrate.rs:555-561 | crab/src/cmd/hydrate.rs:1646-1652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/hydrate.rs:555` it does not close everything it opens, so those exact lines 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) crab/src/cmd/init.rs:955— crab/src/cmd/init.rs:955-961 | crab/src/cmd/lfs/update.rs:90-96 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) crab/src/cmd/lfs/dedup.rs:181— crab/src/cmd/lfs/dedup.rs:181-187 | crab/src/lfs/prune.rs:303-309 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/lfs/dedup.rs:181` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crab/src/cmd/metrics.rs:1870— crab/src/cmd/metrics.rs:1870-1876 | crab/src/cmd/metrics.rs:1923-1929 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/metrics.rs:1870` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/migrate.rs:1334— crab/src/cmd/migrate.rs:1334-1340 | crab/src/cmd/migrate.rs:1388-1394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/migrate.rs:1334` 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) crab/src/cmd/recover.rs:2824— crab/src/cmd/recover.rs:2824-2830 | crab/src/cmd/recover.rs:2917-2923 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/recover.rs:2824` it does not close everything it opens, so those exact lines 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) crab/src/cmd/recover.rs:2915— crab/src/cmd/recover.rs:2915-2921 | crates/crab-vfs/src/publish.rs:1715-1721 — 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 `crab/src/cmd/recover.rs:2915` it does not close everything it opens, so those exact lines 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) crab/src/cmd/reset.rs:86— crab/src/cmd/reset.rs:86-93 | crab/src/cmd/reset.rs:181-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/reset.rs:86` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/run.rs:2203— crab/src/cmd/run.rs:2203-2209 | crab/src/cmd/run.rs:2838-2844 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crab/src/cmd/run.rs:2362— crab/src/cmd/run.rs:2362-2368 | crab/src/cmd/run.rs:4447-4453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/run.rs:2362` it does not close everything it opens, so those exact lines 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) crab/src/cmd/setup.rs:441— crab/src/cmd/setup.rs:441-447 | crab/src/main.rs:2575-2581 — 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 `crab/src/cmd/setup.rs:441` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/stage/add.rs:184— crab/src/cmd/stage/add.rs:184-190 | crab/src/cmd/stage/add.rs:317-323 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/stage/add.rs:184` it begins part-way through the construct above it, so those 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) crab/src/cost/inventory/live.rs:166— crab/src/cost/inventory/live.rs:166-172 | crab/src/cost/inventory/live.rs:174-180 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crab/src/git/push.rs:145— crab/src/git/push.rs:145-151 | crab/src/git/push.rs:203-209 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:145` it does not close everything it opens, so those exact lines 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) crab/src/git/push.rs:1631— crab/src/git/push.rs:1631-1637 | crates/crab-write/src/catalog.rs:94-100 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) crab/src/git/push.rs:1640— crab/src/git/push.rs:1640-1646 | crates/crab-read/src/upload_pack.rs:1261-1267 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) crab/src/git/push.rs:3298— crab/src/git/push.rs:3298-3304 | crab/src/git/push.rs:3310-3316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:3298` 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) crab/src/git/upload_pack_wire.rs:836— crab/src/git/upload_pack_wire.rs:836-842 | crab/src/git/upload_pack_wire.rs:1359-1365 — both copies are in the same file, so extract the block into 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) crab/src/import/assemble.rs:206— crab/src/import/assemble.rs:206-212 | crab/src/import/assemble.rs:305-314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/import/assemble.rs:206` it does not close everything it opens, so those exact lines 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) crab/src/import/journal.rs:687— crab/src/import/journal.rs:687-693 | crates/crab-workflow/src/exp_worktree.rs:1600-1606 — 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 `crab/src/import/journal.rs:687` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
crab::run_cli_stub (cyclomatic 252) crab/src/main.rs:3110— crab::run_cli_stub has cyclomatic complexity 252 (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.
crab::cmd::lfs::run_lfs_with_cancel (cyclomatic 76) crab/src/cmd/lfs/mod.rs:727— crab::cmd::lfs::run_lfs_with_cancel has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab::cmd::add::execute_add (cyclomatic 74) crab/src/cmd/add.rs:932— crab::cmd::add::execute_add has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab::git::push_native::run_native_push_inner (cyclomatic 59) crab/src/git/push_native.rs:271— crab::git::push_native::run_native_push_inner has cyclomatic complexity 59 (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.
crab::cmd::run::run_dag (cyclomatic 53) crab/src/cmd/run.rs:1471— crab::cmd::run::run_dag 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.
crab::lfs::transfer_agent::run_transfer_agent_with_resolver (cyclomatic 45) crab/src/lfs/transfer_agent.rs:216— crab::lfs::transfer_agent::run_transfer_agent_with_resolver has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab::cmd::metadb::rebuild_git_object_locators (cyclomatic 40) crab/src/cmd/metadb.rs:2688— crab::cmd::metadb::rebuild_git_object_locators 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.
crab::cmd::push::run_push_once (cyclomatic 39) crab/src/cmd/push.rs:533— crab::cmd::push::run_push_once has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab::cmd::diff::run_diff (cyclomatic 38) crab/src/cmd/diff.rs:58— crab::cmd::diff::run_diff has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab::tier::provider::s3::parse_xml_to_sdk_rules (cyclomatic 38) crab/src/tier/provider/s3.rs:677— crab::tier::provider::s3::parse_xml_to_sdk_rules has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
crab::cmd::hydrate::run_selected_hydration (cyclomatic 37) crab/src/cmd/hydrate.rs:2322— crab::cmd::hydrate::run_selected_hydration has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab::cmd::metadb::diagnose_acceleration_health (cyclomatic 36) crab/src/cmd/metadb.rs:3606— crab::cmd::metadb::diagnose_acceleration_health has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
crab::git::remote_helper::dispatch_batch (cyclomatic 35) crab/src/git/remote_helper.rs:1366— crab::git::remote_helper::dispatch_batch has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab::run_optimize_command (cyclomatic 35) crab/src/main.rs:5288— crab::run_optimize_command has cyclomatic complexity 35 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: Cmd::schema_name (cyclomatic 143) 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.
crab::cmd::clone::run_clone_in (cyclomatic 32) crab/src/cmd/clone.rs:216— crab::cmd::clone::run_clone_in 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.
crab::lfs::migrate::migrate_import_with_store_options (cyclomatic 32) crab/src/lfs/migrate.rs:1395— crab::lfs::migrate::migrate_import_with_store_options 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.
crab::cmd::repack::run_repack_locked (cyclomatic 30) crab/src/cmd/repack.rs:286— crab::cmd::repack::run_repack_locked has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
crab::cmd::replica::render_status (cyclomatic 30) crab/src/cmd/replica.rs:12987— crab::cmd::replica::render_status 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.
crab::cmd::dehydrate::run_dehydrate_in (cyclomatic 29) crab/src/cmd/dehydrate.rs:105— crab::cmd::dehydrate::run_dehydrate_in 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.
crab::cmd::replica::validate_live_smoke_evidence (cyclomatic 29) crab/src/cmd/replica.rs:4617— crab::cmd::replica::validate_live_smoke_evidence has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
crab::cmd::run::run_inline_single_stage (cyclomatic 29) crab/src/cmd/run.rs:545— crab::cmd::run::run_inline_single_stage 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.
crab::lfs::migrate::migrate_export_with_options (cyclomatic 29) crab/src/lfs/migrate.rs:2109— crab::lfs::migrate::migrate_export_with_options 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.
crab::cmd::add::collect_literal_candidates (cyclomatic 28) crab/src/cmd/add.rs:2670— crab::cmd::add::collect_literal_candidates 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.
crab::cmd::metadb::generation_owner_sample (cyclomatic 28) crab/src/cmd/metadb.rs:661— crab::cmd::metadb::generation_owner_sample has cyclomatic complexity 28 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
crab::git::push_native::phase_discover (cyclomatic 28) crab/src/git/push_native.rs:1055— crab::git::push_native::phase_discover 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.
Duplicated block (10 lines × 2) crab/src/cmd/add.rs:2820— crab/src/cmd/add.rs:2820-2829 | crab/src/cmd/status_workflow.rs:556-565 — 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) crab/src/cmd/add.rs:2853— crab/src/cmd/add.rs:2853-2862 | crab/src/cmd/add.rs:2873-2882 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:2853` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/artifacts.rs:223— crab/src/cmd/artifacts.rs:223-232 | crab/src/cmd/artifacts.rs:512-521 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crab/src/cmd/data.rs:1620— crab/src/cmd/data.rs:1620-1629 | crab/src/cmd/workflow_checkpoint.rs:626-635 — 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 `crab/src/cmd/data.rs:1620` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/diff.rs:90— crab/src/cmd/diff.rs:90-99 | crab/src/cmd/diff.rs:101-110 — both copies are in the same file, so extract the block into 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) crab/src/cmd/gc/closure.rs:174— crab/src/cmd/gc/closure.rs:174-183 | crab/src/cmd/gc/closure.rs:305-314 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/closure.rs:174` it does not close everything it opens, so those 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) crab/src/cmd/lfs/ls_files.rs:196— crab/src/cmd/lfs/ls_files.rs:196-205 | crab/src/lfs/prune.rs:654-663 — 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 `crab/src/cmd/lfs/ls_files.rs:196` it does not close everything it opens, so those exact lines 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) crab/src/cmd/recover.rs:2948— crab/src/cmd/recover.rs:2948-2957 | crates/crab-staging/src/push_plan.rs:1082-1091 — 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 `crab/src/cmd/recover.rs:2948` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crab/src/cmd/replica.rs:2240— crab/src/cmd/replica.rs:2240-2249 | crab/src/cmd/replica.rs:2267-2276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&CoordinatorStatusArgs` in one and `&CoordinatorRemoveArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) crab/src/cmd/run.rs:3487— crab/src/cmd/run.rs:3487-3496 | REDACTED:2344-2353 — before extracting anything, compare `crab/src/cmd/run.rs` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 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 `crab/src/cmd/run.rs:3487` it begins part-way through the construct above it, so those 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) crab/src/core/error.rs:2307— crab/src/core/error.rs:2307-2316 | crab/src/core/error.rs:2720-2729 — both copies are in the same file, so extract the block into 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) crab/src/git/filter_process.rs:609— crab/src/git/filter_process.rs:609-618 | crab/src/git/filter_process.rs:634-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. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/filter_process.rs:609` it begins part-way through the construct above it, so those exact lines 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) crab/src/git/push.rs:10373— crab/src/git/push.rs:10373-10382 | crab/src/git/push.rs:10416-10425 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:10373` it does not close everything it opens, so those exact lines 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) crab/src/git/push.rs:13308— crab/src/git/push.rs:13308-13317 | crates/crab-auth-server/src/receive.rs:1561-1570 — before extracting anything, compare `crab/src/git/push.rs` and `crates/crab-auth-server/src/receive.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:13308` it begins part-way through the construct above it, so those exact lines 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) crab/src/lfs/batch.rs:182— crab/src/lfs/batch.rs:182-191 | crab/src/lfs/batch.rs:234-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/batch.rs:182` it does not close everything it opens, so those exact lines 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) crab/src/metadata/metadb/stores/chunk_index.rs:372— crab/src/metadata/metadb/stores/chunk_index.rs:372-381 | crab/src/metadata/metadb/stores/chunk_index.rs:471-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crab/src/metadata/metadb/stores/chunk_index.rs:382` calls `with_capacity` and `crab/src/metadata/metadb/stores/chunk_index.rs:481` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) crab/src/replication/mod.rs:2412— crab/src/replication/mod.rs:2412-2421 | crab/src/tier/provider/azure.rs:300-309 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/crab-auth-server/src/receive/git_workspace.rs:393— crates/crab-auth-server/src/receive/git_workspace.rs:393-402 | crates/crab-auth-server/src/receive/git_workspace.rs:1055-1064 — both copies are in the same file, so extract the block into 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/crab-cache-store/src/lib.rs:471— crates/crab-cache-store/src/lib.rs:471-480 | crates/crab-cache-store/src/lib.rs:560-569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-cache-store/src/lib.rs:471` it does not close everything it opens, so those exact lines 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/crab-coordination/src/push_lock.rs:828— crates/crab-coordination/src/push_lock.rs:828-837 | crates/crab-coordination/src/push_lock.rs:868-877 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-coordination/src/push_lock.rs:868` it begins part-way through the construct above it, so those 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 lines × 2) crates/crab-coordination/src/spanner_coordinator.rs:488— crates/crab-coordination/src/spanner_coordinator.rs:488-497 | crates/crab-coordination/src/spanner_coordinator.rs:737-746 — both copies are in the same file, so extract the 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/crab-http-server/src/auth/git_tokens.rs:159— crates/crab-http-server/src/auth/git_tokens.rs:159-168 | crates/crab-http-server/src/auth/git_tokens.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 `crates/crab-http-server/src/auth/git_tokens.rs:159` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/crab-http-server/src/branches.rs:130— crates/crab-http-server/src/branches.rs:130-139 | crates/crab-http-server/src/contents.rs:232-241 — before extracting anything, compare `crates/crab-http-server/src/branches.rs` and `crates/crab-http-server/src/contents.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/branches.rs:130` it does not close everything it opens, so those exact lines 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/crab-http-server/src/cells/repository/pull_review_threads.rs:282— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:282-291 | crates/crab-http-server/src/pulls/review_thread_storage.rs:358-367 — 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/crab-http-server/src/cells/repository/pull_review_threads.rs:1073— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1073-1082 | crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1088-1097 — both copies are in the same file, so extract the 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `context` to `&CommandContext<'_, '_>` in one and `&QueryContext<'_>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) crab/src/cmd/artifacts.rs:447— crab/src/cmd/artifacts.rs:447-452 | crab/src/cmd/artifacts.rs:487-492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/artifacts.rs:447` it does not close everything it opens, so those exact lines 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) crab/src/cmd/exp.rs:1815— crab/src/cmd/exp.rs:1815-1820 | crab/src/cmd/exp.rs:1885-1890 — both copies are in the same file, so extract the block into 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) crab/src/cmd/exp.rs:4826— crab/src/cmd/exp.rs:4826-4831 | crab/src/cmd/metrics.rs:1552-1557 — before extracting anything, compare `crab/src/cmd/exp.rs` and `crab/src/cmd/metrics.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/exp.rs:4826` it does not close everything it opens, so those exact lines 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) crab/src/cmd/gc/bucket.rs:1075— crab/src/cmd/gc/bucket.rs:1075-1080 | crab/src/cmd/gc/mod.rs:1910-1915 — before extracting anything, compare `crab/src/cmd/gc/bucket.rs` and `crab/src/cmd/gc/mod.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (6 lines × 2) crab/src/cmd/gc/bucket.rs:1845— crab/src/cmd/gc/bucket.rs:1845-1850 | crab/src/cmd/gc/bucket.rs:1902-1907 — both copies are in the same file, so extract the block into 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) crab/src/cmd/gc/bucket.rs:2435— crab/src/cmd/gc/bucket.rs:2435-2440 | crab/src/cmd/optimize/xorbs.rs:653-658 — 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 `crab/src/cmd/gc/bucket.rs:2435` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) crab/src/cmd/hydrate.rs:1906— crab/src/cmd/hydrate.rs:1906-1911 | crab/src/cmd/hydrate.rs:1934-1939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/hydrate.rs:1906` it does not close everything it opens, so those exact lines 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) crab/src/cmd/metrics.rs:1310— crab/src/cmd/metrics.rs:1310-1315 | crab/src/cmd/metrics.rs:1395-1400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/metrics.rs:1310` it does not close everything it opens, so those 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, `crab/src/cmd/metrics.rs:1307` calls `reject_image_sources_for_vega` and `crab/src/cmd/metrics.rs:1393` 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) crab/src/cmd/optimize/xorbs.rs:378— crab/src/cmd/optimize/xorbs.rs:378-384 | crab/src/cmd/optimize/xorbs.rs:628-633 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/optimize/xorbs.rs:378` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crab/src/cmd/recover.rs:2015— crab/src/cmd/recover.rs:2015-2020 | crab/src/cmd/recover.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 `crab/src/cmd/recover.rs:2015` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 2) crab/src/cost/inventory/report/azure.rs:60— crab/src/cost/inventory/report/azure.rs:60-65 | crab/src/cost/inventory/report/gcs.rs:64-69 — before extracting anything, compare `crab/src/cost/inventory/report/azure.rs` and `crab/src/cost/inventory/report/gcs.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `crab/src/cost/inventory/report/azure.rs:60` it begins part-way through the construct above it, so those 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, `crab/src/cost/inventory/report/azure.rs:67` calls `get`, `trim_matches`, `to_string` and `crab/src/cost/inventory/report/gcs.rs:72` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) crab/src/git/push.rs:7781— crab/src/git/push.rs:7781-7786 | crates/crab-metadata/src/manifests.rs:88-93 — 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) crab/src/git/push.rs:12472— crab/src/git/push.rs:12472-12477 | crab/src/git/push.rs:12481-12486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:12472` 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) crab/src/git/push.rs:16030— crab/src/git/push.rs:16030-16035 | crab/src/git/push.rs:16070-16075 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:16030` it does not close everything it opens, so those exact lines 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) crab/src/git/remote_helper.rs:465— crab/src/git/remote_helper.rs:465-470 | crab/src/git/remote_helper.rs:472-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/remote_helper.rs:465` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) crab/src/lfs/lock.rs:225— crab/src/lfs/lock.rs:225-230 | crab/src/lfs/lock.rs:258-263 — both copies are in the same file, so extract the block into 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) crab/src/metadata/metadb/stores/chunk_index.rs:349— crab/src/metadata/metadb/stores/chunk_index.rs:349-354 | crab/src/metadata/metadb/stores/chunk_index.rs:450-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/metadata/metadb/stores/chunk_index.rs:349` it begins part-way through the construct above it, so those exact lines 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) crab/src/metadata/metadb/stores/chunk_index.rs:518— crab/src/metadata/metadb/stores/chunk_index.rs:518-523 | crates/crab-metadata/src/remote_index.rs:333-338 — 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 `crab/src/metadata/metadb/stores/chunk_index.rs:518` it does not close everything it opens, so those exact lines 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) crab/src/optimize/xorbs/journal.rs:385— crab/src/optimize/xorbs/journal.rs:385-390 | crab/src/optimize/xorbs/journal.rs:532-538 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/optimize/xorbs/journal.rs:385` 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 (6 lines × 2) crab/src/speculation/access_db.rs:320— crab/src/speculation/access_db.rs:320-325 | crab/src/speculation/access_db.rs:371-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/speculation/access_db.rs:320` it does not close everything it opens, so those exact lines 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/crab-auth-server/src/receive.rs:1447— crates/crab-auth-server/src/receive.rs:1447-1452 | crates/crab-write/src/catalog.rs:366-371 — 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/crab-auth-server/src/receive.rs:1447` 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 (6 lines × 2) crates/crab-cache/src/local_cache.rs:1146— crates/crab-cache/src/local_cache.rs:1146-1151 | crates/crab-cache/src/local_cache.rs:1188-1193 — both copies are in the same file, so extract the 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 (6 lines × 2) crates/crab-http-server/src/cells/repository.rs:852— crates/crab-http-server/src/cells/repository.rs:852-857 | crates/crab-http-server/src/cells/repository/projection.rs:1084-1089 — 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/crab-http-server/src/cells/repository.rs:852` it does not close everything it opens, so those exact lines 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/crab-http-server/src/cells/repository/checks.rs:802— crates/crab-http-server/src/cells/repository/checks.rs:802-807 | crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1271-1276 — 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/crab-http-server/src/cells/repository/checks.rs:802` it does not close everything it opens, so those exact lines 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/crab-http-server/src/cells/repository/pull_review_threads.rs:742— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:742-747 | crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1146-1151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1145` calls `validate_suggested_text`, `as_deref` and `crates/crab-http-server/src/cells/repository/pull_review_threads.rs:741` 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 (9 lines × 2) crab/src/cmd/dehydrate.rs:304— crab/src/cmd/dehydrate.rs:304-312 | crab/src/cmd/hydrate.rs:3395-3404 — before extracting anything, compare `crab/src/cmd/dehydrate.rs` and `crab/src/cmd/hydrate.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 223 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `args` to `&DehydrateArgs` in one and `&HydrateArgs` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) crab/src/cmd/doctor.rs:1260— crab/src/cmd/doctor.rs:1260-1268 | crates/crab-cache/src/active_probe.rs:231-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 `crab/src/cmd/doctor.rs:1260` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/exp.rs:218— crab/src/cmd/exp.rs:218-226 | crab/src/cmd/exp.rs:233-241 — both copies are in the same file, so extract the 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, `crab/src/cmd/exp.rs:243` calls `default` and `crab/src/cmd/exp.rs:228` 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) crab/src/cmd/exp.rs:3936— crab/src/cmd/exp.rs:3936-3944 | crab/src/cmd/exp.rs:4195-4203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/exp.rs:3936` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/exp_queue.rs:1186— crab/src/cmd/exp_queue.rs:1186-1194 | crab/src/cmd/exp_queue.rs:1253-1261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/exp_queue.rs:1186` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) crab/src/cmd/history_recovery.rs:650— crab/src/cmd/history_recovery.rs:650-658 | crab/src/maintenance.rs:197-205 — 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 `crab/src/cmd/history_recovery.rs:650` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crab/src/cmd/hydrate.rs:3073— crab/src/cmd/hydrate.rs:3073-3081 | crab/src/cmd/release.rs:1171-1179 — 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 `crab/src/cmd/hydrate.rs:3073` it does not close everything it opens, so those exact lines 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) crab/src/cmd/lfs/convert.rs:232— crab/src/cmd/lfs/convert.rs:232-240 | crab/src/lfs/prune.rs:121-129 — 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 `crab/src/cmd/lfs/convert.rs:232` it does not close everything it opens, so those 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) crab/src/cmd/lfs/dedup.rs:179— crab/src/cmd/lfs/dedup.rs:179-187 | crab/src/cmd/lfs/dedup.rs:697-705 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/lfs/dedup.rs:179` it does not close everything it opens, so those exact lines 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) crab/src/cmd/lfs/ls_files.rs:178— crab/src/cmd/lfs/ls_files.rs:178-186 | crab/src/lfs/prune.rs:634-642 — 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) crab/src/cmd/metadb.rs:1222— crab/src/cmd/metadb.rs:1222-1230 | crab/src/cmd/repack.rs:985-993 — 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 `crab/src/cmd/metadb.rs:1222` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/metadb.rs:2933— crab/src/cmd/metadb.rs:2933-2941 | crab/src/cmd/metadb.rs:3016-3024 — both copies are in the same file, so extract the 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) crab/src/cmd/metrics.rs:3266— crab/src/cmd/metrics.rs:3266-3274 | crab/src/cmd/release.rs:1284-1292 — 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 `crab/src/cmd/metrics.rs:3266` it does not close everything it opens, so those exact lines 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) crab/src/cmd/migrate.rs:2373— crab/src/cmd/migrate.rs:2373-2381 | crab/src/git/pack.rs:877-886 — 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) crab/src/cmd/recover.rs:2776— crab/src/cmd/recover.rs:2776-2784 | crab/src/cmd/release.rs:1089-1097 — 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 `crab/src/cmd/recover.rs:2776` it does not close everything it opens, so those 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) crab/src/cmd/replica.rs:4499— crab/src/cmd/replica.rs:4499-4507 | crab/src/cmd/replica.rs:4618-4626 — both copies are in the same file, so extract the 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 `payload` to `&LiveControlPlaneEvidencePayload` in one and `&LiveSmokeEvidencePayload` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 2) crab/src/cmd/staging.rs:88— crab/src/cmd/staging.rs:88-96 | crab/src/cmd/stat.rs:36-44 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crab/src/cmd/staging.rs:86` calls `list_inflight` and `crab/src/cmd/stat.rs:34` 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 (9 lines × 2) crab/src/core/error.rs:2719— crab/src/core/error.rs:2719-2727 | crab/src/core/error.rs:3013-3021 — both copies are in the same file, so extract the 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, `crab/src/core/error.rs:3022` calls `GixConfig` and `crab/src/core/error.rs:2728` 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) crab/src/git/push.rs:8475— crab/src/git/push.rs:8475-8483 | crab/src/git/push.rs:8486-8494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:8475` 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) crab/src/git/upload_pack_wire.rs:1557— crab/src/git/upload_pack_wire.rs:1557-1565 | crab/src/git/upload_pack_wire.rs:1702-1710 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crab/src/lfs/publication.rs:97— crab/src/lfs/publication.rs:97-105 | crab/src/lfs/publication.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. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/publication.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crab/src/lfs/publication.rs:141` calls `object_path` and `crab/src/lfs/publication.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 (9 lines × 2) crab/src/main.rs:5004— crab/src/main.rs:5004-5012 | crab/src/main.rs:5026-5034 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/main.rs:5004` 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) crab/src/main.rs:5067— crab/src/main.rs:5067-5075 | crab/src/main.rs:5088-5096 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/main.rs:5067` 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) crab/src/replication/mod.rs:1744— crab/src/replication/mod.rs:1744-1752 | crab/src/replication/mod.rs:1826-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 `crab/src/replication/mod.rs:1744` it does not close everything it opens, so those exact lines 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) crab/src/replication/mod.rs:9310— crab/src/replication/mod.rs:9310-9318 | crab/src/replication/mod.rs:9335-9343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/replication/mod.rs:9310` it does not close everything it opens, so those exact lines 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) crab/src/cmd/diff.rs:177— crab/src/cmd/diff.rs:177-181 | crab/src/cmd/diff_driver.rs:141-146 — 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) crab/src/cmd/exp.rs:4244— crab/src/cmd/exp.rs:4244-4248 | crab/src/cmd/exp.rs:4283-4287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/exp.rs:4244` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/exp.rs:4998— crab/src/cmd/exp.rs:4998-5002 | crab/src/cmd/exp.rs:5004-5008 — both copies are in the same file, so extract the block into 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) crab/src/cmd/lfs/convert.rs:373— crab/src/cmd/lfs/convert.rs:373-377 | crab/src/cmd/lfs/merge_driver.rs:172-176 — 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) crab/src/cmd/metrics.rs:2695— crab/src/cmd/metrics.rs:2695-2699 | crab/src/cmd/metrics.rs:2720-2724 — both copies are in the same file, so extract the block into 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) crab/src/cmd/metrics.rs:3582— crab/src/cmd/metrics.rs:3582-3586 | crab/src/cmd/params.rs:417-421 — before extracting anything, compare `crab/src/cmd/metrics.rs` and `crab/src/cmd/params.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 89 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 `crab/src/cmd/metrics.rs:3582` it does not close everything it opens, so those 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 `map` to `&BTreeMap<MetricKey, (Scalar, Scalar)>` in one and `&BTreeMap<ParamKey, (Scalar, Scalar)>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) crab/src/git/push.rs:5045— crab/src/git/push.rs:5045-5049 | crates/crab-staging/src/push_plan.rs:1158-1163 — 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 `crab/src/git/push.rs:5045` it begins part-way through the construct above it, so those exact lines 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) crab/src/git/push.rs:7185— crab/src/git/push.rs:7185-7189 | crab/src/git/push.rs:17454-17458 — both copies are in the same file, so extract the block into 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) crab/src/git/push.rs:11993— crab/src/git/push.rs:11993-11997 | crab/src/git/push.rs:12052-12058 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:11993` 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) crab/src/git/push.rs:13046— crab/src/git/push.rs:13046-13050 | crab/src/git/push.rs:13076-13080 — both copies are in the same file, so extract the block into 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) crab/src/lfs/config.rs:306— crab/src/lfs/config.rs:306-310 | crates/crab-remote/src/local.rs:582-586 — 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 `crab/src/lfs/config.rs:306` it does not close everything it opens, so those exact lines 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/crab-auth/src/token_cache.rs:205— crates/crab-auth/src/token_cache.rs:205-209 | crates/crab-workflow/src/exp_queue.rs:194-198 — 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/crab-auth/src/token_cache.rs:205` 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/crab-cache-server/src/cache_store.rs:1479— crates/crab-cache-server/src/cache_store.rs:1479-1483 | crates/crab-cache-server/src/cache_store.rs:1590-1594 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-cache-server/src/cache_store.rs:1479` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) crates/crab-cache/src/local_cache.rs:1657— crates/crab-cache/src/local_cache.rs:1657-1661 | crates/crab-cache/src/local_cache.rs:1669-1673 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-cache/src/local_cache.rs:1657` it does not close everything it opens, so those exact lines 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/crab-coordination/src/push_lock.rs:1122— crates/crab-coordination/src/push_lock.rs:1122-1126 | crates/crab-coordination/src/push_lock.rs:1147-1151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-coordination/src/push_lock.rs:1122` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (5 lines × 2) crates/crab-http-server/src/labels.rs:232— crates/crab-http-server/src/labels.rs:232-236 | crates/crab-http-server/src/labels.rs:271-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `std::result::Result<Json<LabelEdit>` in one and `std::result::Result<Json<LabelDelete>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) crates/crab-metadata/src/file_index_lookup.rs:465— crates/crab-metadata/src/file_index_lookup.rs:465-469 | crates/crab-remote-git/src/reader.rs:435-440 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-metadata/src/file_index_lookup.rs:465` it begins part-way through the construct above it, so those exact lines 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/crab-metadata/src/git_visibility.rs:938— crates/crab-metadata/src/git_visibility.rs:938-942 | crates/crab-metadata/src/git_visibility.rs:1752-1758 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-metadata/src/git_visibility.rs:938` it does not close everything it opens, so those exact lines 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/crab-s3-gateway/src/gateway.rs:1346— crates/crab-s3-gateway/src/gateway.rs:1346-1350 | crates/crab-s3-gateway/src/gateway.rs:1361-1365 — both copies are in the same file, so extract the 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 `req` to `S3Request<GetBucketLocationInput>` in one and `S3Request<GetBucketVersioningInput>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (5 lines × 2) crates/crab-s3-gateway/src/gateway.rs:3438— crates/crab-s3-gateway/src/gateway.rs:3438-3442 | crates/crab-s3-gateway/src/gateway.rs:3521-3525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/crab-s3-gateway/src/multipart.rs:347— crates/crab-s3-gateway/src/multipart.rs:347-351 | crates/crab-s3-gateway/src/multipart.rs:360-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) crates/crab-s3-gateway/src/server.rs:145— crates/crab-s3-gateway/src/server.rs:145-149 | crates/crab-s3-gateway/src/server.rs:169-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-s3-gateway/src/server.rs:145` it does not close everything it opens, so those exact lines 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/crab-sdk/src/local/edit.rs:616— crates/crab-sdk/src/local/edit.rs:616-620 | crates/crab-sdk/src/local/edit.rs:716-720 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-sdk/src/local/edit.rs:616` it does not close everything it opens, so those 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/crab-sdk/src/local/edit.rs:622` calls `Some` and `crates/crab-sdk/src/local/edit.rs:722` 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/crab-staging/src/index.rs:6480— crates/crab-staging/src/index.rs:6480-6484 | crates/crab-staging/src/index.rs:6586-6590 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-staging/src/index.rs:6480` it begins part-way through the construct above it, so those exact lines 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/crab-staging/src/lib.rs:1097— crates/crab-staging/src/lib.rs:1097-1101 | crates/crab-staging/src/lib.rs:3993-3997 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-staging/src/lib.rs:1097` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Hotspot: crab/src/git/push.rs crab/src/git/push.rs:10673— crab/src/git/push.rs changed 47 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 62 in PushPipeline::try_apply_add_push_plans at line 10673. 14 of those changes were fix/bug commits, and the other 33 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/git/push.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: crab/src/cmd/add.rs crab/src/cmd/add.rs:932— crab/src/cmd/add.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in crab::cmd::add::execute_add at line 932. 5 of those changes were fix/bug commits, and the other 8 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/cmd/add.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: crab/src/cmd/metadb.rs crab/src/cmd/metadb.rs:2688— crab/src/cmd/metadb.rs changed 24 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in crab::cmd::metadb::rebuild_git_object_locators at line 2688. 7 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/cmd/metadb.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/ui/src/App.tsx packages/ui/src/App.tsx:511— packages/ui/src/App.tsx changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 117 in App.RepositoryPage at line 511. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- packages/ui/src/App.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crab/src/git/remote_helper.rs crab/src/git/remote_helper.rs:1366— crab/src/git/remote_helper.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in crab::git::remote_helper::dispatch_batch at line 1366. 5 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/git/remote_helper.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/crab-http-server/src/server.rs crates/crab-http-server/src/server.rs:2263— crates/crab-http-server/src/server.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in crab_http_server::server::boundary_request at line 2263. 6 of those changes were fix/bug commits, and the other 22 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crates/crab-http-server/src/server.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/crab-metadata/src/git_visibility.rs crates/crab-metadata/src/git_visibility.rs:3352— crates/crab-metadata/src/git_visibility.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in crab_metadata::git_visibility::storage::apply_catalog_journal_edits at line 3352. 4 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crates/crab-metadata/src/git_visibility.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: crab/scripts/release/check-release-archive-contents.py crab/scripts/release/check-release-archive-contents.py:196— crab/scripts/release/check-release-archive-contents.py changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in check-release-archive-contents.check_release_workflow at line 196. 9 of those changes were fix/bug commits, and the other 10 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/scripts/release/check-release-archive-contents.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crab/src/cmd/hydrate.rs crab/src/cmd/hydrate.rs:2322— crab/src/cmd/hydrate.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in crab::cmd::hydrate::run_selected_hydration at line 2322. 5 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/cmd/hydrate.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: crab/src/cmd/repack.rs crab/src/cmd/repack.rs:286— crab/src/cmd/repack.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in crab::cmd::repack::run_repack_locked at line 286. 5 of those changes were fix/bug commits, and the other 14 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/cmd/repack.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: crab/src/git/push_native.rs crab/src/git/push_native.rs:271— crab/src/git/push_native.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in crab::git::push_native::run_native_push_inner at line 271. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/git/push_native.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/crab-http-server/src/peer.rs crates/crab-http-server/src/peer.rs:968— crates/crab-http-server/src/peer.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in crab_http_server::peer::dispatch_forwarded_request at line 968. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crates/crab-http-server/src/peer.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: crab/src/git/upload_pack_wire.rs crab/src/git/upload_pack_wire.rs:890— crab/src/git/upload_pack_wire.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in crab::git::upload_pack_wire::open_repository_with_visibility_requirement at line 890. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/git/upload_pack_wire.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: crab/src/core/config.rs crab/src/core/config.rs:2079— crab/src/core/config.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in Config::apply_overlay at line 2079. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/core/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/crab-storage/src/store.rs crates/crab-storage/src/store.rs:1792— crates/crab-storage/src/store.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in Store::put_multipart_file_resumable at line 1792. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crates/crab-storage/src/store.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crab/src/cmd/push.rs crab/src/cmd/push.rs:533— crab/src/cmd/push.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in crab::cmd::push::run_push_once at line 533. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/cmd/push.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/crab-http-server/src/cells/router.rs crates/crab-http-server/src/cells/router.rs:213— crates/crab-http-server/src/cells/router.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in RepositoryCellRouter::rebalance_once at line 213. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crates/crab-http-server/src/cells/router.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: crab/src/cmd/lfs/mod.rs crab/src/cmd/lfs/mod.rs:727— crab/src/cmd/lfs/mod.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in crab::cmd::lfs::run_lfs_with_cancel at line 727. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/cmd/lfs/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/crab-http-server/src/cells/scheduler.rs crates/crab-http-server/src/cells/scheduler.rs:1190— crates/crab-http-server/src/cells/scheduler.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in crab_http_server::cells::scheduler::recover_node_session at line 1190. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crates/crab-http-server/src/cells/scheduler.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: crab/src/cmd/gc/mod.rs crab/src/cmd/gc/mod.rs:1248— crab/src/cmd/gc/mod.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in crab::cmd::gc::execute_journaled_deletes at line 1248. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/cmd/gc/mod.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crab/src/cmd/clone.rs crab/src/cmd/clone.rs:216— crab/src/cmd/clone.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in crab::cmd::clone::run_clone_in at line 216. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/cmd/clone.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: packages/ui/src/content.tsx packages/ui/src/content.tsx:132— packages/ui/src/content.tsx changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 49 in content.FileView at line 132. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- packages/ui/src/content.tsx`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/crab-remote-git/src/repository.rs crates/crab-remote-git/src/repository.rs:495— crates/crab-remote-git/src/repository.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in RemoteGitRepository::open_inner at line 495. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crates/crab-remote-git/src/repository.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: crab/scripts/verify-large-repo-rustfs-report.py crab/scripts/verify-large-repo-rustfs-report.py:475— crab/scripts/verify-large-repo-rustfs-report.py changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in verify-large-repo-rustfs-report.verify_report at line 475. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/scripts/verify-large-repo-rustfs-report.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/crab-read/src/upload_pack.rs crates/crab-read/src/upload_pack.rs:640— crates/crab-read/src/upload_pack.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in crab_read::upload_pack::plan_with_operation at line 640. 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-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crates/crab-read/src/upload_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.
Duplicated block (11 lines × 2) crab/src/cmd/artifacts.rs:687— crab/src/cmd/artifacts.rs:687-697 | crab/src/cmd/data.rs:1843-1853 — before extracting anything, compare `crab/src/cmd/artifacts.rs` and `crab/src/cmd/data.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/artifacts.rs:687` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) crab/src/cmd/data.rs:1545— crab/src/cmd/data.rs:1545-1555 | crab/src/cmd/data.rs:1563-1573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) crab/src/cmd/exp.rs:6680— crab/src/cmd/exp.rs:6680-6690 | crab/src/cmd/workflow_journal.rs:586-596 — 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 `crab/src/cmd/exp.rs:6680` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `payload` to `&ExpGcPayload` in one and `&GcPayload` 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) crab/src/cmd/lfs/locks.rs:364— crab/src/cmd/lfs/locks.rs:364-374 | crab/src/cmd/lfs/locks.rs:437-447 — both copies are in the same file, so extract the 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) crab/src/cmd/metrics.rs:1856— crab/src/cmd/metrics.rs:1856-1866 | crab/src/cmd/metrics.rs:1909-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. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/metrics.rs:1856` 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) crab/src/cmd/metrics.rs:2490— crab/src/cmd/metrics.rs:2490-2500 | crates/crab-workflow/src/exp_worktree.rs:1849-1859 — 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/crab-workflow/src/exp_worktree.rs:1849` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/migrate.rs:1243— crab/src/cmd/migrate.rs:1243-1253 | crab/src/cmd/migrate.rs:1764-1774 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/migrate.rs:1243` it does not close everything it opens, so those exact lines 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) crab/src/cmd/migrate.rs:2685— crab/src/cmd/migrate.rs:2685-2695 | crates/crab-workflow/src/dvc_inventory.rs:2296-2306 — 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 (11 lines × 2) crab/src/cmd/mount.rs:993— crab/src/cmd/mount.rs:993-1003 | crates/crab-vfs/src/nfs_mount.rs:125-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/mount.rs:993` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crab/src/cmd/recover.rs:2786— crab/src/cmd/recover.rs:2786-2796 | crab/src/cmd/release.rs:1099-1109 — 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 `crab/src/cmd/recover.rs:2786` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crab/src/cmd/run.rs:1374— crab/src/cmd/run.rs:1374-1384 | crab/src/cmd/run.rs:1523-1533 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crab/src/cmd/run.rs:3439— crab/src/cmd/run.rs:3439-3449 | crab/src/cmd/status_workflow.rs:903-913 — before extracting anything, compare `crab/src/cmd/run.rs` and `crab/src/cmd/status_workflow.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 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 `crab/src/cmd/run.rs:3439` it does not close everything it opens, so those exact lines 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) crab/src/cmd/run.rs:3534— crab/src/cmd/run.rs:3534-3544 | crab/src/cmd/status_workflow.rs:970-980 — before extracting anything, compare `crab/src/cmd/run.rs` and `crab/src/cmd/status_workflow.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `p` 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 (11 lines × 2) crab/src/git/incremental_walk.rs:266— crab/src/git/incremental_walk.rs:266-276 | crab/src/git/push.rs:18314-18324 — before extracting anything, compare `crab/src/git/incremental_walk.rs` and `crab/src/git/push.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crab/src/git/push.rs:12610— crab/src/git/push.rs:12610-12620 | crates/crab-auth-server/src/view/objects.rs:159-169 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:12610` it does not close everything it opens, so those exact lines 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) crab/src/import/assemble.rs:342— crab/src/import/assemble.rs:342-352 | crab/src/import/coordinator.rs:1311-1321 — 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 `crab/src/import/assemble.rs:342` it begins part-way through the construct above it, so those 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 `into` 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 (11 lines × 2) crab/src/read/mod.rs:346— crab/src/read/mod.rs:346-356 | crab/src/read/mod.rs:383-393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/read/mod.rs:346` it does not close everything it opens, so those exact lines 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) crab/src/tier/plan.rs:57— crab/src/tier/plan.rs:57-67 | crab/src/tier/plan.rs:78-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/tier/plan.rs:57` it does not close everything it opens, so those exact lines 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/crab-auth-server/src/receive/git_workspace.rs:1143— crates/crab-auth-server/src/receive/git_workspace.rs:1143-1153 | crates/crab-auth-server/src/receive/git_workspace.rs:1159-1169 — both copies are in the same file, so extract the 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) crates/crab-auth/src/managed/client.rs:1124— crates/crab-auth/src/managed/client.rs:1124-1134 | crates/crab-auth/src/managed/client.rs:1143-1153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-auth/src/managed/client.rs:1124` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `&PushPrepareRequest` in one and `&PushFinalizeRequest` 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/crab-cache-server/src/bin/crab_cache.rs:723— crates/crab-cache-server/src/bin/crab_cache.rs:723-733 | crates/crab-cache-server/src/bin/crab_cache.rs:745-755 — both copies are in the same file, so extract the block into 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/crab-cache/src/local_cache/maintenance.rs:413— crates/crab-cache/src/local_cache/maintenance.rs:413-423 | crates/crab-cache/src/xet_chunk_cache.rs:708-718 — 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/crab-cache/src/local_cache/maintenance.rs:413` it does not close everything it opens, so those exact lines 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/crab-http-server/src/cells.rs:826— crates/crab-http-server/src/cells.rs:826-836 | crates/crab-http-server/src/cells.rs:1662-1672 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-http-server/src/cells.rs:826` it begins part-way through the construct above it, so those exact lines 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/crab-http-server/src/cells/repository/pulls.rs:1191— crates/crab-http-server/src/cells/repository/pulls.rs:1191-1201 | crates/crab-http-server/src/cells/repository/pulls.rs:1234-1244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 2) crates/crab-http-server/src/peer/node_log_client.rs:149— crates/crab-http-server/src/peer/node_log_client.rs:149-159 | crates/crab-http-server/src/peer/node_log_client.rs:191-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/peer/node_log_client.rs:149` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
MethodTooLong: CrabError.details_json crab/src/core/error.rs:3039— MethodTooLong — details_json runs 603 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 503 over it, 6.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Index.insert_recipe_lease crates/crab-staging/src/index.rs:5060— MethodTooLong — insert_recipe_lease runs 489 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 389 over it, 4.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.
MethodTooLong: Index.insert_file_push_plans crates/crab-staging/src/index.rs:6335— MethodTooLong — insert_file_push_plans runs 482 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 382 over it, 4.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Metrics.new crates/crab-http-server/src/metrics.rs:394— MethodTooLong — new 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.
MethodTooLong: Store.put_multipart_file_resumable crates/crab-storage/src/store.rs:1792— MethodTooLong — put_multipart_file_resumable runs 295 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 195 over it, 2.95× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Index.initialize_schema crates/crab-staging/src/index.rs:706— MethodTooLong — initialize_schema runs 279 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 179 over it, 2.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: DaemonService.execute_mount_pipeline crates/crab-vfs/src/daemon.rs:847— MethodTooLong — execute_mount_pipeline runs 255 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 155 over it, 2.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CrabError.from crab/src/core/error.rs:1223— MethodTooLong — from runs 216 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 116 over it, 2.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RemoteGitRepository.open_inner crates/crab-remote-git/src/repository.rs:495— MethodTooLong — open_inner runs 213 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 113 over it, 2.13× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LocalRepository.prepare_push_with_options crates/crab-sdk/src/local/push.rs:333— MethodTooLong — prepare_push_with_options runs 209 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Index.take_coalesced_read_group crates/crab-staging/src/index.rs:8056— MethodTooLong — take_coalesced_read_group runs 209 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 109 over it, 2.09× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Gateway.complete_multipart_upload crates/crab-s3-gateway/src/gateway.rs:2428— MethodTooLong — complete_multipart_upload runs 201 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 101 over it, 2.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Index.claim_prepared_chunks crates/crab-staging/src/index.rs:2283— MethodTooLong — claim_prepared_chunks 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.
MethodTooLong: Index.register_preparation_payloads crates/crab-staging/src/index.rs:2539— MethodTooLong — register_preparation_payloads 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: Error.into_response crates/crab-http-server/src/app.rs:119— MethodTooLong — into_response runs 188 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 88 over it, 1.88× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Client.clone_with_options crates/crab-sdk/src/local.rs:490— MethodTooLong — clone_with_options runs 186 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 86 over it, 1.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: AddRemoteCandidateCache.persist_results_inner crab/src/cache/add_remote_candidates.rs:408— MethodTooLong — persist_results_inner runs 185 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 85 over it, 1.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CrabError.exit_code crab/src/core/error.rs:2257— MethodTooLong — exit_code 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: CrabError.category crab/src/core/error.rs:2642— MethodTooLong — category 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: CrabError.code crab/src/core/error.rs:2462— MethodTooLong — code runs 168 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Gateway.list_objects_v2 crates/crab-s3-gateway/src/gateway.rs:2921— MethodTooLong — list_objects_v2 runs 168 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CrabError.is_retryable crab/src/core/error.rs:2869— MethodTooLong — is_retryable runs 159 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 59 over it, 1.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StoreChecker.verify_pointer_data crab/src/cmd/fsck_store.rs:101— MethodTooLong — verify_pointer_data runs 153 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RemoteGitSnapshot.blame crates/crab-remote-git/src/snapshot.rs:654— MethodTooLong — blame runs 150 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 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Index.adopt_file_hash crates/crab-staging/src/index.rs:5737— MethodTooLong — adopt_file_hash runs 148 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 48 over it, 1.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.
Duplicated block (12 lines × 2) crab/src/cmd/data.rs:312— crab/src/cmd/data.rs:312-323 | crab/src/cmd/data.rs:457-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/data.rs:312` 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) crab/src/cmd/data.rs:1608— crab/src/cmd/data.rs:1608-1619 | crab/src/cmd/migrate.rs:2647-2658 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) crab/src/cmd/du.rs:226— crab/src/cmd/du.rs:226-237 | crab/src/cmd/ls_files.rs:85-96 — before extracting anything, compare `crab/src/cmd/du.rs` and `crab/src/cmd/ls_files.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/du.rs:226` 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) crab/src/cmd/gc/bucket.rs:1663— crab/src/cmd/gc/bucket.rs:1663-1674 | crab/src/cmd/gc/bucket.rs:1727-1738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/bucket.rs:1663` it does not close everything it opens, so those exact lines 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) crab/src/cmd/gc/mod.rs:1726— crab/src/cmd/gc/mod.rs:1726-1737 | crab/src/cmd/gc/mod.rs:2311-2322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/mod.rs:1726` it does not close everything it opens, so those exact lines 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) crab/src/cmd/gc/mod.rs:1740— crab/src/cmd/gc/mod.rs:1740-1751 | crab/src/cmd/gc/mod.rs:2326-2337 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/mod.rs:1740` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/lfs/ls_files.rs:365— crab/src/cmd/lfs/ls_files.rs:365-377 | crab/src/lfs/status.rs:549-560 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/lfs/ls_files.rs:365` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) crab/src/cmd/metadb.rs:1426— crab/src/cmd/metadb.rs:1426-1437 | crab/src/cmd/metadb.rs:1488-1499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/metadb.rs:1426` 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) crab/src/cmd/metrics.rs:2631— crab/src/cmd/metrics.rs:2631-2642 | crab/src/cmd/metrics.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 `crab/src/cmd/metrics.rs:2631` 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) crab/src/cmd/recover.rs:1483— crab/src/cmd/recover.rs:1483-1494 | crab/src/cmd/recover.rs:1595-1606 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/recover.rs:1483` it does not close everything it opens, so those exact lines 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) crab/src/cmd/replica.rs:3790— crab/src/cmd/replica.rs:3790-3801 | crab/src/cmd/replica.rs:3833-3844 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/replica.rs:3790` it begins part-way through the construct above it, so those 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, `crab/src/cmd/replica.rs:3830` calls `Some`, `as_ref`, `parse` and `crab/src/cmd/replica.rs:3788` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) crab/src/cmd/replica.rs:6744— crab/src/cmd/replica.rs:6744-6755 | crab/src/cmd/replica.rs:6776-6787 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/replica.rs:6744` it does not close everything it opens, so those exact lines 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) crab/src/cmd/run.rs:2402— crab/src/cmd/run.rs:2402-2413 | crab/src/cmd/run.rs:4373-4384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/run.rs:2402` it does not close everything it opens, so those exact lines 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) crab/src/cmd/worktree.rs:1162— crab/src/cmd/worktree.rs:1162-1173 | crab/src/cmd/worktree.rs:1339-1350 — both copies are in the same file, so extract the block into 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) crab/src/core/error.rs:1110— crab/src/core/error.rs:1110-1121 | crates/crab-auth-server/src/error.rs:229-240 — 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 `crab/src/core/error.rs:1110` it does not close everything it opens, so those exact lines 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) crab/src/git/push.rs:8722— crab/src/git/push.rs:8722-8733 | crab/src/git/push.rs:9001-9012 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:8722` it begins part-way through the construct above it, so those exact lines 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) crab/src/import/coordinator.rs:1794— crab/src/import/coordinator.rs:1794-1805 | crab/src/import/coordinator.rs:2050-2061 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crab/src/read/mod.rs:852— crab/src/read/mod.rs:852-863 | crab/src/read/mod.rs:911-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 `crab/src/read/mod.rs:852` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/crab-cache-server/src/bin/crab_cache.rs:442— crates/crab-cache-server/src/bin/crab_cache.rs:442-453 | crates/crab-cache-server/src/bin/crab_cache.rs:483-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-cache-server/src/bin/crab_cache.rs:442` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) crates/crab-cache/src/active_probe.rs:156— crates/crab-cache/src/active_probe.rs:156-167 | crates/crab-cache/src/active_probe.rs:200-211 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-cache/src/active_probe.rs:156` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) crates/crab-cache/src/cache_client.rs:391— crates/crab-cache/src/cache_client.rs:391-402 | crates/crab-cache/src/cache_client.rs:485-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-cache/src/cache_client.rs:391` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/crab-cache/src/cache_client.rs:387` calls `to_owned` and `crates/crab-cache/src/cache_client.rs:481` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) crates/crab-cache/src/local_cache/maintenance.rs:411— crates/crab-cache/src/local_cache/maintenance.rs:411-422 | crates/crab-cache/src/local_cache/maintenance.rs:457-468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-cache/src/local_cache/maintenance.rs:411` it does not close everything it opens, so those exact lines 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/crab-cache/src/xet_chunk_cache.rs:515— crates/crab-cache/src/xet_chunk_cache.rs:515-526 | crates/crab-cache/src/xet_chunk_cache.rs:597-608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `directory` to `&std::path::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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/crab-cache/src/xet_chunk_cache.rs:609` calls `to_owned` and `crates/crab-cache/src/xet_chunk_cache.rs:527` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) crates/crab-coordination/src/write_coordinator.rs:742— crates/crab-coordination/src/write_coordinator.rs:742-753 | crates/crab-coordination/src/write_coordinator.rs:1241-1252 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-coordination/src/write_coordinator.rs:742` it does not close everything it opens, so those exact lines 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/crab-http-server/src/checks.rs:329— crates/crab-http-server/src/checks.rs:329-340 | crates/crab-http-server/src/checks.rs:348-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.
crab_workflow::executor::run_inner (cognitive 111) REDACTED:310— crab_workflow::executor::run_inner has cognitive complexity 111 (threshold 15). Drivers by points: if/else 47 (81 pts), match/switch 4 (11 pts), loops 4 (10 pts), boolean chains 9 (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_workflow::dvc_inventory::verify_output (cognitive 78) crates/crab-workflow/src/dvc_inventory.rs:1826— crab_workflow::dvc_inventory::verify_output has cognitive complexity 78 (threshold 15). Drivers by points: if/else 25 (44 pts), match/switch 7 (22 pts), boolean chains 6, loops 3 (6 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_workflow::dvc_inventory::parse_pipeline_outputs (cognitive 54) crates/crab-workflow/src/dvc_inventory.rs:1003— crab_workflow::dvc_inventory::parse_pipeline_outputs has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (37 pts), match/switch 4 (12 pts), loops 2 (3 pts), boolean chains 2 (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.
crab_workflow::dvc_inventory::apply_lock_output_metadata (cognitive 54) crates/crab-workflow/src/dvc_inventory.rs:1376— crab_workflow::dvc_inventory::apply_lock_output_metadata has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (38 pts), loops 4 (7 pts), match/switch 2 (7 pts), boolean chains 2 (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.
crab_workflow::cache::pull_remote_with_artifact_stores (cognitive 45) crates/crab-workflow/src/cache.rs:1090— crab_workflow::cache::pull_remote_with_artifact_stores has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 5 (12 pts), loops 2 (5 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.
crab_workflow::dvc_inventory::inventory_project (cognitive 45) crates/crab-workflow/src/dvc_inventory.rs:536— crab_workflow::dvc_inventory::inventory_project has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 11, boolean chains 6, 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.
crab_workflow::executor::verify_and_hash_outs (cognitive 45) REDACTED:1167— crab_workflow::executor::verify_and_hash_outs has cognitive complexity 45 (threshold 15). Drivers by points: if/else 19 (40 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_workflow::dvc_inventory::parse_config (cognitive 40) crates/crab-workflow/src/dvc_inventory.rs:1627— crab_workflow::dvc_inventory::parse_config has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (28 pts), boolean chains 6, loops 5 (6 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.
crab_workflow::executor::resolve_dep_hashes_with_wdir_allow_missing_remote_aliases (cognitive 40) REDACTED:2432— crab_workflow::executor::resolve_dep_hashes_with_wdir_allow_missing_remote_aliases has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 4 (14 pts), loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_workflow::cache::push_all_local_with_artifact_stores_and_cancel (cognitive 39) crates/crab-workflow/src/cache.rs:1357— crab_workflow::cache::push_all_local_with_artifact_stores_and_cancel has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 4 (12 pts), loops 2 (3 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_workflow::artifact::visit_reachable_remote_artifact_objects (cognitive 35) crates/crab-workflow/src/artifact.rs:769— crab_workflow::artifact::visit_reachable_remote_artifact_objects has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 6 (9 pts), match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_workflow::executor::resolve_dep_hashes_with_wdir_remote_aliases (cognitive 34) REDACTED:2291— crab_workflow::executor::resolve_dep_hashes_with_wdir_remote_aliases has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (27 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_workflow::status::format_text (cognitive 34) crates/crab-workflow/src/status.rs:268— crab_workflow::status::format_text has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (9 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_workflow::executor::verify_and_hash_plots (cognitive 30) REDACTED:1717— crab_workflow::executor::verify_and_hash_plots has cognitive complexity 30 (threshold 15). Drivers by points: if/else 15 (26 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_workflow::artifact::validate_remote_envelope (cognitive 29) crates/crab-workflow/src/artifact.rs:1307— crab_workflow::artifact::validate_remote_envelope has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (21 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.
crab_workflow::params_runtime::render_pr_comment (cognitive 29) crates/crab-workflow/src/params_runtime.rs:708— crab_workflow::params_runtime::render_pr_comment has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 3 (6 pts), match/switch 1 (4 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.
crab_workflow::stage_runtime::hash_object_store_location (cognitive 29) crates/crab-workflow/src/stage_runtime.rs:528— crab_workflow::stage_runtime::hash_object_store_location has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 4, 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.
crab_workflow::params_runtime::read_at_ref (cognitive 28) crates/crab-workflow/src/params_runtime.rs:234— crab_workflow::params_runtime::read_at_ref has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 2 (3 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.
crab_workflow::discover::merge_with_provenance (cognitive 27) crates/crab-workflow/src/discover.rs:138— crab_workflow::discover::merge_with_provenance has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 7 (13 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.
crab_workflow::graph::find_cycle (cognitive 27) crates/crab-workflow/src/graph.rs:321— crab_workflow::graph::find_cycle has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (6 pts), match/switch 2 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_workflow::params_runtime::resolve_stage_param_values_with_wdir (cognitive 27) crates/crab-workflow/src/params_runtime.rs:77— crab_workflow::params_runtime::resolve_stage_param_values_with_wdir has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (10 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_workflow::cache::push_entry_xorbs_remote_with_artifact_stores (cognitive 25) crates/crab-workflow/src/cache.rs:879— crab_workflow::cache::push_entry_xorbs_remote_with_artifact_stores has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 3 (8 pts), loops 2 (4 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.
crab_workflow::dvc_migration::convert_outs (cognitive 25) crates/crab-workflow/src/dvc_migration.rs:250— crab_workflow::dvc_migration::convert_outs has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_workflow::dvc_inventory::parse_pointer (cognitive 24) crates/crab-workflow/src/dvc_inventory.rs:834— crab_workflow::dvc_inventory::parse_pointer has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (17 pts), boolean chains 3, match/switch 1 (3 pts), loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
crab_workflow::lockfile::emit_stage (cognitive 24) crates/crab-workflow/src/lockfile.rs:459— crab_workflow::lockfile::emit_stage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12, loops 6 (12 pts) (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClassTooLong: Index crates/crab-staging/src/index.rs:258— ClassTooLong — 6322 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 110 methods, 2 blocks, lines 258-8959. The bar is 400 significant lines; this is 5922 over it, 15.81× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CrabError crab/src/core/error.rs:17— ClassTooLong — 2719 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 8 methods, 33 blocks, lines 17-3888. The bar is 400 significant lines; this is 2319 over it, 6.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Gateway crates/crab-s3-gateway/src/gateway.rs:129— ClassTooLong — 2184 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 24 methods, 4 blocks, lines 129-4290. The bar is 400 significant lines; this is 1784 over it, 5.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: Store crates/crab-storage/src/store.rs:99— ClassTooLong — 1633 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, 2 blocks, lines 99-2689. The bar is 400 significant lines; this is 1233 over it, 4.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: RemoteGitReader crates/crab-remote-git/src/reader.rs:142— ClassTooLong — 1374 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 2 blocks, lines 142-1839. The bar is 400 significant lines; this is 974 over it, 3.44× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: StagingArea crates/crab-staging/src/lib.rs:295— ClassTooLong — 970 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 295-3662. The bar is 400 significant lines; this is 570 over it, 2.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RemoteGitSnapshot crates/crab-remote-git/src/snapshot.rs:27— ClassTooLong — 955 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 27-1309. The bar is 400 significant lines; this is 555 over it, 2.39× 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: OverlayStore crates/crab-vfs/src/overlay.rs:49— ClassTooLong — 951 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 4 blocks, lines 49-1476. The bar is 400 significant lines; this is 551 over it, 2.38× 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: GitObjectLocatorWriter crates/crab-metadata/src/git_object_locator/writer.rs:166— ClassTooLong — 938 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 2 blocks, lines 166-1437. The bar is 400 significant lines; this is 538 over it, 2.35× 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: Metrics crates/crab-http-server/src/metrics.rs:151— ClassTooLong — 858 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, 4 blocks, lines 151-1600. The bar is 400 significant lines; this is 458 over it, 2.15× 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: EvidenceVerifier crates/crab-cache-server/src/evidence.rs:130— ClassTooLong — 854 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 2 blocks, lines 130-1748. The bar is 400 significant lines; this is 454 over it, 2.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NativePushProgress crab/src/git/progress.rs:557— ClassTooLong — 835 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 65 methods, 2 blocks, lines 557-1892. The bar is 400 significant lines; this is 435 over it, 2.09× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: OperationContext crates/crab-remote-git/src/operation.rs:172— ClassTooLong — 827 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 48 methods, 3 blocks, lines 172-1234. The bar is 400 significant lines; this is 427 over it, 2.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: RepositoryCellRouter crates/crab-http-server/src/cells/router.rs:74— ClassTooLong — 821 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 47 methods, 2 blocks, lines 74-1210. The bar is 400 significant lines; this is 421 over it, 2.05× 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: VfsEngine crates/crab-vfs/src/engine.rs:1085— 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), 60 methods, 2 blocks, lines 1085-2327. 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: ManagedApiClient crates/crab-auth/src/managed/client.rs:137— ClassTooLong — 736 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 35 methods, 2 blocks, lines 137-1086. The bar is 400 significant lines; this is 336 over it, 1.84× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CrabFs crates/crab-vfs/src/fuse.rs:318— ClassTooLong — 728 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, 3 blocks, lines 318-1414. The bar is 400 significant lines; this is 328 over it, 1.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CleanSession crab/src/git/clean.rs:1263— ClassTooLong — 720 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 34 methods, 2 blocks, lines 1263-2564. The bar is 400 significant lines; this is 320 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CachingStore crates/crab-cache-store/src/lib.rs:131— ClassTooLong — 712 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 49 methods, 2 blocks, lines 131-1297. The bar is 400 significant lines; this is 312 over it, 1.78× 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: Config crab/src/core/config.rs:1020— 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), 35 methods, 3 blocks, lines 1020-2773. 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: RemoteGitRepository crates/crab-remote-git/src/repository.rs:275— ClassTooLong — 695 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 46 methods, 3 blocks, lines 275-1266. The bar is 400 significant lines; this is 295 over it, 1.74× 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: RepositoryCellScheduler crates/crab-http-server/src/cells/scheduler.rs:118— ClassTooLong — 689 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 2 blocks, lines 118-1051. The bar is 400 significant lines; this is 289 over it, 1.72× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CacheStore crates/crab-cache-server/src/cache_store.rs:356— ClassTooLong — 683 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 38 methods, 2 blocks, lines 356-1471. The bar is 400 significant lines; this is 283 over it, 1.71× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DaemonService crates/crab-vfs/src/daemon.rs:540— ClassTooLong — 671 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 2 blocks, lines 540-1569. The bar is 400 significant lines; this is 271 over it, 1.68× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GitReceiveWorkspace crates/crab-auth-server/src/receive/git_workspace.rs:97— ClassTooLong — 666 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 2 blocks, lines 97-915. The bar is 400 significant lines; this is 266 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (13 lines × 2) crab/src/cmd/exp.rs:5618— crab/src/cmd/exp.rs:5618-5630 | crab/src/cmd/exp.rs:5644-5656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/exp.rs:5618` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/gc/bucket.rs:1317— crab/src/cmd/gc/bucket.rs:1317-1329 | crab/src/cmd/gc/bucket.rs:1336-1348 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/bucket.rs:1317` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crab/src/cmd/lfs/dedup.rs:1288— crab/src/cmd/lfs/dedup.rs:1288-1300 | crab/src/lfs/track.rs:449-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) crab/src/cmd/metadb.rs:3000— crab/src/cmd/metadb.rs:3000-3012 | crates/crab-auth-server/src/receive.rs:1749-1761 — before extracting anything, compare `crab/src/cmd/metadb.rs` and `crates/crab-auth-server/src/receive.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `crab/src/cmd/metadb.rs:3000` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/replica.rs:3523— crab/src/cmd/replica.rs:3523-3535 | crab/src/cmd/replica.rs:3634-3646 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/replica.rs:3523` it does not close everything it opens, so those 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) crab/src/cmd/status.rs:898— crab/src/cmd/status.rs:898-910 | crab/src/cmd/why.rs:229-241 — 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 `crab/src/cmd/status.rs:898` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/worktree.rs:914— crab/src/cmd/worktree.rs:914-926 | crates/crab-cache-server/src/preflight.rs:710-722 — 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 (13 lines × 2) crab/src/core/error.rs:2274— crab/src/core/error.rs:2274-2286 | crab/src/core/error.rs:2679-2691 — both copies are in the same file, so extract the block into 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) crab/src/cost/inventory/report/azure.rs:46— crab/src/cost/inventory/report/azure.rs:46-58 | crab/src/cost/inventory/report/gcs.rs:50-62 — before extracting anything, compare `crab/src/cost/inventory/report/azure.rs` and `crab/src/cost/inventory/report/gcs.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `crab/src/cost/inventory/report/azure.rs:46` it does not close everything it opens, so those exact lines 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) crab/src/git/progress.rs:420— crab/src/git/progress.rs:420-432 | crab/src/git/progress.rs:436-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crab/src/git/push.rs:10283— crab/src/git/push.rs:10283-10295 | crab/src/git/push.rs:14957-14969 — both copies are in the same file, so extract the 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, `crab/src/git/push.rs:14956` calls `check_cancelled` and `crab/src/git/push.rs:10282` 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) crab/src/lfs/track.rs:487— crab/src/lfs/track.rs:487-499 | crab/src/lfs/track.rs:507-519 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/track.rs:487` it does not close everything it opens, so those exact lines 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) crab/src/metadata/metadb/stores/chunk_index.rs:548— crab/src/metadata/metadb/stores/chunk_index.rs:548-560 | crates/crab-metadata/src/remote_index.rs:359-371 — 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 `crab/src/metadata/metadb/stores/chunk_index.rs:548` it begins part-way through the construct above it, so those exact lines 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/crab-cache-server/src/bin/crab_cache.rs:708— crates/crab-cache-server/src/bin/crab_cache.rs:708-720 | crates/crab-cache-server/src/bin/crab_cache.rs:730-742 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-cache-server/src/bin/crab_cache.rs:708` 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 `report` to `&EvidenceReleaseVerification` in one and `&EvidenceVerificationReport` 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) crates/crab-cache-store/src/xorb_read.rs:63— crates/crab-cache-store/src/xorb_read.rs:63-75 | crates/crab-cache-store/src/xorb_read.rs:115-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-cache-store/src/xorb_read.rs:63` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/crab-coordination/src/write_coordinator.rs:885— crates/crab-coordination/src/write_coordinator.rs:885-897 | crates/crab-coordination/src/write_coordinator.rs:1375-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 `crates/crab-coordination/src/write_coordinator.rs:885` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) crates/crab-http-server/src/main.rs:524— crates/crab-http-server/src/main.rs:524-536 | crates/crab-http-server/src/main.rs:546-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/main.rs:524` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/crab-http-server/src/receive.rs:215— crates/crab-http-server/src/receive.rs:215-227 | crates/crab-http-server/src/receive.rs:439-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/receive.rs:215` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (13 lines × 2) crates/crab-remote-git/src/operation.rs:1084— crates/crab-remote-git/src/operation.rs:1084-1096 | crates/crab-remote-git/src/operation.rs:1106-1118 — both copies are in the same file, so extract the block into 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/crab-remote-git/src/pack.rs:895— crates/crab-remote-git/src/pack.rs:895-907 | crates/crab-remote-git/src/pack.rs:1060-1072 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-remote-git/src/pack.rs:895` it begins part-way through the construct above it, so those 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/crab-remote-git/src/pack.rs:908` calls `now`, `clone` and `crates/crab-remote-git/src/pack.rs:1073` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) crates/crab-remote-git/src/pack.rs:1803— crates/crab-remote-git/src/pack.rs:1803-1815 | crates/crab-remote-git/src/pack.rs:1942-1954 — both copies are in the same file, so extract the 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/crab-remote-git/src/pack.rs:1800` calls `record_generated_pack_cache`, `Some`, `as_ref` and `crates/crab-remote-git/src/pack.rs:1941` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) crates/crab-s3-gateway/src/gateway.rs:1637— crates/crab-s3-gateway/src/gateway.rs:1637-1649 | crates/crab-s3-gateway/src/gateway.rs:2150-2162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-s3-gateway/src/gateway.rs:1637` it does not close everything it opens, so those exact lines 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/crab-sdk/src/client/mutation.rs:713— crates/crab-sdk/src/client/mutation.rs:713-725 | crates/crab-sdk/src/client/mutation/commit.rs:396-408 — 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/crab-sdk/src/client/mutation.rs:713` it does not close everything it opens, so those 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/crab-sdk/src/client/mutation.rs:726` calls `clone` and `crates/crab-sdk/src/client/mutation/commit.rs:409` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) crates/crab-sdk/src/managed.rs:336— crates/crab-sdk/src/managed.rs:336-348 | crates/crab-sdk/src/managed.rs:366-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-sdk/src/managed.rs:336` it does not close everything it opens, so those exact lines 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/crab-vfs/src/snapshot.rs:107— crates/crab-vfs/src/snapshot.rs:107-119 | crates/crab-vfs/src/snapshot.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.
+ 15 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×40
No test reaches this file packages/web/components/blog/push-pipeline-visuals.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/library/first-workflow-learning-labs.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/app/cache/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/app/auth/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/app/cli/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/blog-diagrams.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/app/pricing/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/app/diagrams/use-case-visuals.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/lazy-checkout-visuals.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/git-architecture-player.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/library/ml-workflow-visuals.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/cache-visuals.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/consistency-visuals.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/reconstruction-visuals.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/deduplication-visuals.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/gc-visuals.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/lfs-compatibility-visuals.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/large-file-scale-explorer.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/app/use-cases/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/app/library/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/blog-process-player.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/app/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/mount-visuals.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/app/library/[slug]/page.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file packages/web/components/blog/blog-detail-diagrams.tsx:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
+ 15 more in this group — see findings.md.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×40
Recursive walk over a caller-supplied document has no depth cap crates/crab-workflow/src/template/context.rs:311— `load_vars` is public, takes a document from its caller (line 118) and hands it to `merge_var_value`, which recurses at line 311 through `merge_var_mapping` and back with a piece of the document (and at line 324) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `merge_var_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/crab-workflow/src/template/matrix.rs:235— `expand_matrix` is public, takes a document from its caller (line 46) and hands it to `substitute_template`, which recurses at line 235 through `substitute_command_template` and back with a piece of the document (and at line 239, line 241, line 250, line 269) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `substitute_template` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/crab-sdk/src/error.rs:80— `with_operation` is public and takes a `Error` as its receiver from its caller, and it calls itself at line 80 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_operation` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/crab-remote-git/src/error.rs:475— `after_interruption` is public and takes a `Error` as its receiver from its caller, and it calls itself at line 475 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `after_interruption` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/crab-remote-git/src/pack.rs:203— `fmt` is public and takes a `GeneratedPackLeaseError` as its receiver from its caller, and it calls itself at line 203 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `fmt` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/crab-remote-git/src/path_state.rs:75— `latest` is public and takes a `PathStateIndex` as its receiver from its caller, and it calls itself at line 75 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `latest` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/crab-remote-git/src/runtime.rs:449— `spawn_blocking` is public and takes a `RemoteGitRuntime` as its receiver from its caller, and it calls itself at line 449 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `spawn_blocking` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/crab-remote-git/src/budget/shared.rs:155— `charge` is public and takes a `SharedBudget` as its receiver from its caller, and it calls itself at line 155 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `charge` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/crab-remote/src/objects.rs:173— `insert` is public and takes a `TreeEdits` as its receiver from its caller, and it calls itself at line 173 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `insert` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/crab-remote/src/objects.rs:264— `apply_to_empty` is public, takes a document from its caller (line 198) and hands it to `build`, which calls itself at line 264 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `build` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/crab-read/src/upload_pack.rs:295— `canonical_spec` is public and takes a `UploadPackFilter` as its receiver from its caller, and it calls itself at line 295 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `canonical_spec` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/crab-read/src/upload_pack.rs:317— `is_catalog_exact` is public and takes a `UploadPackFilter` as its receiver from its caller, and it calls itself at line 317 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `is_catalog_exact` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crates/crab-auth/src/managed/openapi.rs:717— `managed_openapi_breaking_changes` is public, takes a document from its caller (line 549) and hands it to `compare_schema`, which calls itself at line 717 with a piece of the document (and at line 727, line 746) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `compare_schema` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crab/src/audit.rs:164— `redact_details` is public, takes a document from its caller (line 152) and hands it to `redact_value`, which calls itself at line 164 with a piece of the document (and at line 170) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `redact_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crab/src/storage/retry.rs:59— `retry_class` is public and takes `err: &CrabError` from its caller, and it calls itself at line 59 with a piece of the document (and at line 81, line 82) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `retry_class` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crab/src/storage/store.rs:331— `storage_scope` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 331 with a piece of the document (and at line 406) — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `storage_scope` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crab/src/storage/store.rs:367— `with_bucket_identity` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 367 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_bucket_identity` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crab/src/storage/store.rs:373— `with_target_identity` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 373 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_target_identity` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crab/src/storage/store.rs:379— `with_signer` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 379 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_signer` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crab/src/storage/store.rs:389— `with_multipart` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 389 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_multipart` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crab/src/storage/store.rs:395— `has_resumable_multipart` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 395 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `has_resumable_multipart` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crab/src/storage/store.rs:400— `with_storage_scope` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 400 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_storage_scope` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crab/src/storage/store.rs:411— `with_read_routes` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 411 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_read_routes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crab/src/storage/store.rs:417— `with_read_byte_observer` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 417 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_read_byte_observer` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap crab/src/storage/store.rs:423— `with_staging_writes` is public and takes a `Store` as its receiver from its caller, and it calls itself at line 423 with a piece of the document — and nowhere in the walk is a depth or nesting counter compared with a bound. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. When a Rust thread runs out of stack it is not unwound: the runtime reports the overflow and aborts the process, so `catch_unwind` does not stop it and every other request the process serves dies with it (spawned threads, a Tokio worker included, get 2 MiB by default). serde_json and serde_yaml stop parsing at 128 levels only on their default path; a value from `disable_recursion_limit`, from another format or parser, or built in code carries whatever nesting it was given. Thread a depth argument through `with_staging_writes` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
+ 15 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×38
Edited copy of a member (12 corresponding lines) crab/src/cmd/auth_status.rs:192— crab/src/cmd/auth_status.rs:192-203 | crab/src/cmd/history_recovery.rs:1281-1295 — 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) crab/src/cmd/artifacts.rs:140— crab/src/cmd/artifacts.rs:140-154 | crab/src/cmd/data.rs:153-164 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/crab-git/src/lfs_pointer.rs:317— crates/crab-git/src/lfs_pointer.rs:317-328 | crates/crab-types/src/pointer.rs:232-246 — 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/crab-http-server/src/cells/repository.rs:781— crates/crab-http-server/src/cells/repository.rs:781-798 | crates/crab-http-server/src/cells/repository.rs:800-811 — 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) crab/src/cmd/exp.rs:4972— crab/src/cmd/exp.rs:4972-4984 | crates/crab-workflow/src/artifact.rs:1697-1708 — 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) crab/src/cmd/replica.rs:8401— crab/src/cmd/replica.rs:8401-8412 | crab/src/cmd/replica.rs:8414-8425 — 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/crab-http-server/src/peer.rs:1418— crates/crab-http-server/src/peer.rs:1418-1431 | crates/crab-metadata/src/git_visibility.rs:1470-1481 — 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/crab-workflow/src/hydra.rs:1357— crates/crab-workflow/src/hydra.rs:1357-1368 | crates/crab-workflow/src/hydra.rs:1370-1381 — 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/crab-auth-server/src/receive.rs:795— crates/crab-auth-server/src/receive.rs:795-806 | crates/crab-xet/src/shard.rs:548-560 — 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/crab-http-server/src/api.rs:975— crates/crab-http-server/src/api.rs:975-989 | crates/crab-http-server/src/projection.rs:954-965 — 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/crab-http-server/src/cells/repository/checks.rs:718— crates/crab-http-server/src/cells/repository/checks.rs:718-731 | crates/crab-http-server/src/statuses.rs:119-130 — 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/crab-remote-git/src/pack.rs:1509— crates/crab-remote-git/src/pack.rs:1509-1523 | crates/crab-remote-git/src/pack.rs:1530-1541 — 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) crab/src/cmd/data.rs:934— crab/src/cmd/data.rs:934-945 | REDACTED:1456-1467 — 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) crab/src/cmd/fsck_store.rs:307— crab/src/cmd/fsck_store.rs:307-323 | crab/src/cmd/fsck_store.rs:326-337 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (12 corresponding lines) crates/crab-vfs/src/overlay.rs:1377— crates/crab-vfs/src/overlay.rs:1377-1388 | crates/crab-vfs/src/overlay.rs:1415-1426 — 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/crab-s3-gateway/src/multipart.rs:346— crates/crab-s3-gateway/src/multipart.rs:346-357 | crates/crab-s3-gateway/src/multipart.rs:359-370 — 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) crab/src/cmd/run.rs:3949— crab/src/cmd/run.rs:3949-3960 | crab/src/cmd/status_workflow.rs:569-580 — 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/crab-sdk/src/mutation.rs:345— crates/crab-sdk/src/mutation.rs:345-357 | crates/crab-sdk/src/mutation.rs:446-457 — 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/crab-workflow/src/artifact.rs:1152— crates/crab-workflow/src/artifact.rs:1152-1166 | crates/crab-workflow/src/artifact.rs:1724-1735 — 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/crab-metadata/src/shallow_closure.rs:602— crates/crab-metadata/src/shallow_closure.rs:602-613 | crates/crab-metadata/src/shallow_closure.rs:615-626 — 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/crab-s3-gateway/src/server.rs:425— crates/crab-s3-gateway/src/server.rs:425-437 | crates/crab-s3-gateway/src/server.rs:439-450 — 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) crab/src/cmd/lfs/ls_files.rs:298— crab/src/cmd/lfs/ls_files.rs:298-309 | crab/src/lfs/prune.rs:562-575 — 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) crab/src/cmd/replica.rs:11324— crab/src/cmd/replica.rs:11324-11335 | crab/src/lfs/track.rs:708-723 — 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) crab/src/replication/mod.rs:5031— crab/src/replication/mod.rs:5031-5043 | crates/crab-coordination/src/write_coordinator.rs:2187-2198 — 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) crab/src/speculation/driver.rs:85— crab/src/speculation/driver.rs:85-96 | crab/src/speculation/driver.rs:110-121 — 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.
+ 13 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×38
Edited copy of a member (9 corresponding lines) crates/crab-staging/src/lib.rs:2810— crates/crab-staging/src/lib.rs:2810-2818 | crates/crab-staging/src/lib.rs:3844-3852 — 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/crab-coordination/src/push_lock.rs:561— crates/crab-coordination/src/push_lock.rs:561-571 | crates/crab-coordination/src/push_lock.rs:938-946 — 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/crab-cache/src/local_cache.rs:601— crates/crab-cache/src/local_cache.rs:601-609 | crates/crab-cache/src/local_cache.rs:612-620 — 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/crab-metadata/src/git_object_locator/format.rs:272— crates/crab-metadata/src/git_object_locator/format.rs:272-280 | crates/crab-metadata/src/value_codec.rs:29-37 — 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/crab-http-server/src/assignees.rs:86— crates/crab-http-server/src/assignees.rs:86-94 | crates/crab-http-server/src/labels.rs:171-179 — 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/crab-metadata/src/manifest_store.rs:738— crates/crab-metadata/src/manifest_store.rs:738-746 | crates/crab-metadata/src/segmented_store.rs:275-283 — 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/crab-xet/src/shard_bloom.rs:91— crates/crab-xet/src/shard_bloom.rs:91-99 | crates/crab-xet/src/shard_bloom.rs:103-117 — 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/crab-http-server/src/lfs.rs:100— crates/crab-http-server/src/lfs.rs:100-108 | crates/crab-http-server/src/receive.rs:110-118 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crab/src/cmd/dehydrate.rs:1152— crab/src/cmd/dehydrate.rs:1152-1160 | crab/src/cmd/hydrate.rs:1406-1414 — 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/crab-http-server/src/cells/repository/codec.rs:14— crates/crab-http-server/src/cells/repository/codec.rs:14-24 | crates/crab-http-server/src/cells/repository/codec.rs:42-50 — 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/crab-git/src/lfs_pointer.rs:340— crates/crab-git/src/lfs_pointer.rs:340-348 | crates/crab-types/src/pointer.rs:261-269 — 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) crab/src/cmd/recover.rs:896— crab/src/cmd/recover.rs:896-904 | crab/src/cmd/recover.rs:906-914 — 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/crab-cache/src/local_cache/maintenance.rs:321— crates/crab-cache/src/local_cache/maintenance.rs:321-329 | crates/crab-cache/src/local_cache/maintenance.rs:331-339 — 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/crab-staging/src/lib.rs:2395— crates/crab-staging/src/lib.rs:2395-2403 | crates/crab-staging/src/lib.rs:3833-3841 — 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/crab-workflow/src/yaml.rs:508— crates/crab-workflow/src/yaml.rs:508-516 | crates/crab-workflow/src/yaml.rs:652-661 — 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) crab/src/replication/mod.rs:7280— crab/src/replication/mod.rs:7280-7288 | crates/crab-auth-server/src/receive.rs:260-273 — 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/crab-http-server/src/api.rs:772— crates/crab-http-server/src/api.rs:772-780 | crates/crab-remote-git/src/snapshot.rs:1462-1470 — These two members are one piece of code written twice and then edited apart: 9 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (9 corresponding lines) crates/crab-cache-server/src/db.rs:82— crates/crab-cache-server/src/db.rs:82-90 | crates/crab-vfs/src/snapshot.rs:433-441 — 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/crab-workflow/src/lockfile.rs:1140— crates/crab-workflow/src/lockfile.rs:1140-1148 | crates/crab-workflow/src/lockfile.rs:1150-1158 — 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/crab-remote-git/src/budget.rs:251— crates/crab-remote-git/src/budget.rs:251-259 | crates/crab-storage/src/transport_read_admission.rs:88-96 — 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/crab-git/src/url.rs:201— crates/crab-git/src/url.rs:201-210 | crates/crab-git/src/url.rs:274-282 — 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/crab-http-server/src/auth.rs:895— crates/crab-http-server/src/auth.rs:895-906 | crates/crab-storage/src/provider_store.rs:707-715 — 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/crab-http-server/src/cells/repository/checks_codec.rs:169— crates/crab-http-server/src/cells/repository/checks_codec.rs:169-177 | crates/crab-http-server/src/cells/repository/checks_codec.rs:212-221 — 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/crab-http-server/src/peer/node_log_client.rs:500— crates/crab-http-server/src/peer/node_log_client.rs:500-508 | crates/crab-metadata/src/git_visibility.rs:1491-1499 — 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/crab-storage/src/store.rs:416— crates/crab-storage/src/store.rs:416-424 | crates/crab-storage/src/store.rs:431-439 — 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.
+ 13 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×37
Edited copy of a member (13 corresponding lines) crab/src/cmd/gc/journal.rs:257— crab/src/cmd/gc/journal.rs:257-292 | crab/src/cmd/gc/journal.rs:676-697 — 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) crab/src/cmd/auth_status.rs:252— crab/src/cmd/auth_status.rs:252-264 | crab/src/cmd/mount.rs:3054-3073 — 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/crab-staging/src/index.rs:4970— crates/crab-staging/src/index.rs:4970-4982 | crates/crab-staging/src/index.rs:7616-7631 — 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/crab-metadata/src/key_codec.rs:115— crates/crab-metadata/src/key_codec.rs:115-127 | crates/crab-metadata/src/key_codec.rs:186-198 — 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/crab-http-server/src/cells/repository/codec.rs:380— crates/crab-http-server/src/cells/repository/codec.rs:380-393 | crates/crab-http-server/src/cells/repository/codec.rs:621-633 — 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/crab-read/src/upload_pack_wire.rs:365— crates/crab-read/src/upload_pack_wire.rs:365-377 | crates/crab-remote-git/src/pack.rs:2943-2959 — 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) crab/src/cmd/data.rs:1530— crab/src/cmd/data.rs:1530-1542 | crates/crab-workflow/src/dvc_inventory.rs:2308-2326 — 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/crab-cache/src/cache_client.rs:236— crates/crab-cache/src/cache_client.rs:236-250 | crates/crab-cache/src/cache_client.rs:255-267 — 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/crab-http-server/src/cells/repository.rs:962— crates/crab-http-server/src/cells/repository.rs:962-978 | crates/crab-http-server/src/cells/repository/pulls.rs:1571-1583 — 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) crab/src/git/push.rs:18789— crab/src/git/push.rs:18789-18806 | crab/src/optimize/xorbs/reconcile.rs:765-777 — 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) crab/src/cmd/add.rs:2815— crab/src/cmd/add.rs:2815-2831 | crab/src/cmd/status_workflow.rs:555-567 — 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/crab-coordination/src/cosmosdb_coordinator.rs:957— crates/crab-coordination/src/cosmosdb_coordinator.rs:957-970 | crates/crab-coordination/src/cosmosdb_coordinator.rs:972-984 — 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/crab-workflow/src/graph.rs:208— crates/crab-workflow/src/graph.rs:208-220 | crates/crab-workflow/src/graph.rs:227-239 — 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/crab-http-server/src/cells/repository.rs:851— crates/crab-http-server/src/cells/repository.rs:851-863 | crates/crab-http-server/src/cells/repository/projection.rs:1083-1095 — 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/crab-workflow/src/hydra.rs:1151— crates/crab-workflow/src/hydra.rs:1151-1167 | crates/crab-workflow/src/hydra.rs:1173-1185 — 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/crab-http-server/src/pulls/storage.rs:727— crates/crab-http-server/src/pulls/storage.rs:727-739 | crates/crab-http-server/src/pulls/storage.rs:744-756 — 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/crab-read/src/upload_pack.rs:436— crates/crab-read/src/upload_pack.rs:436-448 | crates/crab-read/src/upload_pack.rs:455-470 — 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/crab-http-server/src/cells/repository/checks.rs:410— crates/crab-http-server/src/cells/repository/checks.rs:410-422 | crates/crab-http-server/src/cells/repository/checks.rs:437-455 — 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/crab-http-server/src/branches.rs:438— crates/crab-http-server/src/branches.rs:438-450 | crates/crab-http-server/src/releases.rs:180-193 — 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/crab-metadata/src/split_commit_graph.rs:987— crates/crab-metadata/src/split_commit_graph.rs:987-999 | crates/crab-metadata/src/split_commit_graph.rs:1013-1025 — 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/crab-remote-git/src/budget.rs:268— crates/crab-remote-git/src/budget.rs:268-280 | crates/crab-remote-git/src/budget.rs:285-297 — 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) crab/src/tier/apply.rs:449— crab/src/tier/apply.rs:449-463 | crab/src/tier/apply.rs:465-477 — 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) crab/src/cmd/lfs/install.rs:251— crab/src/cmd/lfs/install.rs:251-263 | crab/src/cmd/lfs/install.rs:333-348 — 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) crab/src/cmd/lfs/convert.rs:438— crab/src/cmd/lfs/convert.rs:438-452 | crab/src/cmd/reset.rs:361-373 — 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) crab/src/import/ingest.rs:719— crab/src/import/ingest.rs:719-738 | crab/src/import/ingest.rs:863-875 — 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.
+ 12 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×36
Edited copy of a member (10 corresponding lines) crab/src/cmd/artifacts.rs:125— crab/src/cmd/artifacts.rs:125-138 | crab/src/cmd/data.rs:141-150 — 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) crab/src/cmd/metrics.rs:3611— crab/src/cmd/metrics.rs:3611-3620 | crab/src/cmd/params.rs:457-466 — 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) crab/src/cmd/dag.rs:451— crab/src/cmd/dag.rs:451-460 | crab/src/cmd/stage/list.rs:280-289 — 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) crab/src/core/output/mod.rs:91— crab/src/core/output/mod.rs:91-100 | crab/src/core/output/mod.rs:111-121 — 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/crab-http-server/src/cells/repository/checks.rs:754— crates/crab-http-server/src/cells/repository/checks.rs:754-763 | crates/crab-http-server/src/cells/repository/checks.rs:765-775 — 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) crab/src/replication/mod.rs:4819— crab/src/replication/mod.rs:4819-4828 | crab/src/replication/mod.rs:4931-4940 — 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/crab-lfs/src/object_store.rs:283— crates/crab-lfs/src/object_store.rs:283-292 | crates/crab-lfs/src/object_store.rs:1075-1089 — 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/crab-http-server/src/pulls/review_thread_storage.rs:108— crates/crab-http-server/src/pulls/review_thread_storage.rs:108-117 | crates/crab-http-server/src/pulls/review_thread_storage.rs:249-258 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (10 corresponding lines) crates/crab-http-server/src/cells/repository/checks.rs:742— crates/crab-http-server/src/cells/repository/checks.rs:742-752 | crates/crab-http-server/src/cells/repository/pulls.rs:1501-1510 — 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) crab/src/core/config_resolver.rs:169— crab/src/core/config_resolver.rs:169-178 | crab/src/core/config_resolver.rs:182-191 — 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/crab-cache/src/catalog.rs:310— crates/crab-cache/src/catalog.rs:310-319 | crates/crab-cache/src/private_fs.rs:208-221 — 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) crab/src/metadata/metadb/stores/chunk_index.rs:326— crab/src/metadata/metadb/stores/chunk_index.rs:326-335 | crab/src/metadata/metadb/stores/chunk_index.rs:426-435 — 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/crab-cache/src/local_cache.rs:1186— crates/crab-cache/src/local_cache.rs:1186-1195 | crates/crab-workflow/src/cache.rs:297-311 — 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/crab-vfs/src/publish.rs:1821— crates/crab-vfs/src/publish.rs:1821-1833 | crates/crab-vfs/src/publish.rs:1846-1855 — 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) crab/src/cmd/lfs/convert.rs:416— crab/src/cmd/lfs/convert.rs:416-425 | crab/src/cmd/lfs/convert.rs:427-436 — 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/crab-cache/src/private_fs/platform/database/file.rs:170— crates/crab-cache/src/private_fs/platform/database/file.rs:170-179 | crates/crab-cache/src/private_fs/platform/database/file.rs:181-192 — 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) crab/src/metadata/metadb/stores/chunk_index.rs:597— crab/src/metadata/metadb/stores/chunk_index.rs:597-608 | crab/src/metadata/metadb/stores/chunk_index.rs:626-635 — 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) crab/src/cmd/auth_status.rs:175— crab/src/cmd/auth_status.rs:175-188 | crab/src/cmd/metadb.rs:1772-1781 — 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) crab/src/replication/mod.rs:3543— crab/src/replication/mod.rs:3543-3553 | crates/crab-coordination/src/spanner_coordinator.rs:720-729 — 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/crab-metadata/src/path_state/storage.rs:281— crates/crab-metadata/src/path_state/storage.rs:281-290 | crates/crab-metadata/src/split_commit_graph.rs:876-885 — 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) crab/src/cmd/download.rs:330— crab/src/cmd/download.rs:330-339 | crab/src/cmd/export.rs:290-299 — 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/crab-cache/src/local_cache.rs:956— crates/crab-cache/src/local_cache.rs:956-965 | crates/crab-cache/src/local_cache.rs:972-983 — 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/crab-workflow/src/template/substitute.rs:101— crates/crab-workflow/src/template/substitute.rs:101-113 | crates/crab-workflow/src/template/substitute.rs:172-181 — 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/crab-workflow/src/cache.rs:437— crates/crab-workflow/src/cache.rs:437-446 | crates/crab-workflow/src/experiment.rs:240-254 — 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) crab/src/cmd/hydrate.rs:1215— crab/src/cmd/hydrate.rs:1215-1227 | crates/crab-read/src/hydrator.rs:692-701 — 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.
Duplicated block (14 lines × 2) crab/src/cmd/config.rs:224— crab/src/cmd/config.rs:224-237 | crab/src/cmd/config.rs:464-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/config.rs:224` it does not close everything it opens, so those exact lines 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) crab/src/cmd/data.rs:1190— crab/src/cmd/data.rs:1190-1203 | crab/src/cmd/data.rs:1205-1218 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/data.rs:1190` it begins part-way through the construct above it, so those 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) crab/src/cmd/gc/journal.rs:441— crab/src/cmd/gc/journal.rs:441-454 | crab/src/cmd/gc/journal.rs:565-578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/journal.rs:441` it does not close everything it opens, so those exact lines 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) crab/src/cmd/metadb.rs:2313— crab/src/cmd/metadb.rs:2313-2326 | crab/src/cmd/metadb.rs:2617-2630 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/metadb.rs:2313` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/migrate.rs:2497— crab/src/cmd/migrate.rs:2497-2510 | crab/src/cmd/migrate.rs:2550-2563 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/migrate.rs:2497` it does not close everything it opens, so those 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) crab/src/git/clean.rs:1345— crab/src/git/clean.rs:1345-1358 | crab/src/git/clean.rs:1387-1400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/clean.rs:1345` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crab/src/git/progress.rs:1169— crab/src/git/progress.rs:1169-1182 | crab/src/git/progress.rs:1184-1197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (14 lines × 2) crab/src/git/push.rs:18326— crab/src/git/push.rs:18326-18339 | crates/crab-git/src/walk.rs:170-183 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:18326` it does not close everything it opens, so those exact lines 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) crab/src/lfs/recent.rs:231— crab/src/lfs/recent.rs:231-244 | crab/src/lfs/recent.rs:260-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/recent.rs:231` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) crab/src/lfs/transfer_agent.rs:428— crab/src/lfs/transfer_agent.rs:428-441 | crab/src/lfs/transfer_agent.rs:509-522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/transfer_agent.rs:428` it begins part-way through the construct above it, so those exact lines 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) crab/src/read/mod.rs:558— crab/src/read/mod.rs:558-571 | crab/src/read/mod.rs:643-656 — both copies are in the same file, so extract the block into 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/crab-auth-server/src/receive.rs:1238— crates/crab-auth-server/src/receive.rs:1238-1251 | crates/crab-auth-server/src/view/objects.rs:224-237 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-auth-server/src/receive.rs:1238` it does not close everything it opens, so those exact lines 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/crab-auth/src/crab_auth_client.rs:167— crates/crab-auth/src/crab_auth_client.rs:167-180 | crates/crab-auth/src/crab_auth_client.rs:248-261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-auth/src/crab_auth_client.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.
Duplicated block (14 lines × 2) crates/crab-cache-server/src/handlers.rs:324— crates/crab-cache-server/src/handlers.rs:324-337 | crates/crab-cache-server/src/handlers.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 `crates/crab-cache-server/src/handlers.rs:324` it begins part-way through the construct above it, so those exact lines 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/crab-cache-server/src/handlers.rs:1965— crates/crab-cache-server/src/handlers.rs:1965-1978 | crates/crab-cache-server/src/handlers.rs:1997-2010 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/crab-cache/src/local_cache.rs:519— crates/crab-cache/src/local_cache.rs:519-532 | crates/crab-cache/src/local_cache.rs:554-567 — both copies are in the same file, so extract the block into 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/crab-http-server/src/contents.rs:450— crates/crab-http-server/src/contents.rs:450-463 | crates/crab-http-server/src/contents.rs:541-554 — both copies are in the same file, so extract the block into 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/crab-metadata/src/git_object_locator/reader.rs:667— crates/crab-metadata/src/git_object_locator/reader.rs:667-680 | crates/crab-metadata/src/git_object_locator/reader.rs:758-771 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-metadata/src/git_object_locator/reader.rs:667` 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 (14 lines × 2) crates/crab-staging/src/index.rs:8383— crates/crab-staging/src/index.rs:8383-8396 | crates/crab-staging/src/index.rs:8446-8459 — both copies are in the same file, so extract the block into 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/crab-staging/src/push_plan.rs:1099— crates/crab-staging/src/push_plan.rs:1099-1112 | crates/crab-staging/src/push_plan.rs:1140-1153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) crates/crab-vfs/src/daemon.rs:1299— crates/crab-vfs/src/daemon.rs:1299-1312 | crates/crab-vfs/src/daemon.rs:1368-1381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-vfs/src/daemon.rs:1299` it does not close everything it opens, so those exact lines 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/crab-vfs/src/overlay.rs:1034— crates/crab-vfs/src/overlay.rs:1034-1047 | crates/crab-vfs/src/overlay.rs:1443-1456 — both copies are in the same file, so extract the 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/crab-vfs/src/overlay.rs:1441` calls `set_path_permissions` and `crates/crab-vfs/src/overlay.rs:1032` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) crates/crab-workflow/src/artifact.rs:2119— crates/crab-workflow/src/artifact.rs:2119-2132 | crates/crab-workflow/src/artifact.rs:2151-2164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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) crates/crab-workflow/src/template/context.rs:406— crates/crab-workflow/src/template/context.rs:406-419 | crates/crab-workflow/src/template/context.rs:423-436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-workflow/src/template/context.rs:406` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) crates/crab-workflow/src/template/substitute.rs:229— crates/crab-workflow/src/template/substitute.rs:229-242 | crates/crab-workflow/src/yaml.rs:633-646 — 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.
Configuration option is read nowhere crab/src/cmd/exp.rs:458— `ShowArgs.no_pager` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/cmd/import.rs:137— `ImportArgs.estimate` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/cmd/import.rs:177— `ImportArgs.source_profile` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/cmd/import.rs:181— `ImportArgs.target_profile` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/cmd/lfs/mod.rs:687— `LfsExtCmd::List.names` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/cmd/replica.rs:268— `VerifyArgs.exhaustive` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/core/config.rs:1446— `ConfigOverlay.hydra` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:74— `Cli.log_level` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:218— `Cmd::Clone.no_lazy` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:308— `Cmd::Doctor.support_bundle` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:311— `Cmd::Doctor.cache_service_active_probe` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:345— `Cmd::Track.list` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:392— `Cmd::Gc.deregister` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:395— `Cmd::Gc.repair_registry` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:398— `Cmd::Gc.repair_closures` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:500— `Cmd::Completions.install` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:579— `Cmd::Hydrate.ignore_sparse` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:607— `Cmd::Hydrate.clear_speculation` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:663— `Cmd::DiffDriver.old_mode` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:669— `Cmd::DiffDriver.new_mode` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:1069— `Cmd::Daemon.hydration_concurrency` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:1712— `MountCmd::Status.live_only` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:1718— `MountCmd::Status.dirty` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crab/src/main.rs:2011— `MigrateCmd::GcFence.quiesced` is offered as a command-line argument option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is read nowhere crates/crab-cache-server/src/config.rs:109— `RawConfig.logging` is offered as a configuration-file option, so whoever configures the program can set it — but no production code reads it. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
+ 8 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×30
Edited copy of a member (15 corresponding lines) crab/scripts/generate_test_file.rs:202— crab/scripts/generate_test_file.rs:202-216 | crab/src/core/config_resolver.rs:206-220 — 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) crab/src/core/error.rs:993— crab/src/core/error.rs:993-1019 | crates/crab-cache/src/error.rs:178-192 — 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/crab-workflow/src/cache.rs:450— crates/crab-workflow/src/cache.rs:450-467 | crates/crab-workflow/src/experiment.rs:335-349 — 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) crab/src/speculation/access_db.rs:319— crab/src/speculation/access_db.rs:319-333 | crab/src/speculation/access_db.rs:370-384 — 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) crab/src/cmd/add.rs:3402— crab/src/cmd/add.rs:3402-3416 | crab/src/cmd/clone.rs:1589-1605 — 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/crab-read/src/hydrator/stream.rs:83— crates/crab-read/src/hydrator/stream.rs:83-97 | crates/crab-sdk/src/content/crab.rs:215-231 — 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) crab/src/cache/mod.rs:51— crab/src/cache/mod.rs:51-69 | crates/crab-cache/src/shard_hints.rs:39-53 — 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/crab-remote-git/src/snapshot.rs:1205— crates/crab-remote-git/src/snapshot.rs:1205-1219 | crates/crab-remote-git/src/snapshot.rs:1261-1278 — 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/crab-workflow/src/template/context.rs:357— crates/crab-workflow/src/template/context.rs:357-371 | crates/crab-workflow/src/template/substitute.rs:183-197 — 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/crab-metadata/src/persistent_chunk_index.rs:479— crates/crab-metadata/src/persistent_chunk_index.rs:479-500 | crates/crab-metadata/src/persistent_chunk_index.rs:523-537 — 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) crab/src/import/versions.rs:1445— crab/src/import/versions.rs:1445-1459 | crab/src/storage/head_class.rs:440-458 — 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) crab/src/cmd/hydrate.rs:1183— crab/src/cmd/hydrate.rs:1183-1197 | crab/src/cmd/hydrate.rs:1199-1213 — 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/crab-git/src/ref_resolve.rs:50— crates/crab-git/src/ref_resolve.rs:50-64 | crates/crab-git/src/ref_resolve.rs:106-124 — 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) crab/src/cmd/exp.rs:5509— crab/src/cmd/exp.rs:5509-5523 | crab/src/cmd/exp.rs:5525-5539 — 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) crab/src/cmd/run.rs:3970— crab/src/cmd/run.rs:3970-3984 | crates/crab-workflow/src/scheduler.rs:289-303 — 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/crab-cache-store/src/lib.rs:582— crates/crab-cache-store/src/lib.rs:582-596 | crates/crab-cache-store/src/lib.rs:602-619 — 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/crab-sdk/src/managed.rs:280— crates/crab-sdk/src/managed.rs:280-294 | crates/crab-sdk/src/managed.rs:412-428 — 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) crab/src/git/progress.rs:37— crab/src/git/progress.rs:37-52 | crab/src/git/progress.rs:55-69 — 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/crab-remote-git/src/runtime.rs:746— crates/crab-remote-git/src/runtime.rs:746-760 | crates/crab-remote-git/src/runtime.rs:982-997 — 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) crab/src/core/config_resolver.rs:239— crab/src/core/config_resolver.rs:239-256 | crates/crab-git/src/discover.rs:23-37 — 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) crab/src/diff/format_hint.rs:109— crab/src/diff/format_hint.rs:109-123 | crab/src/diff/format_hint.rs:238-252 — 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) crab/src/cmd/exp_queue.rs:1515— crab/src/cmd/exp_queue.rs:1515-1529 | crab/src/cmd/exp_queue.rs:1531-1555 — 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/crab-auth-server/src/receive/git_workspace.rs:663— crates/crab-auth-server/src/receive/git_workspace.rs:663-687 | crates/crab-auth-server/src/receive/git_workspace.rs:689-703 — 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) crab/src/auth/oidc.rs:450— crab/src/auth/oidc.rs:450-464 | crab/src/auth/oidc.rs:467-481 — 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) crab/src/cmd/push.rs:1018— crab/src/cmd/push.rs:1018-1032 | crab/src/cmd/push.rs:1034-1048 — 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.
+ 5 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×29
Edited copy of a member (18 corresponding lines) crab/src/cmd/metrics.rs:2684— crab/src/cmd/metrics.rs:2684-2705 | crab/src/cmd/metrics.rs:2713-2730 — 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) crab/deploy/auth-service/src/policy.py:519— crab/deploy/auth-service/src/policy.py:519-541 | crab/deploy/auth-service/src/policy.py:545-562 — 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) crab/src/git/clean.rs:477— crab/src/git/clean.rs:477-496 | crates/crab-staging/src/lib.rs:2700-2717 — 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/crab-coordination/src/push_lock.rs:715— crates/crab-coordination/src/push_lock.rs:715-733 | crates/crab-coordination/src/push_lock.rs:965-982 — 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/crab-coordination/src/spanner_coordinator.rs:362— crates/crab-coordination/src/spanner_coordinator.rs:362-383 | crates/crab-coordination/src/spanner_coordinator.rs:748-765 — 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/crab-http-server/src/cells/repository/pulls.rs:759— crates/crab-http-server/src/cells/repository/pulls.rs:759-776 | crates/crab-http-server/src/cells/repository/releases.rs:954-973 — 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) crab/src/cmd/clone.rs:1029— crab/src/cmd/clone.rs:1029-1051 | crates/crab-auth-server/src/receive/git_workspace.rs:1171-1188 — 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) crab/src/lfs/lock.rs:441— crab/src/lfs/lock.rs:441-462 | crates/crab-lfs/src/lock.rs:543-560 — 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/crab-cache-server/src/metrics.rs:383— crates/crab-cache-server/src/metrics.rs:383-400 | crates/crab-cache-server/src/metrics.rs:470-488 — 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) crab/src/cmd/lfs/convert.rs:229— crab/src/cmd/lfs/convert.rs:229-246 | crab/src/cmd/optimize.rs:273-291 — 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/crab-metadata/src/git_visibility.rs:2994— crates/crab-metadata/src/git_visibility.rs:2994-3011 | crates/crab-metadata/src/git_visibility.rs:3682-3707 — 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/crab-auth-server/src/receive/git_workspace.rs:118— crates/crab-auth-server/src/receive/git_workspace.rs:118-135 | crates/crab-auth-server/src/receive/git_workspace.rs:536-555 — 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) crab/src/cmd/recover.rs:1320— crab/src/cmd/recover.rs:1320-1340 | crab/src/cmd/recover.rs:1463-1480 — 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/crab-vfs/src/engine.rs:1539— crates/crab-vfs/src/engine.rs:1539-1556 | crates/crab-vfs/src/engine.rs:1832-1853 — 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/crab-workflow/src/template/foreach.rs:69— crates/crab-workflow/src/template/foreach.rs:69-86 | crates/crab-workflow/src/template/foreach.rs:96-117 — 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/crab-vfs/src/publish.rs:1491— crates/crab-vfs/src/publish.rs:1491-1508 | crates/crab-vfs/src/publish.rs:1510-1528 — 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/crab-auth/src/managed/client.rs:1123— crates/crab-auth/src/managed/client.rs:1123-1140 | crates/crab-auth/src/managed/client.rs:1142-1159 — 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/crab-http-server/src/issues.rs:36— crates/crab-http-server/src/issues.rs:36-53 | crates/crab-http-server/src/pulls.rs:40-60 — 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/crab-http-server/src/cells/scheduler.rs:984— crates/crab-http-server/src/cells/scheduler.rs:984-1001 | crates/crab-http-server/src/cells/scheduler.rs:1017-1034 — 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/crab-vfs/src/refresh.rs:186— crates/crab-vfs/src/refresh.rs:186-205 | crates/crab-vfs/src/refresh.rs:207-224 — 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) crab/src/cmd/download.rs:487— crab/src/cmd/download.rs:487-504 | crab/src/cmd/export.rs:548-566 — 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) crab/src/lfs/track.rs:566— crab/src/lfs/track.rs:566-583 | crab/src/lfs/track.rs:623-642 — 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) crab/src/git/pack.rs:584— crab/src/git/pack.rs:584-604 | crab/src/git/pack.rs:1446-1463 — 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/crab-vfs/src/coordinator.rs:987— crates/crab-vfs/src/coordinator.rs:987-1006 | crates/crab-vfs/src/mounts_registry.rs:207-224 — 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) crab/deploy/auth-service/src/providers/azure.py:49— crab/deploy/auth-service/src/providers/azure.py:49-66 | crab/deploy/auth-service/src/providers/gcp.py:51-68 — 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.
+ 4 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×27
Edited copy of a member (16 corresponding lines) crates/crab-http-server/src/pulls.rs:658— crates/crab-http-server/src/pulls.rs:658-676 | crates/crab-http-server/src/pulls/reviews.rs:105-120 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crab/src/cmd/gc/journal.rs:620— crab/src/cmd/gc/journal.rs:620-640 | crab/src/cmd/gc/journal.rs:643-658 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crab/src/lfs/migrate.rs:1202— crab/src/lfs/migrate.rs:1202-1217 | crab/src/lfs/prune.rs:587-607 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-storage/src/store.rs:700— crates/crab-storage/src/store.rs:700-715 | crates/crab-storage/src/store.rs:1256-1275 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-staging/src/push_plan.rs:594— crates/crab-staging/src/push_plan.rs:594-609 | crates/crab-staging/src/push_plan.rs:815-830 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-auth/src/managed/profile.rs:177— crates/crab-auth/src/managed/profile.rs:177-192 | crates/crab-auth/src/token_cache.rs:170-185 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crab/src/cmd/status.rs:895— crab/src/cmd/status.rs:895-910 | crab/src/cmd/why.rs:226-241 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-http-server/src/assignees.rs:57— crates/crab-http-server/src/assignees.rs:57-74 | crates/crab-http-server/src/labels.rs:150-165 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-auth/src/managed/client.rs:1524— crates/crab-auth/src/managed/client.rs:1524-1539 | crates/crab-auth/src/managed/client.rs:1544-1559 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crab/src/cmd/worktree.rs:1405— crab/src/cmd/worktree.rs:1405-1420 | crates/crab-staging/src/lib.rs:833-850 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-coordination/src/cosmosdb_coordinator.rs:1352— crates/crab-coordination/src/cosmosdb_coordinator.rs:1352-1367 | crates/crab-coordination/src/spanner_coordinator.rs:1125-1140 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-vfs/src/engine.rs:1041— crates/crab-vfs/src/engine.rs:1041-1056 | crates/crab-vfs/src/nfs.rs:595-613 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crab/src/cmd/migrate.rs:2415— crab/src/cmd/migrate.rs:2415-2430 | crab/src/cmd/migrate.rs:2432-2450 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crab/src/metadata/metadb/stores/chunk_index.rs:644— crab/src/metadata/metadb/stores/chunk_index.rs:644-659 | crates/crab-metadata/src/remote_index.rs:400-415 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crab/src/cmd/metrics.rs:3803— crab/src/cmd/metrics.rs:3803-3818 | crab/src/cmd/params.rs:557-572 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-http-server/src/cells/repository/pulls.rs:685— crates/crab-http-server/src/cells/repository/pulls.rs:685-701 | crates/crab-http-server/src/cells/repository/releases.rs:893-908 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crab/src/cmd/push.rs:1214— crab/src/cmd/push.rs:1214-1231 | crab/src/cmd/ship.rs:313-328 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-vfs/src/mounts_registry.rs:258— crates/crab-vfs/src/mounts_registry.rs:258-273 | crates/crab-vfs/src/mounts_registry.rs:278-293 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-sdk/src/local.rs:460— crates/crab-sdk/src/local.rs:460-475 | crates/crab-sdk/src/local/push/git.rs:43-58 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-sdk/src/local/edit.rs:966— crates/crab-sdk/src/local/edit.rs:966-981 | crates/crab-sdk/src/local/edit.rs:1254-1273 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-vfs/src/refresh.rs:296— crates/crab-vfs/src/refresh.rs:296-313 | crates/crab-vfs/src/refresh.rs:954-969 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crab/src/cmd/lfs/fsck.rs:425— crab/src/cmd/lfs/fsck.rs:425-440 | crab/src/lfs/migrate.rs:2816-2831 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-staging/src/index.rs:1692— crates/crab-staging/src/index.rs:1692-1707 | crates/crab-staging/src/index.rs:1717-1732 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-http-server/deploy/cell-issue-fleet/fault.py:184— crates/crab-http-server/deploy/cell-issue-fleet/fault.py:184-200 | REDACTED:35-50 — These two members are one piece of code written twice and then edited apart: 16 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (16 corresponding lines) crates/crab-cache-server/src/onboarding.rs:498— crates/crab-cache-server/src/onboarding.rs:498-513 | crates/crab-cache-server/src/onboarding.rs:521-539 — 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.
+ 2 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (14 corresponding lines) · ×27
Edited copy of a member (14 corresponding lines) crates/crab-auth/src/token_cache.rs:447— crates/crab-auth/src/token_cache.rs:447-465 | crates/crab-cache-server/src/config.rs:410-423 — 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) crab/src/cmd/exp_queue.rs:1355— crab/src/cmd/exp_queue.rs:1355-1369 | crates/crab-workflow/src/cache.rs:471-484 — 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) crab/src/metadata/metadb/db.rs:793— crab/src/metadata/metadb/db.rs:793-807 | crab/src/metadata/metadb/db.rs:815-828 — 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) crab/scripts/generate_test_file.rs:287— crab/scripts/generate_test_file.rs:287-301 | crates/crab-workflow/src/cache.rs:115-128 — 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) crab/src/replication/mod.rs:5153— crab/src/replication/mod.rs:5153-5168 | crab/src/replication/mod.rs:5206-5219 — 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/crab-coordination/src/spanner_coordinator.rs:1369— crates/crab-coordination/src/spanner_coordinator.rs:1369-1382 | crates/crab-coordination/src/spanner_coordinator.rs:1388-1406 — 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/crab-write/src/journal.rs:577— crates/crab-write/src/journal.rs:577-598 | crates/crab-write/src/journal.rs:611-624 — 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/crab-http-server/src/cells/repository/pulls.rs:744— crates/crab-http-server/src/cells/repository/pulls.rs:744-757 | crates/crab-http-server/src/cells/repository/releases.rs:939-952 — 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) crab/src/cmd/metadb.rs:1977— crab/src/cmd/metadb.rs:1977-1990 | crab/src/cmd/metadb.rs:1995-2018 — 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) crab/src/cmd/push.rs:1131— crab/src/cmd/push.rs:1131-1144 | crab/src/cmd/push.rs:1150-1167 — 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/crab-workflow/src/exp_worktree.rs:1249— crates/crab-workflow/src/exp_worktree.rs:1249-1265 | crates/crab-workflow/src/params.rs:265-278 — 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/crab-http-server/src/git_import.rs:859— crates/crab-http-server/src/git_import.rs:859-872 | crates/crab-remote/src/local.rs:769-783 — 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) crab/src/cmd/mount.rs:2535— crab/src/cmd/mount.rs:2535-2548 | crab/src/cmd/mount.rs:2559-2574 — 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) crab/src/metadata/metadb/stores/chunk_index.rs:661— crab/src/metadata/metadb/stores/chunk_index.rs:661-674 | crab/src/metadata/metadb/stores/chunk_index.rs:676-690 — 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/crab-diff/src/chunk_sequence.rs:120— crates/crab-diff/src/chunk_sequence.rs:120-133 | crates/crab-diff/src/chunk_sequence.rs:135-148 — 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) crab/src/cmd/gc/marks.rs:343— crab/src/cmd/gc/marks.rs:343-358 | crab/src/cmd/gc/marks.rs:428-441 — 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/crab-xet/src/shard_parse.rs:541— crates/crab-xet/src/shard_parse.rs:541-554 | crates/crab-xet/src/shard_parse.rs:577-595 — 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) crab/src/storage/retry.rs:294— crab/src/storage/retry.rs:294-308 | crates/crab-storage/src/retry.rs:103-116 — 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/crab-auth/src/managed/client.rs:285— crates/crab-auth/src/managed/client.rs:285-298 | crates/crab-auth/src/managed/client.rs:401-419 — 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/crab-staging/src/push_plan.rs:297— crates/crab-staging/src/push_plan.rs:297-310 | crates/crab-staging/src/push_plan.rs:323-336 — 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/crab-http-server/src/server.rs:960— crates/crab-http-server/src/server.rs:960-973 | crates/crab-http-server/src/server.rs:975-988 — 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) crab/src/git/push.rs:6429— crab/src/git/push.rs:6429-6442 | crab/src/git/push.rs:6448-6462 — 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/crab-http-server/src/server.rs:882— crates/crab-http-server/src/server.rs:882-897 | crates/crab-http-server/src/server.rs:899-912 — 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) crab/src/core/credential_discovery.rs:237— crab/src/core/credential_discovery.rs:237-254 | crab/src/core/credential_discovery.rs:256-269 — 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/crab-cache/src/local_cache.rs:1092— crates/crab-cache/src/local_cache.rs:1092-1106 | crates/crab-cache/src/local_cache.rs:1108-1121 — 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.
+ 2 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (7 corresponding lines) · ×27
Edited copy of a member (7 corresponding lines) crates/crab-metadata/src/git_object_locator/reader.rs:884— crates/crab-metadata/src/git_object_locator/reader.rs:884-890 | crates/crab-metadata/src/git_object_locator/writer.rs:1752-1758 — 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) crab/src/tier/provider/s3.rs:151— crab/src/tier/provider/s3.rs:151-157 | crab/src/tier/provider/s3.rs:163-169 — 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) crab/src/cmd/replica.rs:1834— crab/src/cmd/replica.rs:1834-1845 | crab/src/cmd/replica.rs:2063-2069 — 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/crab-storage/src/store.rs:79— crates/crab-storage/src/store.rs:79-85 | crates/crab-vfs/src/hydration.rs:1458-1464 — 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/crab-workflow/src/artifact.rs:1572— crates/crab-workflow/src/artifact.rs:1572-1578 | crates/crab-workflow/src/artifact.rs:1580-1586 — 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/crab-vfs/src/ipc_server.rs:482— crates/crab-vfs/src/ipc_server.rs:482-489 | crates/crab-vfs/src/nfs_control.rs:1244-1250 — 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) crab/src/cmd/gc/bucket.rs:1074— crab/src/cmd/gc/bucket.rs:1074-1080 | crab/src/cmd/gc/mod.rs:1909-1915 — 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/crab-storage/src/observation.rs:201— crates/crab-storage/src/observation.rs:201-207 | crates/crab-storage/src/observation.rs:370-377 — 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) crab/src/cmd/recover.rs:3019— crab/src/cmd/recover.rs:3019-3025 | crates/crab-workflow/src/artifact.rs:1936-1943 — 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/crab-sdk/src/value.rs:159— crates/crab-sdk/src/value.rs:159-165 | crates/crab-sdk/src/value.rs:168-174 — 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/crab-metadata/src/git_visibility.rs:619— crates/crab-metadata/src/git_visibility.rs:619-625 | crates/crab-metadata/src/git_visibility.rs:1412-1418 — 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/crab-cache-server/src/cache_store.rs:1900— crates/crab-cache-server/src/cache_store.rs:1900-1907 | crates/crab-cache-server/src/chunk_index.rs:293-299 — 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) crab/src/cmd/replica.rs:8524— crab/src/cmd/replica.rs:8524-8530 | crab/src/cmd/replica.rs:8532-8538 — 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) crab/src/git/pack.rs:1428— crab/src/git/pack.rs:1428-1436 | crates/crab-vfs/src/hydration.rs:1466-1472 — 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) crab/src/git/filter_process.rs:1874— crab/src/git/filter_process.rs:1874-1880 | crab/src/git/filter_process.rs:1888-1897 — 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/crab-lfs/src/object_store.rs:729— crates/crab-lfs/src/object_store.rs:729-735 | crates/crab-metadata/src/ref_journal.rs:1005-1014 — 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/crab-auth/src/managed/client.rs:39— crates/crab-auth/src/managed/client.rs:39-47 | crates/crab-auth/src/managed/transfer.rs:21-27 — 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/crab-http-server/src/cells/repository/checks_codec.rs:161— crates/crab-http-server/src/cells/repository/checks_codec.rs:161-167 | crates/crab-http-server/src/cells/repository/codec.rs:182-188 — 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/crab-cache-server/src/chunk_index.rs:215— crates/crab-cache-server/src/chunk_index.rs:215-221 | crates/crab-vfs/src/overlay.rs:253-259 — 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) crab/src/replication/mod.rs:1800— crab/src/replication/mod.rs:1800-1806 | crates/crab-coordination/src/write_coordinator.rs:330-336 — 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) crab/src/replication/mod.rs:1882— crab/src/replication/mod.rs:1882-1888 | crates/crab-coordination/src/write_coordinator.rs:367-373 — 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/crab-sdk/src/archive.rs:44— crates/crab-sdk/src/archive.rs:44-53 | crates/crab-sdk/src/content.rs:37-43 — 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) crab/src/cmd/fsck_store.rs:1077— crab/src/cmd/fsck_store.rs:1077-1083 | crates/crab-storage/src/store.rs:2797-2803 — 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) crab/src/cmd/history_recovery.rs:1257— crab/src/cmd/history_recovery.rs:1257-1263 | crab/src/cmd/repack.rs:1042-1048 — 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) crab/src/cmd/repack.rs:897— crab/src/cmd/repack.rs:897-907 | crates/crab-cache/src/local_cache/maintenance.rs:341-347 — 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 (8 lines × 3) crab/src/auth/mod.rs:370— crab/src/auth/mod.rs:370-377 | crates/crab-auth-store/src/lib.rs:95-102 | crates/crab-auth-store/src/lib.rs:208-215 — 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 `crab/src/auth/mod.rs:370` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crab/src/auth/mod.rs:378` calls `Some`, `with_storage_scope` and `crates/crab-auth-store/src/lib.rs:216` 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) crab/src/cache/add_remote_candidates.rs:547— crab/src/cache/add_remote_candidates.rs:547-554 | crates/crab-staging/src/index.rs:3254-3261 | crates/crab-staging/src/index.rs:6562-6569 — 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 `crab/src/cache/add_remote_candidates.rs:547` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/exp.rs:2383— crab/src/cmd/exp.rs:2383-2390 | crab/src/cmd/migrate.rs:191-198 | crab/src/cmd/workflow_checkpoint.rs:798-805 — before extracting anything, compare `crab/src/cmd/exp.rs` and `crab/src/cmd/migrate.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/exp.rs:2383` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) crab/src/cmd/migrate.rs:1595— crab/src/cmd/migrate.rs:1595-1602 | crates/crab-cache-server/src/cache_store.rs:1951-1958 | crates/crab-workflow/src/stage_runtime.rs:408-415 — 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 `crab/src/cmd/migrate.rs:1595` 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 × 3) crab/src/cmd/stage/list.rs:313— crab/src/cmd/stage/list.rs:313-320 | crates/crab-workflow/src/gc.rs:115-122 | crates/crab-workflow/src/resume.rs:311-318 — 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 `crab/src/cmd/stage/list.rs:313` 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) crab/src/core/error.rs:2307— crab/src/core/error.rs:2307-2314 | crab/src/core/error.rs:2720-2727 | crab/src/core/error.rs:3014-3021 — 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, `crab/src/core/error.rs:3022` calls `GixConfig` and `crab/src/core/error.rs:2315` 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) crab/src/git/incremental_walk.rs:156— crab/src/git/incremental_walk.rs:156-163 | crab/src/git/incremental_walk.rs:292-300 | crab/src/git/push.rs:18350-18360 — before extracting anything, compare `crab/src/git/incremental_walk.rs` and `crab/src/git/push.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/incremental_walk.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 (8 lines × 3) crab/src/git/progress.rs:1437— crab/src/git/progress.rs:1437-1444 | crab/src/git/progress.rs:1481-1488 | crab/src/git/progress.rs:1547-1554 — 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 `crab/src/git/progress.rs:1437` 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, `crab/src/git/progress.rs:1489` calls `format_bytes` and `crab/src/git/progress.rs:1555` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) crates/crab-auth-server/src/receive/git_workspace.rs:1217— crates/crab-auth-server/src/receive/git_workspace.rs:1217-1224 | crates/crab-auth-server/src/view.rs:731-738 | crates/crab-auth/src/managed/transfer.rs:385-392 — 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/crab-auth-server/src/receive/git_workspace.rs:1217` it does not close everything it opens, so those exact lines 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/crab-git/src/repack.rs:284— crates/crab-git/src/repack.rs:284-291 | crates/crab-git/src/repack.rs:1066-1073 | crates/crab-git/src/repack.rs:1258-1265 — 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/crab-git/src/repack.rs:1062` calls `normalize_selected_oids` and `crates/crab-git/src/repack.rs:1254` 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/crab-http-server/src/cells/router.rs:683— crates/crab-http-server/src/cells/router.rs:683-690 | crates/crab-http-server/src/projection.rs:190-197 | crates/crab-http-server/src/projection.rs:241-248 — 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/crab-http-server/src/cells/router.rs:683` it begins part-way through the construct above it, so those exact lines 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/crab-sdk/src/client.rs:630— crates/crab-sdk/src/client.rs:630-637 | crates/crab-sdk/src/client.rs:764-771 | crates/crab-sdk/src/client.rs:794-801 — 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/crab-sdk/src/client.rs:630` it does not close everything it opens, so those exact lines 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/crab-workflow/src/artifact.rs:297— crates/crab-workflow/src/artifact.rs:297-304 | crates/crab-workflow/src/checkpoint.rs:78-85 | crates/crab-workflow/src/external_hash.rs:66-73 — before extracting anything, compare `crates/crab-workflow/src/artifact.rs` and `crates/crab-workflow/src/checkpoint.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-workflow/src/artifact.rs:297` it does not close everything it opens, so those 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/crab-workflow/src/artifact.rs:296` calls `ensure_parent_not_symlink` and `crates/crab-workflow/src/checkpoint.rs:77` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 3) crates/crab-workflow/src/exp_worktree.rs:1761— crates/crab-workflow/src/exp_worktree.rs:1761-1768 | crates/crab-workflow/src/exp_worktree.rs:1795-1802 | crates/crab-workflow/src/exp_worktree.rs:1823-1830 — 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/crab-workflow/src/exp_worktree.rs:1761` it does not close everything it opens, so those exact lines 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/crab-workflow/src/exp_worktree.rs:1875— crates/crab-workflow/src/exp_worktree.rs:1875-1882 | crates/crab-workflow/src/exp_worktree.rs:1909-1916 | crates/crab-workflow/src/exp_worktree.rs:1937-1944 — 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/crab-workflow/src/exp_worktree.rs:1875` it does not close everything it opens, so those exact lines 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/crab-http-server/src/cells.rs:1253— crates/crab-http-server/src/cells.rs:1253-1260 | crates/crab-http-server/src/cells/router.rs:1341-1348 | crates/crab-http-server/src/peer.rs:1786-1793 — 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. 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 × 3) crates/crab-write/src/generation.rs:715— crates/crab-write/src/generation.rs:715-722 | crates/crab-write/src/generation.rs:743-750 | crates/crab-write/src/generation.rs:928-935 — 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/crab-write/src/generation.rs:715` it begins part-way through the construct above it, so those exact lines 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/crab-cache-server/src/cache_store.rs:1355— crates/crab-cache-server/src/cache_store.rs:1355-1362 | crates/crab-cache-server/src/cache_store.rs:1474-1481 | crates/crab-cache-server/src/cache_store.rs:1585-1592 — 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) crab/src/cmd/exp.rs:4066— crab/src/cmd/exp.rs:4066-4073 | crab/src/cmd/run.rs:4097-4104 | REDACTED:246-253 — before extracting anything, compare `crab/src/cmd/run.rs` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crab/src/cmd/replica.rs:1821— crab/src/cmd/replica.rs:1821-1828 | crab/src/cmd/replica.rs:2884-2892 | crab/src/cmd/replica.rs:2934-2941 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) crates/crab-staging/src/index.rs:2289— crates/crab-staging/src/index.rs:2289-2296 | crates/crab-staging/src/index.rs:3076-3083 | crates/crab-staging/src/index.rs:3370-3377 — 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/crab-staging/src/index.rs:2289` it does not close everything it opens, so those exact lines 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) crab/src/cmd/lfs/dedup.rs:444— crab/src/cmd/lfs/dedup.rs:444-451 | crab/src/cmd/lfs/dedup.rs:949-956 | crab/src/cmd/lfs/dedup.rs:1042-1049 — 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 `crab/src/cmd/lfs/dedup.rs:444` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) crab/src/cmd/managed_admin.rs:437— crab/src/cmd/managed_admin.rs:437-444 | crab/src/cmd/managed_admin.rs:455-462 | crab/src/cmd/managed_admin.rs:473-480 — 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 `crab/src/cmd/managed_admin.rs:437` 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) crab/src/cmd/lfs/dedup.rs:415— crab/src/cmd/lfs/dedup.rs:415-422 | crab/src/cmd/lfs/dedup.rs:919-926 | crab/src/cmd/lfs/dedup.rs:1009-1016 — 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 `crab/src/cmd/lfs/dedup.rs:415` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/exp_queue.rs:1362— crab/src/cmd/exp_queue.rs:1362-1369 | crab/src/cmd/freeze.rs:389-396 | crab/src/cmd/stage/add.rs:437-444 — 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 `crab/src/cmd/exp_queue.rs:1362` 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, `crab/src/cmd/exp_queue.rs:1359` calls `create_dir_all`, `map_err` and `crab/src/cmd/freeze.rs:386` 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.
+ 2 more in this group — see findings.md.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×25
Edited copy of a member (11 corresponding lines) crab/src/cmd/metrics.rs:156— crab/src/cmd/metrics.rs:156-166 | crab/src/cmd/params.rs:90-100 — 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/crab-http-server/src/cells/repository/codec.rs:367— crates/crab-http-server/src/cells/repository/codec.rs:367-378 | crates/crab-http-server/src/cells/repository/codec.rs:609-619 — 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/crab-http-server/src/cells/repository/codec.rs:26— crates/crab-http-server/src/cells/repository/codec.rs:26-38 | crates/crab-http-server/src/cells/repository/codec.rs:52-62 — 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/crab-http-server/src/cells/repository/checks_codec.rs:239— crates/crab-http-server/src/cells/repository/checks_codec.rs:239-249 | crates/crab-http-server/src/cells/repository/codec.rs:531-543 — 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) crab/src/cmd/release.rs:390— crab/src/cmd/release.rs:390-405 | crab/src/cmd/release.rs:529-539 — 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/crab-auth-store/src/gateway_store.rs:246— crates/crab-auth-store/src/gateway_store.rs:246-256 | crates/crab-auth-store/src/refreshing_store.rs:290-301 — These two members are one piece of code written twice and then edited apart: 11 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (11 corresponding lines) crates/crab-workflow/src/lockfile.rs:601— crates/crab-workflow/src/lockfile.rs:601-619 | crates/crab-workflow/src/lockfile.rs:646-656 — 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/crab-http-server/src/checks.rs:707— crates/crab-http-server/src/checks.rs:707-717 | crates/crab-http-server/src/checks.rs:725-735 — 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/crab-metadata/src/receipts.rs:61— crates/crab-metadata/src/receipts.rs:61-71 | crates/crab-metadata/src/receipts.rs:75-85 — 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) crab/src/cmd/dag.rs:299— crab/src/cmd/dag.rs:299-309 | crab/src/cmd/dag.rs:311-322 — 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/crab-sdk/src/local/edit.rs:1105— crates/crab-sdk/src/local/edit.rs:1105-1115 | crates/crab-sdk/src/local/fetch/recovery.rs:76-87 — 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/crab-workflow/src/exp_worktree.rs:1192— crates/crab-workflow/src/exp_worktree.rs:1192-1202 | crates/crab-workflow/src/params.rs:339-349 — 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/crab-http-server/src/cells/repository.rs:896— crates/crab-http-server/src/cells/repository.rs:896-908 | crates/crab-http-server/src/cells/repository/pulls.rs:1536-1546 — 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) crab/src/cmd/exp.rs:3540— crab/src/cmd/exp.rs:3540-3550 | crab/src/cmd/exp.rs:5214-5224 — 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/crab-http-server/src/cells/repository/codec.rs:135— crates/crab-http-server/src/cells/repository/codec.rs:135-145 | crates/crab-http-server/src/cells/repository/codec.rs:425-435 — 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) crab/src/git/upload_pack_wire.rs:134— crab/src/git/upload_pack_wire.rs:134-144 | crab/src/git/upload_pack_wire.rs:146-156 — 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/crab-metadata/src/path_state.rs:224— crates/crab-metadata/src/path_state.rs:224-234 | crates/crab-metadata/src/split_commit_graph.rs:140-150 — 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) crab/src/cmd/metrics.rs:910— crab/src/cmd/metrics.rs:910-920 | crab/src/cmd/metrics.rs:926-936 — 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/crab-workflow/src/exp_range.rs:277— crates/crab-workflow/src/exp_range.rs:277-287 | crates/crab-workflow/src/hydra.rs:1265-1275 — 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/crab-cache/src/local_cache.rs:1266— crates/crab-cache/src/local_cache.rs:1266-1276 | crates/crab-cache/src/local_cache.rs:1283-1294 — 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/crab-http-server/src/cells/router.rs:452— crates/crab-http-server/src/cells/router.rs:452-462 | crates/crab-http-server/src/cells/router/replicas.rs:159-171 — 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/crab-coordination/src/active_active.rs:495— crates/crab-coordination/src/active_active.rs:495-507 | crates/crab-coordination/src/write_coordinator.rs:2372-2382 — 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/crab-vfs/src/resolver.rs:437— crates/crab-vfs/src/resolver.rs:437-448 | crates/crab-vfs/src/overlay.rs:1600-1610 — 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/crab-auth/src/token_cache.rs:494— crates/crab-auth/src/token_cache.rs:494-505 | crab/src/import/journal.rs:1367-1377 — 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/crab-coordination/src/active_active.rs:509— crates/crab-coordination/src/active_active.rs:509-519 | crates/crab-http-server/src/cells/repository.rs:813-823 — 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.
TooManyMethods: PushPipeline crab/src/git/push.rs:4022— TooManyMethods — 133 methods. The bar is 30 methods; this is 103 over it, 4.43× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: Metrics crab/src/core/metrics.rs:325— TooManyMethods — 127 methods. The bar is 30 methods; this is 97 over it, 4.23× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: Index crates/crab-staging/src/index.rs:258— TooManyMethods — 110 methods. The bar is 30 methods; this is 80 over it, 3.67× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: StagingArea crates/crab-staging/src/lib.rs:295— TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.63× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: Store crates/crab-storage/src/store.rs:99— TooManyMethods — 79 methods. The bar is 30 methods; this is 49 over it, 2.63× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: NativePushProgress crab/src/git/progress.rs:557— TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: VfsEngine crates/crab-vfs/src/engine.rs:1085— TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: Store crab/src/storage/store.rs:325— TooManyMethods — 55 methods. The bar is 30 methods; this is 25 over it, 1.83× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: LocalCache crates/crab-cache/src/local_cache.rs:181— TooManyMethods — 53 methods, declared across 2 files: src/local_cache.rs (47), local_cache/maintenance.rs (6). The bar is 30 methods; this is 23 over it, 1.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: CachingStore crates/crab-cache-store/src/lib.rs:131— TooManyMethods — 49 methods, declared across 2 files: src/lib.rs (39), src/xorb_read.rs (10). The bar is 30 methods; this is 19 over it, 1.63× 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. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: StagingAreaReadOnly crates/crab-staging/src/lib.rs:311— TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: OperationContext crates/crab-remote-git/src/operation.rs:172— TooManyMethods — 48 methods, declared across 2 files: src/operation.rs (47), src/repository.rs (1). The bar is 30 methods; this is 18 over it, 1.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. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: RepositoryCellRouter crates/crab-http-server/src/cells/router.rs:74— TooManyMethods — 47 methods, declared across 2 files: cells/router.rs (38), router/replicas.rs (9). The bar is 30 methods; this is 17 over it, 1.57× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RemoteGitRepository crates/crab-remote-git/src/repository.rs:275— TooManyMethods — 46 methods, declared across 2 files: src/repository.rs (28), src/pack.rs (18). The bar is 30 methods; this is 16 over it, 1.53× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: StoreLayout crates/crab-storage/src/layout.rs:77— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: CacheStore crates/crab-cache-server/src/cache_store.rs:356— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: LfsObjectStore crates/crab-lfs/src/object_store.rs:119— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: RemoteGitRuntime crates/crab-remote-git/src/runtime.rs:273— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: Coordinator crates/crab-vfs/src/coordinator.rs:204— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: Config crab/src/core/config.rs:1020— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: ManagedApiClient crates/crab-auth/src/managed/client.rs:137— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.17× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: CleanSession crab/src/git/clean.rs:1263— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: Verifier crab/scripts/verify-cache-service-smoke-report.py:81— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyMethods: GitObjectLocatorWriter crates/crab-metadata/src/git_object_locator/writer.rs:166— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
PushPipeline::try_apply_add_push_plans (cognitive 123) crab/src/git/push.rs:10673— PushPipeline::try_apply_add_push_plans has cognitive complexity 123 (threshold 15). Drivers by points: if/else 31 (67 pts), loops 17 (34 pts), match/switch 6 (18 pts), boolean chains 4 (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.
PushPipeline::upload_xorb_batch (cognitive 94) crab/src/git/push.rs:11835— PushPipeline::upload_xorb_batch has cognitive complexity 94 (threshold 15). Drivers by points: if/else 31 (60 pts), match/switch 8 (23 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushPipeline::verify_xorb_refs_with_committed_receipts (cognitive 80) crab/src/git/push.rs:9892— PushPipeline::verify_xorb_refs_with_committed_receipts has cognitive complexity 80 (threshold 15). Drivers by points: if/else 34 (56 pts), loops 10 (16 pts), boolean chains 5, match/switch 3 (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.
PushPipeline::post_success_cleanup (cognitive 78) crab/src/git/push.rs:15833— PushPipeline::post_success_cleanup has cognitive complexity 78 (threshold 15). Drivers by points: if/else 20 (51 pts), loops 6 (18 pts), match/switch 3 (6 pts), boolean chains 3 (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.
PushPipeline::pack_xorbs_with_output (cognitive 58) crab/src/git/push.rs:11460— PushPipeline::pack_xorbs_with_output has cognitive complexity 58 (threshold 15). Drivers by points: if/else 21 (44 pts), loops 5 (11 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.
PushPipeline::apply_decisions_with_sha_map (cognitive 54) crab/src/git/push.rs:7457— PushPipeline::apply_decisions_with_sha_map has cognitive complexity 54 (threshold 15). Drivers by points: if/else 29 (40 pts), loops 6 (8 pts), boolean chains 4, match/switch 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushPipeline::classify_chunks (cognitive 51) crab/src/git/push.rs:11167— PushPipeline::classify_chunks has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (33 pts), loops 9 (15 pts), match/switch 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushPipeline::upload_packs (cognitive 42) crab/src/git/push.rs:13183— PushPipeline::upload_packs has cognitive complexity 42 (threshold 15). Drivers by points: if/else 18 (30 pts), match/switch 3 (7 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushPipeline::evaluate_decisions_with_sha_map (cognitive 39) crab/src/git/push.rs:7262— PushPipeline::evaluate_decisions_with_sha_map has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 4 (13 pts), boolean chains 5, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushPipeline::upload_packed_xorb_stream (cognitive 36) crab/src/git/push.rs:12250— PushPipeline::upload_packed_xorb_stream has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 2 (6 pts), boolean chains 5, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushPipeline::build_shard_with_session (cognitive 35) crab/src/git/push.rs:12384— PushPipeline::build_shard_with_session has cognitive complexity 35 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 5, match/switch 2 (4 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushPipeline::verify_remote_file_index_candidates (cognitive 31) crab/src/git/push.rs:14645— PushPipeline::verify_remote_file_index_candidates has cognitive complexity 31 (threshold 15). Drivers by points: match/switch 5 (19 pts), loops 4 (8 pts), if/else 3 (4 pts) (nesting depth added 19). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
PushPipeline::commit_ref_journal (cognitive 29) crab/src/git/push.rs:8758— PushPipeline::commit_ref_journal has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 4, match/switch 3, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushPipeline::upload_shard_and_file_index (cognitive 28) crab/src/git/push.rs:12753— PushPipeline::upload_shard_and_file_index has cognitive complexity 28 (threshold 15). Drivers by points: if/else 17 (23 pts), match/switch 2 (3 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.
PushPipeline::validate_committed_chunk_candidates (cognitive 27) crab/src/git/push.rs:14222— PushPipeline::validate_committed_chunk_candidates has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4, match/switch 2 (4 pts), loops 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushPipeline::lookup_staging (cognitive 25) crab/src/git/push.rs:9598— PushPipeline::lookup_staging has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (19 pts), loops 3, match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushPipeline::execute_admitted (cognitive 21) crab/src/git/push.rs:16576— PushPipeline::execute_admitted has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, loops 1 (2 pts), match/switch 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PushPipeline::rebuild_push_commit_receipt (cognitive 19) crab/src/git/push.rs:7773— PushPipeline::rebuild_push_commit_receipt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (10 pts), loops 7, match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PushPipeline::materialize_active_active_manifest (cognitive 19) crab/src/git/push.rs:8445— PushPipeline::materialize_active_active_manifest has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 3 (8 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.
PushPipeline::execute_inner (cognitive 19) crab/src/git/push.rs:16401— PushPipeline::execute_inner has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PushPipeline::compute_git_object_locator_basis (cognitive 18) crab/src/git/push.rs:13541— PushPipeline::compute_git_object_locator_basis has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 3 (4 pts), match/switch 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PushPipeline::commit_metadb_and_warm_cache_with_guard (cognitive 18) crab/src/git/push.rs:15314— PushPipeline::commit_metadb_and_warm_cache_with_guard has cognitive complexity 18 (threshold 15). Drivers by points: loops 9 (10 pts), if/else 4 (8 pts) (nesting depth added 5). 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.
PushPipeline::head_check_resume_batch (cognitive 16) crab/src/git/push.rs:11724— PushPipeline::head_check_resume_batch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×23
Edited copy of a member (19 corresponding lines) crates/crab-coordination/src/push_lock.rs:1119— crates/crab-coordination/src/push_lock.rs:1119-1137 | crates/crab-coordination/src/push_lock.rs:1144-1162 — 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) crab/src/cache/add_validation.rs:240— crab/src/cache/add_validation.rs:240-258 | crab/src/cache/hydrated_pointer.rs:254-272 — 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) crab/src/cmd/metrics.rs:2620— crab/src/cmd/metrics.rs:2620-2642 | crab/src/cmd/metrics.rs:2644-2662 — 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) crab/src/cmd/metrics.rs:3775— crab/src/cmd/metrics.rs:3775-3801 | crab/src/cmd/params.rs:537-555 — 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) crab/src/cmd/lfs/push.rs:435— crab/src/cmd/lfs/push.rs:435-458 | crab/src/lfs/transfer_agent.rs:888-906 — 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/crab-storage/src/observation.rs:508— crates/crab-storage/src/observation.rs:508-529 | crates/crab-storage/src/observation.rs:534-552 — 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/crab-http-server/src/peer.rs:1365— crates/crab-http-server/src/peer.rs:1365-1384 | crates/crab-http-server/src/peer/node_log_client.rs:359-377 — 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/crab-remote-git/src/operation.rs:727— crates/crab-remote-git/src/operation.rs:727-745 | crates/crab-remote-git/src/operation.rs:912-930 — 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) crab/src/replication/mod.rs:9242— crab/src/replication/mod.rs:9242-9260 | crab/src/replication/mod.rs:9272-9291 — 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/crab-metadata/src/manifests.rs:330— crates/crab-metadata/src/manifests.rs:330-354 | crates/crab-metadata/src/segmented.rs:439-457 — 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) crab/src/cmd/run.rs:2399— crab/src/cmd/run.rs:2399-2418 | crab/src/cmd/run.rs:4371-4389 — 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) crab/src/cmd/exp.rs:5861— crab/src/cmd/exp.rs:5861-5880 | crab/src/cmd/exp.rs:6521-6539 — 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) crab/src/cmd/lfs/checkout.rs:341— crab/src/cmd/lfs/checkout.rs:341-360 | crab/src/lfs/extension.rs: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.
Edited copy of a member (19 corresponding lines) crates/crab-coordination/src/dynamodb_coordinator.rs:437— crates/crab-coordination/src/dynamodb_coordinator.rs:437-455 | crates/crab-coordination/src/dynamodb_coordinator.rs:482-503 — 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/crab-workflow/src/template/foreach.rs:169— crates/crab-workflow/src/template/foreach.rs:169-190 | crates/crab-workflow/src/template/matrix.rs:197-215 — 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/crab-http-server/src/branches.rs:390— crates/crab-http-server/src/branches.rs:390-408 | crates/crab-http-server/src/branches.rs:415-436 — 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/crab-cache-server/src/server.rs:338— crates/crab-cache-server/src/server.rs:338-361 | crates/crab-cache-server/src/server.rs:363-381 — 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) crab/src/replication/mod.rs:9309— crab/src/replication/mod.rs:9309-9327 | crab/src/replication/mod.rs:9334-9352 — 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) crab/src/cmd/gc/bucket.rs:245— crab/src/cmd/gc/bucket.rs:245-263 | crab/src/cmd/gc/mod.rs:436-456 — 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/crab-sdk/src/client/mutation.rs:988— crates/crab-sdk/src/client/mutation.rs:988-1008 | crates/crab-sdk/src/client/mutation.rs:1057-1075 — 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) crab/src/cmd/replica.rs:12107— crab/src/cmd/replica.rs:12107-12125 | crab/src/cmd/replica.rs:12144-12162 — 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) crab/src/git/smudge.rs:377— crab/src/git/smudge.rs:377-405 | crates/crab-vfs/src/hydration.rs:781-799 — 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/crab-coordination/src/write_coordinator.rs:1012— crates/crab-coordination/src/write_coordinator.rs:1012-1032 | crates/crab-coordination/src/write_coordinator.rs:1497-1515 — 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 (8 corresponding lines) · ×23
Edited copy of a member (8 corresponding lines) crates/crab-cache/src/private_fs.rs:52— crates/crab-cache/src/private_fs.rs:52-59 | crates/crab-cache/src/private_fs.rs:61-71 — 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) crab/src/cmd/exp_queue.rs:1164— crab/src/cmd/exp_queue.rs:1164-1171 | crab/src/cmd/exp_queue.rs:1299-1308 — 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/crab-cache/src/private_fs/windows.rs:180— crates/crab-cache/src/private_fs/windows.rs:180-190 | crates/crab-cache/src/private_fs/windows.rs:192-199 — 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) crab/src/cmd/mount.rs:2688— crab/src/cmd/mount.rs:2688-2695 | crates/crab-vfs/src/mount_control.rs:446-453 — 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) crab/src/git/push.rs:1630— crab/src/git/push.rs:1630-1637 | crates/crab-write/src/catalog.rs:93-100 — 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) crab/src/git/push.rs:1639— crab/src/git/push.rs:1639-1646 | crates/crab-read/src/upload_pack.rs:1260-1267 — 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/crab-http-server/src/cells/repository/checks_codec.rs:192— crates/crab-http-server/src/cells/repository/checks_codec.rs:192-199 | crates/crab-http-server/src/cells/repository/codec.rs:78-88 — 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/crab-remote-git/src/traversal.rs:152— crates/crab-remote-git/src/traversal.rs:152-159 | crates/crab-remote-git/src/traversal.rs:173-180 — 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/crab-metadata/src/ref_registry.rs:159— crates/crab-metadata/src/ref_registry.rs:159-166 | crates/crab-metadata/src/ref_registry.rs:178-186 — 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) crab/src/git/push_native.rs:883— crab/src/git/push_native.rs:883-893 | crab/src/git/remote_helper.rs:1735-1742 — 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/crab-auth/src/protected_push.rs:39— crates/crab-auth/src/protected_push.rs:39-47 | crates/crab-auth/src/credential_response.rs:28-35 — 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/crab-http-server/src/pulls/storage.rs:692— crates/crab-http-server/src/pulls/storage.rs:692-699 | crates/crab-http-server/src/pulls/merge.rs:79-88 — 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) crab/src/cmd/history_recovery.rs:141— crab/src/cmd/history_recovery.rs:141-148 | crab/src/cmd/release.rs:201-208 — 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/crab-coordination/src/dynamodb_coordinator.rs:396— crates/crab-coordination/src/dynamodb_coordinator.rs:396-403 | crates/crab-coordination/src/write_coordinator.rs:1837-1844 — 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/crab-http-server/src/cells/repository.rs:865— crates/crab-http-server/src/cells/repository.rs:865-872 | crates/crab-http-server/src/cells/repository/projection.rs:1097-1104 — 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) crab/src/git/incremental_walk.rs:534— crab/src/git/incremental_walk.rs:534-541 | crab/src/git/pack_native.rs:186-194 — 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) crab/src/replication/mod.rs:3901— crab/src/replication/mod.rs:3901-3911 | crates/crab-cache-server/src/evidence.rs:1838-1845 — 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/crab-http-server/src/cells/repository.rs:874— crates/crab-http-server/src/cells/repository.rs:874-881 | crates/crab-http-server/src/cells/repository/projection.rs:1115-1122 — 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) crab/src/import/journal.rs:1358— crab/src/import/journal.rs:1358-1365 | crab/src/optimize/xorbs/journal.rs:234-243 — 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/crab-metadata/src/file_index_lookup.rs:82— crates/crab-metadata/src/file_index_lookup.rs:82-89 | crates/crab-storage/src/store.rs:2827-2835 — 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/crab-sdk/src/client/mutation/native_content.rs:380— crates/crab-sdk/src/client/mutation/native_content.rs:380-387 | crates/crab-sdk/src/local/push/content.rs:249-256 — 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) crab/src/cmd/metrics.rs:1112— crab/src/cmd/metrics.rs:1112-1119 | crates/crab-workflow/src/sandbox.rs:235-242 — 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) crab/scripts/check-architecture-gates.py:2066— crab/scripts/check-architecture-gates.py:2066-2073 | crab/scripts/release/check-install-layout.py: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.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×22
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium CVE · ×22
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×22
Members sharing a duplicated core (4 members, 50+ identical tokens) crab/src/auth/mod.rs:281— crab/src/auth/mod.rs:281-382 | crates/crab-auth-store/src/lib.rs:41-133 | crates/crab-auth-store/src/lib.rs:203-217 | crates/crab-storage/src/provider_store.rs:487-499 — 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) crab/src/cmd/data.rs:1741— crab/src/cmd/data.rs:1741-1779 | crab/src/cmd/exp.rs:1865-1908 | crab/src/cmd/exp.rs:2294-2323 | crab/src/cmd/exp.rs:2398-2436 — 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) crab/src/cmd/dehydrate.rs:395— crab/src/cmd/dehydrate.rs:395-408 | crab/src/cmd/hydrate.rs:3477-3490 | crab/src/cmd/reset.rs:432-445 | crab/src/cmd/status.rs:654-667 — 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) crab/src/cmd/exp.rs:4256— crab/src/cmd/exp.rs:4256-4293 | crab/src/cmd/exp.rs:4498-4530 | crab/src/cmd/exp.rs:4756-4804 | crab/src/cmd/exp.rs:4849-4896 — 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) crab/src/cmd/exp.rs:5588— crab/src/cmd/exp.rs:5588-5675 | crab/src/cmd/metrics.rs:3526-3557 | crab/src/cmd/params.rs:371-402 | crates/crab-workflow/src/params_runtime.rs:504-534 — 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) crab/src/cmd/exp_queue.rs:892— crab/src/cmd/exp_queue.rs:892-908 | crab/src/cmd/exp_queue.rs:1019-1026 | crab/src/cmd/lfs/convert.rs:511-521 | crab/src/git/pack.rs:1912-1918 — 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) crab/src/cmd/fsck_store.rs:340— crab/src/cmd/fsck_store.rs:340-355 | crab/src/lfs/lock.rs:288-328 | crab/src/lfs/lock.rs:338-374 | crab/src/metadata/refs.rs:83-121 — 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) crab/src/cmd/metadb.rs:2692— crab/src/cmd/metadb.rs:2692-3115 | crab/src/git/push.rs:13183-13520 | crates/crab-auth-server/src/receive.rs:1504-1687 | crates/crab-auth-server/src/receive/git_workspace.rs:392-529 — 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) crab/src/speculation/access_db.rs:336— crab/src/speculation/access_db.rs:336-350 | crab/src/speculation/access_db.rs:353-367 | crab/src/speculation/access_db.rs:387-401 | crab/src/speculation/access_db.rs:404-418 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-auth/src/aws_oidc.rs:130— crates/crab-auth/src/aws_oidc.rs:130-152 | crates/crab-auth/src/azure_entra.rs:156-178 | crates/crab-auth/src/crab_auth_client.rs:442-464 | crates/crab-auth/src/gcp_federation.rs:186-208 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-auth/src/aws_oidc.rs:296— crates/crab-auth/src/aws_oidc.rs:296-322 | crates/crab-auth/src/azure_entra.rs:341-367 | crates/crab-auth/src/crab_auth_client.rs:582-608 | crates/crab-auth/src/gcp_federation.rs:334-360 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-auth/src/aws_oidc.rs:345— crates/crab-auth/src/aws_oidc.rs:345-355 | crates/crab-auth/src/azure_entra.rs:379-389 | crates/crab-auth/src/crab_auth_client.rs:620-630 | crates/crab-auth/src/gcp_federation.rs:376-386 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-cache/src/local_cache.rs:585— crates/crab-cache/src/local_cache.rs:585-595 | crates/crab-cache/src/local_cache.rs:623-637 | crates/crab-cache/src/local_cache.rs:640-652 | crates/crab-cache/src/local_cache.rs:779-790 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-http-server/src/cells/repository.rs:349— crates/crab-http-server/src/cells/repository.rs:349-430 | crates/crab-http-server/src/cells/repository/checks.rs:139-224 | crates/crab-http-server/src/cells/repository/checks.rs:239-329 | crates/crab-http-server/src/cells/repository/operations.rs:398-501 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-http-server/src/cells/repository/checks.rs:684— crates/crab-http-server/src/cells/repository/checks.rs:684-696 | crates/crab-http-server/src/cells/repository/pull_review_threads.rs:823-835 | crates/crab-http-server/src/cells/repository/pulls.rs:671-683 | crates/crab-http-server/src/cells/repository/releases.rs:841-853 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-http-server/src/cells/repository/checks.rs:801— crates/crab-http-server/src/cells/repository/checks.rs:801-811 | crates/crab-http-server/src/cells/repository/projection.rs:1124-1134 | crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1270-1280 | crates/crab-http-server/src/cells/repository/releases.rs:1156-1166 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-lfs/src/lock.rs:290— crates/crab-lfs/src/lock.rs:290-334 | crates/crab-lfs/src/lock.rs:350-382 | crates/crab-lfs/src/lock.rs:407-438 | crates/crab-lfs/src/lock.rs:470-500 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-staging/src/index.rs:2288— crates/crab-staging/src/index.rs:2288-2537 | crates/crab-staging/src/index.rs:4311-4461 | crates/crab-staging/src/index.rs:7842-7913 | crates/crab-staging/src/index.rs:8060-8313 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-staging/src/lib.rs:3158— crates/crab-staging/src/lib.rs:3158-3200 | crates/crab-staging/src/lib.rs:3277-3403 | crates/crab-staging/src/lib.rs:3514-3613 | crates/crab-staging/src/lib.rs:4200-4260 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-vfs/src/overlay.rs:309— crates/crab-vfs/src/overlay.rs:309-337 | crates/crab-vfs/src/overlay.rs:563-584 | crates/crab-vfs/src/overlay.rs:587-620 | crates/crab-vfs/src/overlay.rs:747-756 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-workflow/src/exp_worktree.rs:1152— crates/crab-workflow/src/exp_worktree.rs:1152-1171 | crates/crab-workflow/src/exp_worktree.rs:1173-1190 | crates/crab-workflow/src/params.rs:301-319 | crates/crab-workflow/src/params.rs:321-337 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/crab-xet/src/shard_parse.rs:295— crates/crab-xet/src/shard_parse.rs:295-371 | crates/crab-xet/src/shard_parse.rs:468-538 | crates/crab-xet/src/shard_parse.rs:602-689 | crates/crab-xet/src/shard_parse.rs:759-787 — 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 (22 corresponding lines) · ×22
Edited copy of a member (22 corresponding lines) crates/crab-vfs/src/nfs.rs:998— crates/crab-vfs/src/nfs.rs:998-1019 | crates/crab-vfs/src/nfs.rs:1140-1165 — 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/crab-staging/src/index.rs:506— crates/crab-staging/src/index.rs:506-545 | crates/crab-staging/src/index.rs:557-578 — 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/crab-workflow/src/yaml.rs:917— crates/crab-workflow/src/yaml.rs:917-938 | crates/crab-workflow/src/yaml.rs:944-965 — 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/crab-cache/src/local_cache.rs:518— crates/crab-cache/src/local_cache.rs:518-539 | crates/crab-cache/src/local_cache.rs:553-581 — 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/crab-vfs/src/nfs.rs:1079— crates/crab-vfs/src/nfs.rs:1079-1100 | crates/crab-vfs/src/nfs.rs:1108-1132 — 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/crab-http-server/src/cells/repository.rs:712— crates/crab-http-server/src/cells/repository.rs:712-733 | crates/crab-http-server/src/cells/repository/checks.rs:462-488 — 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) crab/src/cmd/recover.rs:2775— crab/src/cmd/recover.rs:2775-2796 | crab/src/cmd/release.rs:1088-1109 — 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/crab-http-server/src/metrics.rs:1751— crates/crab-http-server/src/metrics.rs:1751-1772 | crates/crab-s3-gateway/src/metrics.rs:770-798 — 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) crab/src/cmd/artifacts.rs:570— crab/src/cmd/artifacts.rs:570-591 | crab/src/cmd/lfs/locks.rs:616-640 — 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/crab-workflow/src/exp_worktree.rs:1822— crates/crab-workflow/src/exp_worktree.rs:1822-1843 | crates/crab-workflow/src/exp_worktree.rs:1936-1957 — 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/crab-auth/src/managed/client.rs:426— crates/crab-auth/src/managed/client.rs:426-447 | crates/crab-auth/src/managed/client.rs:499-527 — 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) crab/src/metadata/metadb/mod.rs:683— crab/src/metadata/metadb/mod.rs:683-704 | crab/src/metadata/metadb/mod.rs:707-728 — 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) crab/src/cmd/configure.rs:207— crab/src/cmd/configure.rs:207-229 | crab/src/cmd/configure.rs:231-252 — 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) crab/src/cmd/mount.rs:476— crab/src/cmd/mount.rs:476-497 | crab/src/cmd/mount.rs:1852-1874 — 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) crab/src/cmd/recover.rs:1345— crab/src/cmd/recover.rs:1345-1366 | crab/src/cmd/recover.rs:1404-1427 — 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) crab/src/cmd/lfs/fsck.rs:384— crab/src/cmd/lfs/fsck.rs:384-405 | crab/src/cmd/lfs/ls_files.rs:394-415 — 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) crab/src/import/assemble.rs:617— crab/src/import/assemble.rs:617-639 | crab/src/import/assemble.rs:643-664 — 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) crab/src/cmd/download.rs:517— crab/src/cmd/download.rs:517-538 | crab/src/cmd/export.rs:579-600 — 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) crab/src/cmd/replica.rs:8718— crab/src/cmd/replica.rs:8718-8739 | crab/src/cmd/replica.rs:9015-9039 — 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) crab/src/cmd/replica.rs:9041— crab/src/cmd/replica.rs:9041-9064 | crab/src/replication/mod.rs:9133-9154 — 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) crab/src/cmd/history_recovery.rs:1318— crab/src/cmd/history_recovery.rs:1318-1339 | crab/src/cmd/history_recovery.rs:1341-1365 — 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) crab/src/cmd/add.rs:1729— crab/src/cmd/add.rs:1729-1750 | crab/src/cmd/add.rs:1763-1785 — 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.
Weak hash algorithm crab/src/git/pack.rs:1197— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-git/src/incoming_pack.rs:522— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-git/src/incoming_pack.rs:554— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-git/src/incoming_pack/prepared.rs:346— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-git/src/incoming_pack/prepared.rs:612— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-git/src/pack.rs:158— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-git/src/pack.rs:936— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-git/src/pack_locator.rs:206— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-git/src/pack_locator.rs:817— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-git/src/pack_locator.rs:958— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-git/src/repack.rs:840— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-remote-git/src/pack.rs:58— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-remote-git/src/pack.rs:2743— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-remote-git/src/reader.rs:2422— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-s3-gateway/src/content.rs:77— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-s3-gateway/src/content.rs:78— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-s3-gateway/src/gateway.rs:2558— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-s3-gateway/src/gateway.rs:3652— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-s3-gateway/src/gateway.rs:4614— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-s3-gateway/src/gateway.rs:4635— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-s3-gateway/src/mutation.rs:2472— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm crates/crab-workflow/src/dvc_inventory.rs:2330— 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.
X5 · Nullable reference types· Symbol treated as nullable, then dereferenced unguarded · ×22
Symbol treated as nullable, then dereferenced unguarded crates/crab-workflow/src/stage_runtime.rs:771— `TcpListener::bind("127.0.0.1:0")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_n` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-workflow/src/stage_runtime.rs:772— `listener.local_addr()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_n` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-workflow/src/stage_runtime.rs:775— `listener.accept()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_n` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-workflow/src/stage_runtime.rs:782— `stream.write_all(head.as_bytes())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_n` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-workflow/src/stage_runtime.rs:783— `stream.write_all(body)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_n` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-workflow/src/stage_runtime.rs:794— `TcpListener::bind("127.0.0.1:0")` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_with_etag` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-workflow/src/stage_runtime.rs:795— `listener.local_addr()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_with_etag` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-workflow/src/stage_runtime.rs:800— `listener.accept()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_with_etag` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-workflow/src/stage_runtime.rs:809— `stream.write_all(head.as_bytes())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_with_etag` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-workflow/src/stage_runtime.rs:811— `stream.write_all(body)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `serve_http_body_with_etag` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-cache/src/cache_client/completed_body.rs:92— `` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-cache/src/cache_client/completed_body.rs:93— `listener.local_addr()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-cache/src/cache_client/completed_body.rs:95— `` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-cache/src/cache_client/completed_body.rs:97— `` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-cache/src/cache_client/completed_body.rs:101— `` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-cache/src/cache_client/completed_body.rs:102— `` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-cache/src/cache_client/completed_body.rs:111— `CacheClient::new(&format!("http://{address}"),&CacheServiceAuth::None,None,None,None,)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-cache/src/cache_client/completed_body.rs:115— `` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-cache/src/cache_client/completed_body.rs:116— `.unwrap()` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-cache/src/cache_client/completed_body.rs:117— `` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `response` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crates/crab-cache/src/cache_client/completed_body.rs:123— `CacheCatalog::read_only_stats(cache.root())` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.unwrap()` in `reserved` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Symbol treated as nullable, then dereferenced unguarded crab/src/auth/gix_credentials_adapter.rs:281— `gix_config::File::from_str(text)` can be absent — it is an `Option` or `Result`, which is why it is forced — and `.expect()` in `cfg` forces it with nothing on this path excluding `None`/`Err`: no `if let` or `match` arm that matched it present, no `let … else`, no `is_some()`/`is_ok()` test (or `is_none()`/`is_err()` test that leaves), no `assert!` of it, and for a lookup no proof the key or index exists. This line panics the first time the value is not there. Handle the absent case where it arises: propagate it with `?`, branch on it with `if let` / `match` / `let … else`, or give it a default (`unwrap_or`, `unwrap_or_default`, `unwrap_or_else`).
Duplicated block (7 lines × 3) crab/src/cmd/clone.rs:1168— crab/src/cmd/clone.rs:1168-1174 | crab/src/cmd/exp_queue.rs:1185-1191 | crab/src/cmd/exp_queue.rs:1252-1258 — 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 `crab/src/cmd/clone.rs:1168` 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 × 3) crab/src/cmd/exp.rs:3939— crab/src/cmd/exp.rs:3939-3945 | crab/src/cmd/exp.rs:4198-4204 | crab/src/cmd/recover.rs:2823-2829 — 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 `crab/src/cmd/exp.rs:3939` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crab/src/cmd/metrics.rs:1800— crab/src/cmd/metrics.rs:1800-1806 | crab/src/cmd/metrics.rs:1855-1861 | crab/src/cmd/metrics.rs:1908-1914 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) crab/src/git/connectivity.rs:83— crab/src/git/connectivity.rs:83-89 | crates/crab-vfs/src/engine.rs:179-185 | crates/crab-vfs/src/snapshot.rs:558-564 — 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. 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 × 3) crates/crab-cache-server/src/cache_store.rs:501— crates/crab-cache-server/src/cache_store.rs:501-507 | crates/crab-cache-server/src/cache_store.rs:526-532 | crates/crab-cache-server/src/cache_store.rs:560-566 — 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/crab-cache-server/src/cache_store.rs:501` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/crab-http-server/src/peer.rs:581— crates/crab-http-server/src/peer.rs:581-587 | crates/crab-http-server/src/peer.rs:604-610 | crates/crab-http-server/src/peer.rs:629-635 — 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/crab-http-server/src/peer.rs:581` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/crab-staging/src/lib.rs:3171— crates/crab-staging/src/lib.rs:3171-3177 | crates/crab-staging/src/lib.rs:4213-4219 | crates/crab-staging/src/lib.rs:4230-4236 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) crates/crab-vfs/src/nfs.rs:999— crates/crab-vfs/src/nfs.rs:999-1005 | crates/crab-vfs/src/nfs.rs:1027-1033 | crates/crab-vfs/src/nfs.rs:1063-1069 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) crates/crab-xet/src/shard_parse.rs:309— crates/crab-xet/src/shard_parse.rs:309-315 | crates/crab-xet/src/shard_parse.rs:482-488 | crates/crab-xet/src/shard_parse.rs:625-631 — 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/crab-xet/src/shard_parse.rs:309` 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 × 3) crates/crab-remote-git/src/pack.rs:652— crates/crab-remote-git/src/pack.rs:652-658 | crates/crab-remote-git/src/pack.rs:898-904 | crates/crab-remote-git/src/pack.rs:1063-1069 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) crab/src/tier/provider/azure.rs:480— crab/src/tier/provider/azure.rs:480-486 | crab/src/tier/provider/gcs.rs:455-461 | crab/src/tier/provider/s3.rs:910-917 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crab/src/tier/provider/gcs.rs:466` calls `is_gcs_not_found`, `Response` and `crab/src/tier/provider/azure.rs:489` 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/crab-http-server/src/cells/repository/pull_review_threads.rs:1242— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1242-1248 | crates/crab-http-server/src/cells/repository/pulls.rs:845-851 | crates/crab-http-server/src/cells/repository/releases.rs:1138-1144 — before extracting anything, compare `crates/crab-http-server/src/cells/repository/pull_review_threads.rs` and `crates/crab-http-server/src/cells/repository/pulls.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/crab-http-server/src/git.rs:64— crates/crab-http-server/src/git.rs:64-70 | crates/crab-http-server/src/lfs.rs:90-96 | crates/crab-http-server/src/receive.rs:100-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) crab/src/cost/inventory/live.rs:237— crab/src/cost/inventory/live.rs:237-243 | crab/src/tier/plan.rs:106-112 | crab/src/tier/plan.rs:115-121 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 3) crates/crab-staging/src/index.rs:1098— crates/crab-staging/src/index.rs:1098-1104 | crates/crab-staging/src/index.rs:5034-5040 | crates/crab-staging/src/index.rs:7182-7190 — 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/crab-staging/src/index.rs:1098` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/crab-staging/src/index.rs:1095— crates/crab-staging/src/index.rs:1095-1101 | crates/crab-staging/src/index.rs:5029-5037 | crates/crab-staging/src/index.rs:6012-6020 — 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/crab-staging/src/index.rs:1095` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crab/src/cmd/mount.rs:3936— crab/src/cmd/mount.rs:3936-3942 | crates/crab-vfs/src/ipc_client.rs:293-299 | crates/crab-vfs/src/mounts_registry.rs:63-69 — 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 `crab/src/cmd/mount.rs:3936` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crab/src/cmd/exp.rs:2907— crab/src/cmd/exp.rs:2907-2913 | crab/src/cmd/exp.rs:5815-5821 | crab/src/cmd/exp.rs:5835-5841 — 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 `crab/src/cmd/exp.rs:2907` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) crates/crab-workflow/src/params.rs:895— crates/crab-workflow/src/params.rs:895-901 | crates/crab-workflow/src/params.rs:948-954 | crates/crab-workflow/src/params.rs:984-990 — 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/crab-workflow/src/params.rs:895` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `&serde_yaml::Value` in one and `&serde_json::Value` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 3) crab/src/cmd/exp.rs:2881— crab/src/cmd/exp.rs:2881-2887 | crab/src/cmd/exp.rs:4092-4098 | crates/crab-workflow/src/exp_worktree.rs:448-454 — 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 `crab/src/cmd/exp.rs:2881` 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 × 3) crab/src/cmd/gc/bucket.rs:1512— crab/src/cmd/gc/bucket.rs:1512-1518 | crab/src/cmd/gc/bucket.rs:1655-1661 | crab/src/cmd/gc/bucket.rs:1719-1725 — 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, `crab/src/cmd/gc/bucket.rs:1511` calls `global_content_prefix` and `crab/src/cmd/gc/bucket.rs:1654` 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.
crab_http_server::api::execute (cognitive 64) crates/crab-http-server/src/api.rs:468— crab_http_server::api::execute has cognitive complexity 64 (threshold 15). Drivers by points: if/else 19 (39 pts), loops 4 (14 pts), match/switch 5 (8 pts), boolean chains 3 (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.
crab_http_server::peer::dispatch_forwarded_request (cognitive 40) crates/crab-http-server/src/peer.rs:968— crab_http_server::peer::dispatch_forwarded_request has cognitive complexity 40 (threshold 15). Drivers by points: if/else 16 (22 pts), match/switch 9 (15 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.
crab_http_server::cells::release_migrations_at (cognitive 34) crates/crab-http-server/src/cells.rs:1077— crab_http_server::cells::release_migrations_at has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_http_server::receive::publish::publish_attempt (cognitive 31) crates/crab-http-server/src/receive/publish.rs:434— crab_http_server::receive::publish::publish_attempt has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 6, match/switch 4 (6 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
crab_http_server::cells::scheduler::recover_node_session (cognitive 30) crates/crab-http-server/src/cells/scheduler.rs:1190— crab_http_server::cells::scheduler::recover_node_session has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 9 (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.
crab_http_server::api::read (cognitive 29) crates/crab-http-server/src/api.rs:189— crab_http_server::api::read has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (17 pts), match/switch 5 (9 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
crab_http_server::git::upload_pack (cognitive 29) crates/crab-http-server/src/git.rs:212— crab_http_server::git::upload_pack has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (10 pts), boolean chains 2, match/switch 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_http_server::server::boundary_request (cognitive 27) crates/crab-http-server/src/server.rs:2263— crab_http_server::server::boundary_request has cognitive complexity 27 (threshold 15). Drivers by points: boolean chains 14, if/else 11, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
crab_http_server::pulls::edit (cognitive 25) crates/crab-http-server/src/pulls.rs:538— crab_http_server::pulls::edit has cognitive complexity 25 (threshold 15). Drivers by points: boolean chains 13, if/else 12. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
crab_http_server::server::serve (cognitive 25) crates/crab-http-server/src/server.rs:1074— crab_http_server::server::serve has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 9 (10 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.
crab_http_server::cells::verify_cell_inventory (cognitive 24) crates/crab-http-server/src/cells.rs:2032— crab_http_server::cells::verify_cell_inventory has cognitive complexity 24 (threshold 15). Drivers by points: loops 5 (12 pts), if/else 2 (7 pts), match/switch 1 (5 pts) (nesting depth added 16). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
crab_http_server::server::sweep_projections (cognitive 24) crates/crab-http-server/src/server.rs:1789— crab_http_server::server::sweep_projections has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 3 (8 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_http_server::git_import::normalize_source (cognitive 23) crates/crab-http-server/src/git_import.rs:912— crab_http_server::git_import::normalize_source has cognitive complexity 23 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 8 (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.
crab_http_server::pulls::merge::execute (cognitive 23) crates/crab-http-server/src/pulls/merge.rs:248— crab_http_server::pulls::merge::execute has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 4, match/switch 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_http_server::pulls::merge_tree::merge_base (cognitive 22) crates/crab-http-server/src/pulls/merge_tree.rs:68— crab_http_server::pulls::merge_tree::merge_base has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_http_server::pulls::merge::finish (cognitive 21) crates/crab-http-server/src/pulls/merge.rs:140— crab_http_server::pulls::merge::finish has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
crab_http_server::cells::repository::projection::attribution (cognitive 20) crates/crab-http-server/src/cells/repository/projection.rs:406— crab_http_server::cells::repository::projection::attribution has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_http_server::peer::cgroup_memory_paths (cognitive 20) crates/crab-http-server/src/peer.rs:1594— crab_http_server::peer::cgroup_memory_paths has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (6 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.
crab_http_server::receive::receive (cognitive 18) crates/crab-http-server/src/receive.rs:328— crab_http_server::receive::receive has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
crab_http_server::git::write_refs (cognitive 17) crates/crab-http-server/src/git.rs:417— crab_http_server::git::write_refs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×20
Edited copy of a member (6 corresponding lines) crates/crab-coordination/src/push_admission.rs:512— crates/crab-coordination/src/push_admission.rs:512-517 | crates/crab-coordination/src/read_admission.rs:178-183 — 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) REDACTED:2606— REDACTED:2606-2611 | crates/crab-workflow/src/hasher.rs:493-498 — 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) crab/src/core/config.rs:1806— crab/src/core/config.rs:1806-1814 | crab/src/core/config.rs:1818-1823 — 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/crab-staging/src/lib.rs:335— crates/crab-staging/src/lib.rs:335-341 | crates/crab-workflow/src/scheduler_lock.rs:245-250 — 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) crab/src/lfs/migrate.rs:2757— crab/src/lfs/migrate.rs:2757-2762 | crab/src/lfs/migrate.rs:2764-2771 — 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/crab-http-server/deploy/cell-issue-fleet/qualify_reader_retention.py:19— crates/crab-http-server/deploy/cell-issue-fleet/qualify_reader_retention.py:19-24 | REDACTED:207-229 — 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/crab-cache-server/src/server.rs:331— crates/crab-cache-server/src/server.rs:331-336 | crates/crab-http-server/src/peer_tls.rs:473-478 — 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/crab-vfs/src/nfs.rs:630— crates/crab-vfs/src/nfs.rs:630-635 | crates/crab-vfs/src/read_lease_pool.rs:225-230 — 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/crab-sdk/src/local.rs:483— crates/crab-sdk/src/local.rs:483-488 | crates/crab-sdk/src/managed.rs:265-272 — 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/crab-coordination/src/cosmosdb_coordinator.rs:135— crates/crab-coordination/src/cosmosdb_coordinator.rs:135-140 | crates/crab-coordination/src/spanner_coordinator.rs:128-133 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/crab-metadata/src/git_visibility.rs:1452— crates/crab-metadata/src/git_visibility.rs:1452-1457 | crates/crab-metadata/src/ref_journal.rs:1174-1182 — 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/crab-auth/src/protected_push.rs:242— crates/crab-auth/src/protected_push.rs:242-247 | crates/crab-cache/src/clean.rs:111-116 — 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/crab-sdk/src/local.rs:318— crates/crab-sdk/src/local.rs:318-323 | crates/crab-sdk/src/local/edit.rs:492-497 — 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) crab/src/cmd/stage/list.rs:266— crab/src/cmd/stage/list.rs:266-271 | crates/crab-workflow/src/params_runtime.rs:212-218 — 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/crab-cache-server/src/evidence.rs:1793— crates/crab-cache-server/src/evidence.rs:1793-1798 | REDACTED:2629-2634 — 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) crab/src/cmd/metrics.rs:1203— crab/src/cmd/metrics.rs:1203-1208 | crab/src/cmd/replica.rs:3423-3430 — 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/crab-workflow/src/exp_worktree.rs:1204— crates/crab-workflow/src/exp_worktree.rs:1204-1209 | crates/crab-workflow/src/params.rs:351-357 — 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) crab/src/cmd/metrics.rs:4121— crab/src/cmd/metrics.rs:4121-4126 | crab/src/cmd/params.rs:779-784 — 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) crab/src/lfs/migrate.rs:374— crab/src/lfs/migrate.rs:374-381 | crates/crab-workflow/src/hydra.rs:698-703 — 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/crab-s3-gateway/src/metrics/filesystem.rs:184— crates/crab-s3-gateway/src/metrics/filesystem.rs:184-191 | crates/crab-xet/src/xorb/builder.rs:256-261 — 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.
crab_workflow::executor::run_inner (cyclomatic 53) REDACTED:310— crab_workflow::executor::run_inner 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.
crab_workflow::dvc_inventory::verify_output (cyclomatic 41) crates/crab-workflow/src/dvc_inventory.rs:1826— crab_workflow::dvc_inventory::verify_output 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.
crab_workflow::dvc_inventory::inventory_project (cyclomatic 31) crates/crab-workflow/src/dvc_inventory.rs:536— crab_workflow::dvc_inventory::inventory_project 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.
crab_workflow::dvc_inventory::parse_config (cyclomatic 25) crates/crab-workflow/src/dvc_inventory.rs:1627— crab_workflow::dvc_inventory::parse_config 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.
crab_workflow::dvc_inventory::parse_pipeline_outputs (cyclomatic 23) crates/crab-workflow/src/dvc_inventory.rs:1003— crab_workflow::dvc_inventory::parse_pipeline_outputs 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.
crab_workflow::dvc_inventory::apply_lock_output_metadata (cyclomatic 22) crates/crab-workflow/src/dvc_inventory.rs:1376— crab_workflow::dvc_inventory::apply_lock_output_metadata 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.
crab_workflow::artifact::visit_reachable_remote_artifact_objects (cyclomatic 20) crates/crab-workflow/src/artifact.rs:769— crab_workflow::artifact::visit_reachable_remote_artifact_objects 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.
crab_workflow::executor::verify_and_hash_outs (cyclomatic 20) REDACTED:1167— crab_workflow::executor::verify_and_hash_outs 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.
crab_workflow::source::validate_descriptor (cyclomatic 20) crates/crab-workflow/src/source.rs:98— crab_workflow::source::validate_descriptor has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
crab_workflow::stage_runtime::hash_object_store_location (cyclomatic 20) crates/crab-workflow/src/stage_runtime.rs:528— crab_workflow::stage_runtime::hash_object_store_location 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.
crab_workflow::cache::pull_remote_with_artifact_stores (cyclomatic 19) crates/crab-workflow/src/cache.rs:1090— crab_workflow::cache::pull_remote_with_artifact_stores has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab_workflow::hydra::split_resolver_args (cyclomatic 19) crates/crab-workflow/src/hydra.rs:1197— crab_workflow::hydra::split_resolver_args has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab_workflow::yaml::stage_from_raw (cyclomatic 19) crates/crab-workflow/src/yaml.rs:1219— crab_workflow::yaml::stage_from_raw has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
crab_workflow::cache::push_all_local_with_artifact_stores_and_cancel (cyclomatic 18) crates/crab-workflow/src/cache.rs:1357— crab_workflow::cache::push_all_local_with_artifact_stores_and_cancel 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.
crab_workflow::dvc_inventory::parse_pointer (cyclomatic 18) crates/crab-workflow/src/dvc_inventory.rs:834— crab_workflow::dvc_inventory::parse_pointer has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
crab_workflow::executor::resolve_dep_hashes_with_wdir_allow_missing_remote_aliases (cyclomatic 17) REDACTED:2432— crab_workflow::executor::resolve_dep_hashes_with_wdir_allow_missing_remote_aliases 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.
crab_workflow::artifact::validate_remote_envelope (cyclomatic 16) crates/crab-workflow/src/artifact.rs:1307— crab_workflow::artifact::validate_remote_envelope 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.
crab_workflow::hydra::find_interpolation_end (cyclomatic 16) crates/crab-workflow/src/hydra.rs:890— crab_workflow::hydra::find_interpolation_end 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.
crab_workflow::resume::decide (cyclomatic 16) crates/crab-workflow/src/resume.rs:80— crab_workflow::resume::decide has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×19
Edited copy of a member (21 corresponding lines) crab/src/cmd/run.rs:4075— crab/src/cmd/run.rs:4075-4095 | crab/src/main.rs:5842-5868 — 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) crab/src/cmd/adopt.rs:707— crab/src/cmd/adopt.rs:707-737 | crab/src/cmd/unadopt.rs:313-333 — 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) crab/deploy/auth-service/src/receive_helper.py:192— crab/deploy/auth-service/src/receive_helper.py:192-216 | crab/deploy/auth-service/src/view_helper.py:91-111 — 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) crab/src/cmd/metrics.rs:3192— crab/src/cmd/metrics.rs:3192-3212 | crab/src/cmd/metrics.rs:3293-3320 — 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) crab/src/replication/mod.rs:5260— crab/src/replication/mod.rs:5260-5282 | crab/src/replication/mod.rs:5287-5307 — 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) crab/src/cmd/worktree.rs:995— crab/src/cmd/worktree.rs:995-1015 | crab/src/cmd/worktree.rs:1017-1039 — 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) crab/src/replication/mod.rs:2411— crab/src/replication/mod.rs:2411-2431 | crates/crab-coordination/src/cosmosdb_coordinator.rs:866-887 — 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) crab/src/cmd/lfs/locks.rs:449— crab/src/cmd/lfs/locks.rs:449-480 | crab/src/cmd/lfs/locks.rs:482-502 — 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) crab/src/diff/format_hint.rs:183— crab/src/diff/format_hint.rs:183-203 | crab/src/diff/format_hint.rs:315-338 — 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) crab/src/cmd/install.rs:390— crab/src/cmd/install.rs:390-410 | crab/src/cmd/lfs/install.rs:465-485 — 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/crab-workflow/src/exp_range.rs:311— crates/crab-workflow/src/exp_range.rs:311-333 | crates/crab-workflow/src/template/matrix.rs:145-165 — 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/crab-vfs/src/daemon.rs:1946— crates/crab-vfs/src/daemon.rs:1946-1966 | crates/crab-vfs/src/pipeline.rs:690-710 — 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/crab-read/src/term_resolver.rs:429— crates/crab-read/src/term_resolver.rs:429-450 | crates/crab-read/src/term_resolver.rs:457-477 — 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) crab/src/main.rs:3003— crab/src/main.rs:3003-3029 | crates/crab-s3-gateway/src/server.rs:461-481 — 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/crab-coordination/src/write_coordinator.rs:845— crates/crab-coordination/src/write_coordinator.rs:845-867 | crates/crab-coordination/src/write_coordinator.rs:1341-1361 — 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/crab-remote-git/src/runtime.rs:791— crates/crab-remote-git/src/runtime.rs:791-811 | crates/crab-remote-git/src/runtime.rs:824-849 — 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) crab/src/cmd/mount.rs:352— crab/src/cmd/mount.rs:352-376 | crab/src/cmd/mount.rs:383-403 — 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/crab-remote-git/src/objects.rs:336— crates/crab-remote-git/src/objects.rs:336-356 | crates/crab-remote-git/src/reader.rs:2118-2139 — 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) crab/src/cmd/exp.rs:6557— crab/src/cmd/exp.rs:6557-6577 | crab/src/cmd/exp.rs:6579-6599 — 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.
Duplicated block (6 lines × 3) crab/src/cmd/adopt.rs:209— crab/src/cmd/adopt.rs:209-214 | crab/src/cmd/setup.rs:315-320 | crab/src/cmd/setup.rs:385-390 — before extracting anything, compare `crab/src/cmd/adopt.rs` and `crab/src/cmd/setup.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crab/src/cmd/du.rs:168— crab/src/cmd/du.rs:168-173 | crab/src/cmd/ls_files.rs:107-112 | crates/crab-auth/src/token_cache.rs:224-229 — before extracting anything, compare `crab/src/cmd/du.rs` and `crab/src/cmd/ls_files.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/du.rs:168` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crab/src/cmd/du.rs:167` calls `Err`, `kind`, `Ok` and `crab/src/cmd/ls_files.rs:106` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 3) crab/src/cmd/exp.rs:4079— crab/src/cmd/exp.rs:4079-4084 | crab/src/cmd/recover.rs:2778-2783 | crab/src/cmd/release.rs:1091-1096 — 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 `crab/src/cmd/exp.rs:4079` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/exp.rs:4815— crab/src/cmd/exp.rs:4815-4820 | crab/src/cmd/metrics.rs:1541-1546 | crab/src/cmd/metrics.rs:3371-3376 — before extracting anything, compare `crab/src/cmd/exp.rs` and `crab/src/cmd/metrics.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/exp.rs:4815` it begins part-way through the construct above it, so those 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) crab/src/cmd/metrics.rs:4091— crab/src/cmd/metrics.rs:4091-4096 | crab/src/cmd/params.rs:749-754 | crates/crab-workflow/src/params_runtime.rs:822-829 — before extracting anything, compare `crab/src/cmd/metrics.rs` and `crab/src/cmd/params.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 89 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 `crab/src/cmd/metrics.rs:4091` it does not close everything it opens, so those exact lines 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) crab/src/git/incremental_walk.rs:173— crab/src/git/incremental_walk.rs:173-178 | crab/src/git/pack_native.rs:118-123 | crab/src/lfs/prune.rs:798-804 — 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 `crab/src/git/incremental_walk.rs:173` 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) crab/src/import/assemble.rs:443— crab/src/import/assemble.rs:443-448 | crab/src/import/assemble.rs:1063-1068 | crab/src/import/assemble.rs:1079-1084 — 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 `crab/src/import/assemble.rs:443` it begins part-way through the construct above it, so those 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) crates/crab-lfs/src/lock.rs:367— crates/crab-lfs/src/lock.rs:367-372 | crates/crab-lfs/src/lock.rs:427-432 | crates/crab-lfs/src/lock.rs:487-492 — 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/crab-lfs/src/lock.rs:367` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 3) crates/crab-remote-git/src/pack.rs:967— crates/crab-remote-git/src/pack.rs:967-972 | crates/crab-remote-git/src/pack.rs:1004-1009 | crates/crab-remote-git/src/pack.rs:1074-1079 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/crab-staging/src/index.rs:2366— crates/crab-staging/src/index.rs:2366-2371 | crates/crab-staging/src/index.rs:7874-7879 | crates/crab-staging/src/index.rs:8248-8253 — 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/crab-staging/src/index.rs:2366` 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/crab-staging/src/index.rs:6813— crates/crab-staging/src/index.rs:6813-6818 | crates/crab-staging/src/index.rs:7365-7370 | crates/crab-staging/src/multipart_resume.rs:548-553 — 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/crab-staging/src/index.rs:6813` 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/crab-vfs/src/daemon.rs:1313— crates/crab-vfs/src/daemon.rs:1313-1319 | crates/crab-vfs/src/daemon.rs:1333-1338 | crates/crab-vfs/src/daemon.rs:1746-1751 — 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/crab-vfs/src/daemon.rs:1313` it does not close everything it opens, so those exact lines 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) REDACTED:1179— REDACTED:1179-1184 | REDACTED:1659-1664 | REDACTED:1718-1723 — 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, `REDACTED:1714` calls `Ok`, `verify_and_hash_plots` and `REDACTED:1174` 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) REDACTED:1221— REDACTED:1221-1226 | REDACTED:1680-1685 | REDACTED:1740-1745 — 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 `REDACTED:1221` it begins part-way through the construct above it, so those exact lines 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/crab-http-server/src/branches.rs:274— crates/crab-http-server/src/branches.rs:274-279 | crates/crab-http-server/src/branches.rs:308-313 | crates/crab-http-server/src/contents.rs:420-425 — before extracting anything, compare `crates/crab-http-server/src/branches.rs` and `crates/crab-http-server/src/contents.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `std::result::Result<Json<CreateInput>` in one and `std::result::Result<Json<DeleteInput>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 3) crab/src/cmd/lfs/fsck.rs:443— crab/src/cmd/lfs/fsck.rs:443-448 | crab/src/lfs/prune.rs:934-939 | crab/src/lfs/prune.rs:942-947 — before extracting anything, compare `crab/src/cmd/lfs/fsck.rs` and `crab/src/lfs/prune.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/crab-workflow/src/checkpoint.rs:312— crates/crab-workflow/src/checkpoint.rs:312-317 | crates/crab-workflow/src/dvc_inventory.rs:2269-2274 | crates/crab-workflow/src/external_hash.rs:231-236 — before extracting anything, compare `crates/crab-workflow/src/checkpoint.rs` and `crates/crab-workflow/src/dvc_inventory.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) crates/crab-staging/src/index.rs:1795— crates/crab-staging/src/index.rs:1795-1803 | crates/crab-staging/src/index.rs:8732-8737 | crates/crab-staging/src/index.rs:8758-8766 — 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/crab-staging/src/index.rs:1795` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 3) crates/crab-staging/src/index.rs:3278— crates/crab-staging/src/index.rs:3278-3283 | crates/crab-staging/src/index.rs:6476-6482 | crates/crab-staging/src/index.rs:6583-6588 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×18
Edited copy of a member (17 corresponding lines) crab/src/cmd/lfs/mod.rs:702— crab/src/cmd/lfs/mod.rs:702-718 | crates/crab-vfs/src/publish.rs:1545-1562 — 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/crab-http-server/src/pulls/review_threads.rs:665— crates/crab-http-server/src/pulls/review_threads.rs:665-681 | crates/crab-http-server/src/pulls/review_threads.rs:688-707 — 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/crab-vfs/src/coordinator.rs:536— crates/crab-vfs/src/coordinator.rs:536-555 | crates/crab-vfs/src/coordinator.rs:588-604 — 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) crab/src/cmd/gc/bucket.rs:1313— crab/src/cmd/gc/bucket.rs:1313-1329 | crab/src/cmd/gc/bucket.rs:1331-1348 — 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/crab-read/src/hydrator.rs:655— crates/crab-read/src/hydrator.rs:655-671 | crates/crab-read/src/hydrator.rs:673-690 — 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) crab/src/cmd/exp.rs:2974— crab/src/cmd/exp.rs:2974-2990 | crab/src/cmd/exp_queue.rs:1398-1415 — 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/crab-http-server/src/issues.rs:62— crates/crab-http-server/src/issues.rs:62-78 | crates/crab-http-server/src/issues.rs:86-102 — 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/crab-http-server/src/cells/repository.rs:738— crates/crab-http-server/src/cells/repository.rs:738-756 | crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1032-1048 — 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/crab-cache-server/src/onboarding.rs:1333— crates/crab-cache-server/src/onboarding.rs:1333-1349 | crates/crab-workflow/src/lockfile.rs:696-717 — 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) crab/src/cmd/lfs/checkout.rs:455— crab/src/cmd/lfs/checkout.rs:455-476 | crab/src/cmd/lfs/convert.rs:527-543 — 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/crab-coordination/src/spanner_coordinator.rs:344— crates/crab-coordination/src/spanner_coordinator.rs:344-360 | crates/crab-coordination/src/spanner_coordinator.rs:385-401 — 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/crab-auth-server/src/receive.rs:1366— crates/crab-auth-server/src/receive.rs:1366-1382 | crates/crab-write/src/catalog.rs:108-128 — 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) crab/src/cmd/mount.rs:987— crab/src/cmd/mount.rs:987-1003 | crates/crab-vfs/src/nfs_mount.rs:119-135 — 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) crab/src/cmd/install.rs:222— crab/src/cmd/install.rs:222-238 | crab/src/import/assemble.rs:982-998 — 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/crab-workflow/src/hydra.rs:1339— crates/crab-workflow/src/hydra.rs:1339-1355 | crates/crab-workflow/src/template/context.rs:334-354 — 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) crab/scripts/qualify_sdk.py:67— crab/scripts/qualify_sdk.py:67-83 | crab/scripts/qualify_sdk.py:87-106 — 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/crab-workflow/src/journal.rs:286— crates/crab-workflow/src/journal.rs:286-302 | crates/crab-workflow/src/journal.rs:308-325 — 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) crab/src/cmd/gc/mod.rs:766— crab/src/cmd/gc/mod.rs:766-783 | crab/src/cmd/run.rs:2744-2760 — 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 (15 lines × 2) crab/src/cmd/lfs/fsck.rs:463— crab/src/cmd/lfs/fsck.rs:463-477 | crab/src/lfs/prune.rs:951-965 — before extracting anything, compare `crab/src/cmd/lfs/fsck.rs` and `crab/src/lfs/prune.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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) crab/src/cmd/metrics.rs:1272— crab/src/cmd/metrics.rs:1272-1286 | crab/src/cmd/metrics.rs:1338-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 `crab/src/cmd/metrics.rs:1272` it does not close everything it opens, so those 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, `crab/src/cmd/metrics.rs:1269` calls `reject_image_sources_for_vega` and `crab/src/cmd/metrics.rs:1336` 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 (15 lines × 2) crab/src/core/error.rs:2619— crab/src/core/error.rs:2619-2633 | crab/src/core/error_catalog.rs:1554-1568 — 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 `crab/src/core/error.rs:2619` it begins part-way through the construct above it, so those exact lines 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) crab/src/git/pack.rs:736— crab/src/git/pack.rs:736-750 | crab/src/git/pack.rs:954-968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crab/src/git/progress.rs:650— crab/src/git/progress.rs:650-664 | crab/src/git/progress.rs:688-702 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/progress.rs:650` it does not close everything it opens, so those exact lines 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) crab/src/git/push.rs:5354— crab/src/git/push.rs:5354-5368 | crab/src/git/push.rs:5383-5397 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:5354` it begins part-way through the construct above it, so those exact lines 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) crab/src/git/push_native.rs:719— crab/src/git/push_native.rs:719-733 | crab/src/git/push_native.rs:750-764 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push_native.rs:719` it does not close everything it opens, so those exact lines 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) crab/src/metadata/metadb/mod.rs:785— crab/src/metadata/metadb/mod.rs:785-799 | crab/src/metadata/metadb/mod.rs:816-830 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/metadata/metadb/mod.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 (15 lines × 2) crates/crab-coordination/src/write_coordinator.rs:1051— crates/crab-coordination/src/write_coordinator.rs:1051-1065 | crates/crab-coordination/src/write_coordinator.rs:1526-1540 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-coordination/src/write_coordinator.rs:1051` it does not close everything it opens, so those exact lines 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/crab-staging/src/lib.rs:2645— crates/crab-staging/src/lib.rs:2645-2659 | crates/crab-staging/src/lib.rs:4063-4077 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/crab-staging/src/lib.rs:4080` calls `unresolved_publication_intents` and `crates/crab-staging/src/lib.rs:2662` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) crates/crab-vfs/src/nfs_control.rs:954— crates/crab-vfs/src/nfs_control.rs:954-968 | crates/crab-vfs/src/nfs_control.rs:983-997 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-vfs/src/nfs_control.rs:954` it does not close everything it opens, so those exact lines 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/crab-workflow/src/exp_worktree.rs:1268— crates/crab-workflow/src/exp_worktree.rs:1268-1282 | crates/crab-workflow/src/params.rs:393-407 — before extracting anything, compare `crates/crab-workflow/src/exp_worktree.rs` and `crates/crab-workflow/src/params.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 94 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 (15 lines × 2) crab/src/main.rs:3538— crab/src/main.rs:3538-3552 | crab/src/main.rs:3599-3613 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/main.rs:3538` 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) crab/src/git/push.rs:16951— crab/src/git/push.rs:16951-16965 | crab/src/git/push.rs:17036-17050 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:16951` it begins part-way through the construct above it, so those 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, `crab/src/git/push.rs:17035` calls `is_some` and `crab/src/git/push.rs:16950` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15 lines × 2) crab/src/storage/head_class.rs:354— crab/src/storage/head_class.rs:354-368 | crab/src/storage/head_class.rs:371-385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) crab/scripts/check-architecture-gates.py:2768— crab/scripts/check-architecture-gates.py:2768-2782 | crab/scripts/check-architecture-gates.py:2818-2832 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/check-architecture-gates.py:2768` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) crates/crab-http-server/deploy/cell-issue-fleet/qualify_mode_rollout.py:114— crates/crab-http-server/deploy/cell-issue-fleet/qualify_mode_rollout.py:114-128 | REDACTED:489-505 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) crab/deploy/auth-service/scripts/e2e-path-acl-local.py:429— crab/deploy/auth-service/scripts/e2e-path-acl-local.py:429-443 | crab/deploy/auth-service/scripts/e2e-path-acl-rustfs.py:546-560 — 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 (9 lines × 3) crab/src/cmd/artifacts.rs:195— crab/src/cmd/artifacts.rs:195-203 | crab/src/cmd/artifacts.rs:223-231 | crab/src/cmd/artifacts.rs:512-520 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crab/src/cmd/lfs/env.rs:85— crab/src/cmd/lfs/env.rs:85-93 | crab/src/cmd/lock.rs:231-239 | crab/src/cmd/push.rs:1558-1566 — 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 `crab/src/cmd/lfs/env.rs:85` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) crab/src/cmd/recover.rs:1944— crab/src/cmd/recover.rs:1944-1952 | crab/src/cmd/recover.rs:2065-2073 | crab/src/cmd/recover.rs:2203-2211 — 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 `crab/src/cmd/recover.rs:1944` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 3) crab/src/cmd/recover.rs:2947— crab/src/cmd/recover.rs:2947-2955 | crates/crab-staging/src/push_plan.rs:1081-1089 | crates/crab-vfs/src/hydration.rs:1445-1453 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (9 lines × 3) crab/src/cmd/run.rs:691— crab/src/cmd/run.rs:691-699 | crab/src/cmd/run.rs:1363-1371 | crab/src/cmd/run.rs:1499-1507 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/crab-vfs/src/coordinator.rs:537— crates/crab-vfs/src/coordinator.rs:537-545 | crates/crab-vfs/src/coordinator.rs:589-597 | crates/crab-vfs/src/coordinator.rs:614-622 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/crab-vfs/src/coordinator.rs:546` calls `as_ref`, `ok_or_else`, `Internal` and `crates/crab-vfs/src/coordinator.rs:623` 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 × 3) crates/crab-xet/src/shard_parse.rs:261— crates/crab-xet/src/shard_parse.rs:261-269 | crates/crab-xet/src/shard_parse.rs:523-532 | crates/crab-xet/src/shard_parse.rs:673-682 — 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/crab-xet/src/shard_parse.rs:261` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 3) crab/src/cmd/metrics.rs:3404— crab/src/cmd/metrics.rs:3404-3412 | crab/src/cmd/params.rs:305-313 | crates/crab-workflow/src/params_runtime.rs:157-165 — before extracting anything, compare `crab/src/cmd/metrics.rs` and `crab/src/cmd/params.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/crab-cache-server/src/cache_store.rs:645— crates/crab-cache-server/src/cache_store.rs:645-653 | crates/crab-cache-server/src/cache_store.rs:704-712 | crates/crab-cache-server/src/cache_store.rs:740-752 — 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/crab-cache-server/src/cache_store.rs:645` 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: `crates/crab-cache-server/src/cache_store.rs:645` is reached only past a guard at line 630 that tests `key.object_type` and leaves the function early, and `crates/crab-cache-server/src/cache_store.rs:704` reads `key.object_type` with no such check. What separates these copies is not which lines they run but which PRECONDITION they enforce, so one of them is operating on state the other one refuses. Decide which is intended BEFORE unifying them — extract the shared part and whichever copy is missing the check keeps running unchecked, and if the guard is the correct behaviour then that hole is already live.
Duplicated block (9 lines × 3) crab/src/git/progress.rs:307— crab/src/git/progress.rs:307-315 | crab/src/git/progress.rs:360-371 | crab/src/git/progress.rs:412-420 — 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 `crab/src/git/progress.rs:307` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) crab/src/cache/add_remote_candidates.rs:318— crab/src/cache/add_remote_candidates.rs:318-328 | crab/src/cache/add_remote_candidates.rs:456-464 | crab/src/cache/add_remote_candidates.rs:469-477 — 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 `crab/src/cache/add_remote_candidates.rs:318` it does not close everything it opens, so those 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, `crab/src/cache/add_remote_candidates.rs:317` calls `is_empty` and `crab/src/cache/add_remote_candidates.rs:455` 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 × 3) crates/crab-staging/src/index.rs:7071— crates/crab-staging/src/index.rs:7071-7080 | crates/crab-staging/src/index.rs:7270-7279 | crates/crab-staging/src/index.rs:7346-7354 — 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/crab-staging/src/index.rs:7071` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) crates/crab-xet/src/shard_parse.rs:347— crates/crab-xet/src/shard_parse.rs:347-356 | crates/crab-xet/src/shard_parse.rs:523-532 | crates/crab-xet/src/shard_parse.rs:673-681 — 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/crab-xet/src/shard_parse.rs:347` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 3) crab/src/main.rs:4021— crab/src/main.rs:4021-4029 | crab/src/main.rs:4144-4152 | crab/src/main.rs:5824-5832 — 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 `crab/src/main.rs:4021` 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) crab/src/cmd/hydrate.rs:2946— crab/src/cmd/hydrate.rs:2946-2954 | crab/src/cmd/hydrate.rs:2979-2987 | crab/src/cmd/hydrate.rs:3005-3013 — 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 `crab/src/cmd/hydrate.rs:2946` it begins part-way through the construct above it, so those 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 × 3) crates/crab-http-server/src/cells/repository/checks.rs:411— crates/crab-http-server/src/cells/repository/checks.rs:411-419 | crates/crab-http-server/src/cells/repository/checks.rs:438-446 | crates/crab-http-server/src/cells/repository/releases.rs:741-749 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 3) crab/src/cmd/migrate.rs:1582— crab/src/cmd/migrate.rs:1582-1590 | crab/src/cmd/migrate.rs:2422-2430 | crab/src/cmd/migrate.rs:2462-2470 — 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 `crab/src/cmd/migrate.rs:1582` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) crates/crab-http-server/src/pulls.rs:302— crates/crab-http-server/src/pulls.rs:302-310 | crates/crab-http-server/src/pulls/reviews.rs:88-96 | crates/crab-http-server/src/releases.rs:141-149 — 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.
IC1 · Incompleteness & stubs· Empty method body · ×18
Empty method body — does nothing with its inputs crab/src/cmd/data.rs:1818— `remove_temporary` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crab/src/cmd/diff_driver.rs:339— `print_mixed_pointer_content` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crab/src/cmd/du.rs:380— `print_row` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crab/src/cmd/du.rs:384— `print_row_with_count` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crab/src/cmd/help.rs:104— `print_root_help` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crab/src/cmd/lfs/checkout.rs:128— `skip_missing_lfs_content` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crab/src/cmd/lfs/ext.rs:32— `print_extension` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crab/src/cmd/replica.rs:12427— `render_failover_automation_policy` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crab/src/cmd/status.rs:1052— `print_summary` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crab/src/core/perf_phase.rs:124— `trace_phase` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crab/src/git/push.rs:16308— `record_failure_stage` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crab/src/replication/mod.rs:9262— `clear_readiness_cache_invalidation` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crates/crab-cache-server/src/metrics.rs:860— `append_metric_header` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crates/crab-cache-server/src/metrics.rs:906— `log_request_summary` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crates/crab-remote-git/src/reader.rs:1843— `observe_storage_read` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crates/crab-remote-git/src/runtime.rs:769— `insert_pack_index_source_size` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crates/crab-staging/src/add_push_plan.rs:272— `debug_file_summary` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Empty method body — does nothing with its inputs crates/crab-xet/src/upload_concurrency.rs:102— `report_completion` takes parameters but its body is empty — it accepts inputs and does nothing. Either implement it or remove it.
Duplicated block (16 lines × 2) crab/src/cmd/add.rs:864— crab/src/cmd/add.rs:864-879 | crab/src/git/progress.rs:1895-1910 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16 lines × 2) crab/src/cmd/exp.rs:5813— crab/src/cmd/exp.rs:5813-5828 | crab/src/cmd/exp.rs:5833-5848 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) crab/src/cmd/install.rs:395— crab/src/cmd/install.rs:395-410 | crab/src/cmd/lfs/install.rs:470-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 (16 lines × 2) crab/src/cmd/metrics.rs:1535— crab/src/cmd/metrics.rs:1535-1550 | crab/src/cmd/metrics.rs:3365-3380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) crab/src/cost/inventory/report/azure.rs:71— crab/src/cost/inventory/report/azure.rs:71-86 | crab/src/cost/inventory/report/gcs.rs:74-89 — before extracting anything, compare `crab/src/cost/inventory/report/azure.rs` and `crab/src/cost/inventory/report/gcs.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `crab/src/cost/inventory/report/azure.rs:71` it begins part-way through the construct above it, so those 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, `crab/src/cost/inventory/report/azure.rs:67` calls `get`, `trim_matches`, `to_string` and `crab/src/cost/inventory/report/gcs.rs:70` 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 (16 lines × 2) crab/src/git/push.rs:5745— crab/src/git/push.rs:5745-5760 | crab/src/git/push.rs:6368-6383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:5745` it begins part-way through the construct above it, so those exact lines 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) crab/src/replication/mod.rs:8811— crab/src/replication/mod.rs:8811-8826 | crab/src/replication/mod.rs:8968-8983 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/replication/mod.rs:8811` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/crab-git/src/url.rs:220— crates/crab-git/src/url.rs:220-235 | crates/crab-git/src/url.rs:294-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/crab-http-server/src/auth.rs:1055— crates/crab-http-server/src/auth.rs:1055-1070 | crates/crab-http-server/src/auth.rs:1101-1116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/auth.rs:1055` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/crab-staging/src/lib.rs:2841— crates/crab-staging/src/lib.rs:2841-2856 | crates/crab-staging/src/lib.rs:3875-3890 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) crates/crab-storage/src/store.rs:2459— crates/crab-storage/src/store.rs:2459-2474 | crates/crab-storage/src/store.rs:2572-2587 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-storage/src/store.rs:2459` it begins part-way through the construct above it, so those exact lines 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/crab-vfs/src/overlay.rs:1162— crates/crab-vfs/src/overlay.rs:1162-1177 | crates/crab-vfs/src/overlay.rs:1272-1287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-vfs/src/overlay.rs:1162` it does not close everything it opens, so those exact lines 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/crab-workflow/src/exp_worktree.rs:1762— crates/crab-workflow/src/exp_worktree.rs:1762-1777 | crates/crab-workflow/src/exp_worktree.rs:1824-1839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-workflow/src/exp_worktree.rs:1762` it does not close everything it opens, so those exact lines 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/crab-workflow/src/exp_worktree.rs:1876— crates/crab-workflow/src/exp_worktree.rs:1876-1891 | crates/crab-workflow/src/exp_worktree.rs:1938-1953 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-workflow/src/exp_worktree.rs:1876` it does not close everything it opens, so those exact lines 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/crab-workflow/src/params.rs:568— crates/crab-workflow/src/params.rs:568-583 | crates/crab-workflow/src/params.rs:595-610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-workflow/src/params.rs:568` it does not close everything it opens, so those 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) crab/src/lfs/track.rs:489— crab/src/lfs/track.rs:489-504 | crab/src/lfs/track.rs:529-544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/track.rs:489` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) crates/crab-http-server/src/branches.rs:191— crates/crab-http-server/src/branches.rs:191-206 | crates/crab-http-server/src/contents.rs:246-261 — before extracting anything, compare `crates/crab-http-server/src/branches.rs` and `crates/crab-http-server/src/contents.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/branches.rs:191` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/adopt.rs:380— crab/src/cmd/adopt.rs:380-397 | crab/src/cmd/unadopt.rs:232-249 — before extracting anything, compare `crab/src/cmd/adopt.rs` and `crab/src/cmd/unadopt.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 108 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 `crab/src/cmd/adopt.rs:380` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) crab/src/cmd/init.rs:889— crab/src/cmd/init.rs:889-906 | crates/crab-vfs/src/executable.rs:37-54 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 (18 lines × 2) crab/src/cmd/lfs/fsck.rs:388— crab/src/cmd/lfs/fsck.rs:388-405 | crab/src/cmd/lfs/ls_files.rs:398-415 — before extracting anything, compare `crab/src/cmd/lfs/fsck.rs` and `crab/src/cmd/lfs/ls_files.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/lfs/fsck.rs:388` 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) crab/src/cmd/metadb.rs:2905— crab/src/cmd/metadb.rs:2905-2922 | crates/crab-auth-server/src/receive.rs:1600-1617 — before extracting anything, compare `crab/src/cmd/metadb.rs` and `crates/crab-auth-server/src/receive.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `crab/src/cmd/metadb.rs:2905` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/metrics.rs:514— crab/src/cmd/metrics.rs:514-531 | crab/src/cmd/metrics.rs:586-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) crab/src/cmd/push.rs:1294— crab/src/cmd/push.rs:1294-1311 | crab/src/git/remote_helper.rs:1802-1819 — 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 `crab/src/cmd/push.rs:1294` 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) crab/src/cmd/setup.rs:293— crab/src/cmd/setup.rs:293-310 | crab/src/cmd/setup.rs:420-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/setup.rs:293` it does not close everything it opens, so those exact lines 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) crab/src/git/push.rs:1841— crab/src/git/push.rs:1841-1858 | crab/src/git/push.rs:18218-18235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) crates/crab-auth-server/src/receive.rs:1283— crates/crab-auth-server/src/receive.rs:1283-1300 | crates/crab-auth-server/src/view/objects.rs:299-316 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-auth-server/src/receive.rs:1283` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) crates/crab-auth-server/src/view/git_workspace.rs:444— crates/crab-auth-server/src/view/git_workspace.rs:444-461 | crates/crab-auth-server/src/view/git_workspace.rs:470-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) crates/crab-http-server/src/cells/repository/operations.rs:91— crates/crab-http-server/src/cells/repository/operations.rs:91-108 | crates/crab-http-server/src/cells/repository/pulls.rs:490-507 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 2) crates/crab-storage/src/store.rs:2434— crates/crab-storage/src/store.rs:2434-2451 | crates/crab-storage/src/store.rs:2524-2541 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-storage/src/store.rs:2434` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) crates/crab-staging/src/lib.rs:3183— crates/crab-staging/src/lib.rs:3183-3200 | crates/crab-staging/src/lib.rs:4242-4260 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-staging/src/lib.rs:3183` 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) crates/crab-staging/src/index.rs:8363— crates/crab-staging/src/index.rs:8363-8380 | crates/crab-staging/src/index.rs:8426-8443 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-staging/src/index.rs:8363` it does not close everything it opens, so those exact lines 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) crab/scripts/check-crate-behavior.py:98— crab/scripts/check-crate-behavior.py:98-115 | crab/scripts/check-crate-interface-builds.py:135-152 — 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 (18 lines × 2) crab/scripts/verify-large-repo-rustfs-report.py:162— crab/scripts/verify-large-repo-rustfs-report.py:162-179 | crab/scripts/verify-large-repo-rustfs-report.py:188-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.
PushPipeline::try_apply_add_push_plans (cyclomatic 62) crab/src/git/push.rs:10673— PushPipeline::try_apply_add_push_plans has cyclomatic complexity 62 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PushPipeline::verify_xorb_refs_with_committed_receipts (cyclomatic 55) crab/src/git/push.rs:9892— PushPipeline::verify_xorb_refs_with_committed_receipts has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PushPipeline::upload_xorb_batch (cyclomatic 45) crab/src/git/push.rs:11835— PushPipeline::upload_xorb_batch has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PushPipeline::apply_decisions_with_sha_map (cyclomatic 34) crab/src/git/push.rs:7457— PushPipeline::apply_decisions_with_sha_map 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.
PushPipeline::classify_chunks (cyclomatic 31) crab/src/git/push.rs:11167— PushPipeline::classify_chunks 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.
PushPipeline::post_success_cleanup (cyclomatic 31) crab/src/git/push.rs:15833— PushPipeline::post_success_cleanup 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.
PushPipeline::pack_xorbs_with_output (cyclomatic 30) crab/src/git/push.rs:11460— PushPipeline::pack_xorbs_with_output 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.
PushPipeline::upload_packs (cyclomatic 24) crab/src/git/push.rs:13183— PushPipeline::upload_packs 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: PushRejectReason::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.
PushPipeline::build_shard_with_session (cyclomatic 23) crab/src/git/push.rs:12384— PushPipeline::build_shard_with_session has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: PushRejectReason::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.
PushPipeline::commit_ref_journal (cyclomatic 21) crab/src/git/push.rs:8758— PushPipeline::commit_ref_journal has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: PushRejectReason::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.
PushPipeline::validate_committed_chunk_candidates (cyclomatic 21) crab/src/git/push.rs:14222— PushPipeline::validate_committed_chunk_candidates has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: PushRejectReason::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.
PushPipeline::upload_packed_xorb_stream (cyclomatic 20) crab/src/git/push.rs:12250— PushPipeline::upload_packed_xorb_stream has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: PushRejectReason::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.
PushPipeline::lookup_staging (cyclomatic 19) crab/src/git/push.rs:9598— PushPipeline::lookup_staging has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: PushRejectReason::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.
PushPipeline::evaluate_decisions_with_sha_map (cyclomatic 18) crab/src/git/push.rs:7262— PushPipeline::evaluate_decisions_with_sha_map has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: PushRejectReason::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.
PushPipeline::upload_shard_and_file_index (cyclomatic 18) crab/src/git/push.rs:12753— PushPipeline::upload_shard_and_file_index has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: PushRejectReason::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.
crab_metadata::git_visibility::storage::apply_catalog_journal_edits (cognitive 61) crates/crab-metadata/src/git_visibility.rs:3352— crab_metadata::git_visibility::storage::apply_catalog_journal_edits has cognitive complexity 61 (threshold 15). Drivers by points: if/else 18 (37 pts), match/switch 6 (10 pts), loops 7 (9 pts), boolean chains 5 (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.
crab_metadata::ref_journal::materialize_ref_journal (cognitive 45) crates/crab-metadata/src/ref_journal.rs:625— crab_metadata::ref_journal::materialize_ref_journal has cognitive complexity 45 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 9 (16 pts), match/switch 3 (10 pts), boolean chains 3 (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.
crab_metadata::split_commit_graph::update_split_commit_graph (cognitive 41) crates/crab-metadata/src/split_commit_graph.rs:425— crab_metadata::split_commit_graph::update_split_commit_graph has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 7 (10 pts), boolean chains 6, match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_metadata::path_state::codec::decode_layer (cognitive 35) crates/crab-metadata/src/path_state/codec.rs:42— crab_metadata::path_state::codec::decode_layer has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (23 pts), boolean chains 4, loops 3 (4 pts), match/switch 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_metadata::path_state::validate_descriptor (cognitive 30) crates/crab-metadata/src/path_state.rs:710— crab_metadata::path_state::validate_descriptor has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 4 (8 pts), boolean chains 5 (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.
crab_metadata::git_visibility::storage::compact_journal_edits (cognitive 27) crates/crab-metadata/src/git_visibility.rs:3713— crab_metadata::git_visibility::storage::compact_journal_edits has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 4 (10 pts), loops 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.
crab_metadata::remote_index::write_opened_entries (cognitive 26) crates/crab-metadata/src/remote_index.rs:267— crab_metadata::remote_index::write_opened_entries has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (7 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.
crab_metadata::ref_journal::commit_ref_transaction_inner (cognitive 24) crates/crab-metadata/src/ref_journal.rs:247— crab_metadata::ref_journal::commit_ref_transaction_inner has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 4 (9 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.
crab_metadata::ref_journal::validate_transaction (cognitive 24) crates/crab-metadata/src/ref_journal.rs:1038— crab_metadata::ref_journal::validate_transaction has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 5, loops 3, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
crab_metadata::path_state::append_path_state (cognitive 22) crates/crab-metadata/src/path_state.rs:294— crab_metadata::path_state::append_path_state has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (6 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.
crab_metadata::commit_graph::fill_generation_numbers_with_base (cognitive 20) crates/crab-metadata/src/commit_graph.rs:383— crab_metadata::commit_graph::fill_generation_numbers_with_base has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 5 (7 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_metadata::manifest_store::materialize_active_active_manifest_projection (cognitive 19) crates/crab-metadata/src/manifest_store.rs:835— crab_metadata::manifest_store::materialize_active_active_manifest_projection has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 3 (8 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.
crab_metadata::ref_journal::cleanup_compacted_transactions (cognitive 18) crates/crab-metadata/src/ref_journal.rs:553— crab_metadata::ref_journal::cleanup_compacted_transactions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 2 (5 pts), loops 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.
crab_metadata::git_object_locator::reader::lookup_strategy (cognitive 17) crates/crab-metadata/src/git_object_locator/reader.rs:892— crab_metadata::git_object_locator::reader::lookup_strategy has cognitive complexity 17 (threshold 15). Drivers by points: boolean chains 12, if/else 5. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
crab_metadata::ref_journal::transaction_is_compacted (cognitive 16) crates/crab-metadata/src/ref_journal.rs:515— crab_metadata::ref_journal::transaction_is_compacted has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×15
crab_http_server::api::execute (cyclomatic 46) crates/crab-http-server/src/api.rs:468— crab_http_server::api::execute has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab_http_server::peer::dispatch_forwarded_request (cyclomatic 33) crates/crab-http-server/src/peer.rs:968— crab_http_server::peer::dispatch_forwarded_request has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
crab_http_server::api::read (cyclomatic 25) crates/crab-http-server/src/api.rs:189— crab_http_server::api::read has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
crab_http_server::pulls::edit (cyclomatic 25) crates/crab-http-server/src/pulls.rs:538— crab_http_server::pulls::edit has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
crab_http_server::receive::publish::publish_attempt (cyclomatic 25) crates/crab-http-server/src/receive/publish.rs:434— crab_http_server::receive::publish::publish_attempt has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
crab_http_server::server::boundary_request (cyclomatic 25) crates/crab-http-server/src/server.rs:2263— crab_http_server::server::boundary_request has cyclomatic complexity 25 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
crab_http_server::cells::scheduler::recover_node_session (cyclomatic 23) crates/crab-http-server/src/cells/scheduler.rs:1190— crab_http_server::cells::scheduler::recover_node_session 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.
crab_http_server::git_import::normalize_source (cyclomatic 21) crates/crab-http-server/src/git_import.rs:912— crab_http_server::git_import::normalize_source has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
crab_http_server::server::serve (cyclomatic 21) crates/crab-http-server/src/server.rs:1074— crab_http_server::server::serve 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.
crab_http_server::pulls::merge::execute (cyclomatic 19) crates/crab-http-server/src/pulls/merge.rs:248— crab_http_server::pulls::merge::execute has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab_http_server::issues::edit (cyclomatic 18) crates/crab-http-server/src/issues.rs:426— crab_http_server::issues::edit has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
crab_http_server::assets::serve (cyclomatic 17) crates/crab-http-server/src/assets.rs:9— crab_http_server::assets::serve 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.
crab_http_server::git::upload_pack (cyclomatic 17) crates/crab-http-server/src/git.rs:212— crab_http_server::git::upload_pack has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: GitError::into_response (cyclomatic 18) 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.
crab_http_server::peer::authorize_repository (cyclomatic 17) crates/crab-http-server/src/peer.rs:1795— crab_http_server::peer::authorize_repository has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: crab_http_server::peer::required_mutation_action (cyclomatic 22) 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.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×13
Members sharing a duplicated core (5 members, 50+ identical tokens) crab/src/cache/add_remote_candidates.rs:412— crab/src/cache/add_remote_candidates.rs:412-628 | crates/crab-staging/src/index.rs:2544-2782 | crates/crab-staging/src/index.rs:3106-3194 | crates/crab-staging/src/index.rs:3200-3349 | crates/crab-staging/src/index.rs:6338-6944 — 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) crab/src/cmd/exp.rs:3930— crab/src/cmd/exp.rs:3930-3959 | crab/src/cmd/exp.rs:4190-4219 | crab/src/cmd/recover.rs:2821-2837 | crab/src/cmd/recover.rs:2914-2930 | crates/crab-vfs/src/publish.rs:1714-1729 — 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) crab/src/cmd/gc/bucket.rs:882— crab/src/cmd/gc/bucket.rs:882-909 | crab/src/cmd/gc/bucket.rs:2421-2443 | crab/src/cmd/optimize/xorbs.rs:446-661 | crab/src/replication/mod.rs:8041-8110 | crates/crab-workflow/src/artifact.rs:549-561 — 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) crab/src/git/connectivity.rs:82— crab/src/git/connectivity.rs:82-114 | crab/src/git/incremental_walk.rs:88-261 | crates/crab-vfs/src/engine.rs:178-207 | crates/crab-vfs/src/snapshot.rs:557-599 | crates/crab-workflow/src/params_runtime.rs:366-473 — 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) crab/src/git/progress.rs:811— crab/src/git/progress.rs:811-855 | crab/src/git/progress.rs:860-904 | crab/src/git/progress.rs:1135-1200 | crab/src/git/progress.rs:1205-1250 | crab/src/git/progress.rs:1255-1299 — 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) crab/src/import/assemble.rs:395— crab/src/import/assemble.rs:395-418 | crab/src/import/assemble.rs:440-461 | crab/src/import/assemble.rs:826-840 | crab/src/import/assemble.rs:842-856 | crab/src/import/assemble.rs:1043-1090 — 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) crab/src/import/coordinator.rs:1089— crab/src/import/coordinator.rs:1089-1099 | crates/crab-auth/src/aws_oidc.rs:324-332 | crates/crab-auth/src/azure_entra.rs:369-377 | crates/crab-auth/src/crab_auth_client.rs:610-618 | crates/crab-auth/src/gcp_federation.rs:362-370 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/crab-http-server/src/cells.rs:470— crates/crab-http-server/src/cells.rs:470-486 | crates/crab-http-server/src/cells.rs:1059-1075 | crates/crab-http-server/src/cells.rs:1271-1290 | crates/crab-http-server/src/cells.rs:1354-1414 | crates/crab-http-server/src/cells.rs:1420-1546 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/crab-http-server/src/cells.rs:775— crates/crab-http-server/src/cells.rs:775-837 | crates/crab-http-server/src/cells.rs:1583-1673 | crates/crab-http-server/src/cells/router.rs:649-691 | crates/crab-http-server/src/projection.rs:176-198 | crates/crab-http-server/src/projection.rs:206-249 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/crab-http-server/src/checks.rs:857— crates/crab-http-server/src/checks.rs:857-867 | crates/crab-http-server/src/issues.rs:687-697 | crates/crab-http-server/src/labels.rs:321-331 | crates/crab-http-server/src/repository_settings.rs:246-256 | crates/crab-http-server/src/statuses.rs:366-376 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/crab-remote-git/src/error.rs:472— crates/crab-remote-git/src/error.rs:472-511 | crates/crab-sdk/src/content/crab.rs:244-293 | crates/crab-sdk/src/remote_error.rs:133-149 | crates/crab-sdk/src/remote_error.rs:169-211 | crates/crab-storage/src/error.rs:170-188 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/crab-staging/src/index.rs:1115— crates/crab-staging/src/index.rs:1115-1162 | crates/crab-staging/src/index.rs:4080-4164 | crates/crab-staging/src/index.rs:4169-4222 | crates/crab-staging/src/index.rs:4562-4689 | crates/crab-staging/src/index.rs:5066-5645 — 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) crab/scripts/check-architecture-gates.py:2565— crab/scripts/check-architecture-gates.py:2565-2630 | crab/scripts/check-architecture-gates.py:2634-2690 | crab/scripts/check-architecture-gates.py:2694-2740 | crab/scripts/check-architecture-gates.py:2744-2790 | crab/scripts/check-architecture-gates.py:2794-2840 — 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 (29 corresponding lines) · ×13
Edited copy of a member (29 corresponding lines) crab/scripts/qualify_sdk.py:389— crab/scripts/qualify_sdk.py:389-417 | crab/scripts/verify-sdk-read-only.py:53-82 — 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) crab/src/cmd/run.rs:3350— crab/src/cmd/run.rs:3350-3378 | crates/crab-workflow/src/materialize.rs:252-280 — 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/crab-http-server/src/issues.rs:570— crates/crab-http-server/src/issues.rs:570-598 | crates/crab-http-server/src/issues.rs:637-669 — 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/crab-coordination/src/write_coordinator.rs:918— crates/crab-coordination/src/write_coordinator.rs:918-946 | crates/crab-coordination/src/write_coordinator.rs:1406-1434 — 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) crab/src/cmd/workflow_checkpoint.rs:859— crab/src/cmd/workflow_checkpoint.rs:859-887 | crates/crab-workflow/src/atomic.rs:60-91 — 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) crab/src/cmd/lfs/dedup.rs:175— crab/src/cmd/lfs/dedup.rs:175-203 | crab/src/cmd/lfs/dedup.rs:692-720 — 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) crab/src/cmd/exp.rs:4927— crab/src/cmd/exp.rs:4927-4955 | crab/src/cmd/lfs/locks.rs:163-192 — 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/crab-cache-server/src/cache_store.rs:1218— crates/crab-cache-server/src/cache_store.rs:1218-1250 | crates/crab-cache-server/src/cache_store.rs:1257-1285 — 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/crab-http-server/src/checks.rs:616— crates/crab-http-server/src/checks.rs:616-644 | crates/crab-http-server/src/checks.rs:673-705 — 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) crab/src/replication/mod.rs:8798— crab/src/replication/mod.rs:8798-8826 | crab/src/replication/mod.rs:8951-8983 — 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/crab-auth/src/managed/client.rs:745— crates/crab-auth/src/managed/client.rs:745-780 | crates/crab-auth/src/managed/client.rs:844-872 — 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/crab-coordination/src/cosmosdb_coordinator.rs:1042— crates/crab-coordination/src/cosmosdb_coordinator.rs:1042-1075 | crates/crab-coordination/src/spanner_coordinator.rs:665-693 — 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) crab/src/replication/mod.rs:1018— crab/src/replication/mod.rs:1018-1046 | crab/src/replication/mod.rs:1437-1475 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×13
Edited copy of a member (23 corresponding lines) crates/crab-vfs/src/nfs_control.rs:953— crates/crab-vfs/src/nfs_control.rs:953-975 | crates/crab-vfs/src/nfs_control.rs:982-1007 — 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/crab-remote-git/src/runtime.rs:1010— crates/crab-remote-git/src/runtime.rs:1010-1035 | crates/crab-remote-git/src/snapshot.rs:2116-2138 — 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) crab/src/cache/add_validation.rs:34— crab/src/cache/add_validation.rs:34-69 | crab/src/cache/hydrated_pointer.rs:349-371 — 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) crab/src/cmd/metrics.rs:3500— crab/src/cmd/metrics.rs:3500-3524 | crab/src/cmd/params.rs:347-369 — 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/crab-staging/src/lib.rs:932— crates/crab-staging/src/lib.rs:932-954 | crates/crab-staging/src/stream.rs:1758-1792 — 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/crab-vfs/src/daemon.rs:1909— crates/crab-vfs/src/daemon.rs:1909-1933 | crates/crab-vfs/src/pipeline.rs:650-672 — 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/crab-workflow/src/template/foreach.rs:295— crates/crab-workflow/src/template/foreach.rs:295-345 | crates/crab-workflow/src/template/matrix.rs:309-331 — 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) crab/src/lfs/recent.rs:227— crab/src/lfs/recent.rs:227-249 | crab/src/lfs/recent.rs:256-282 — 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/crab-vfs/src/clone_cache.rs:211— crates/crab-vfs/src/clone_cache.rs:211-233 | crates/crab-vfs/src/mount_runtime.rs:205-231 — 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) crab/src/cmd/lfs/dedup.rs:1309— crab/src/cmd/lfs/dedup.rs:1309-1331 | crab/src/lfs/prune.rs:968-990 — 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/crab-http-server/src/pulls/storage.rs:396— crates/crab-http-server/src/pulls/storage.rs:396-418 | crates/crab-http-server/src/pulls/storage.rs:533-555 — 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/crab-workflow/src/scheduler.rs:192— crates/crab-workflow/src/scheduler.rs:192-214 | crates/crab-workflow/src/scheduler.rs:219-255 — 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) crab/src/replication/mod.rs:7456— crab/src/replication/mod.rs:7456-7479 | crab/src/replication/mod.rs:7565-7587 — 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 (17 lines × 2) crab/src/cmd/gc/bucket.rs:634— crab/src/cmd/gc/bucket.rs:634-650 | crab/src/cmd/gc/bucket.rs:854-870 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/bucket.rs:634` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crab/src/cmd/gc/bucket.rs:651` calls `Some` and `crab/src/cmd/gc/bucket.rs:871` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) crab/src/cmd/hydrate.rs:568— crab/src/cmd/hydrate.rs:568-584 | crab/src/cmd/hydrate.rs:1297-1313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/hydrate.rs:568` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crab/src/git/upload_pack_wire.rs:913— crab/src/git/upload_pack_wire.rs:913-929 | crab/src/git/upload_pack_wire.rs:945-961 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/upload_pack_wire.rs:913` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) crates/crab-coordination/src/dynamodb_coordinator.rs:464— crates/crab-coordination/src/dynamodb_coordinator.rs:464-480 | crates/crab-coordination/src/dynamodb_coordinator.rs:841-857 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-coordination/src/dynamodb_coordinator.rs:464` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crates/crab-s3-gateway/src/gateway.rs:1821— crates/crab-s3-gateway/src/gateway.rs:1821-1837 | crates/crab-s3-gateway/src/gateway.rs:1862-1878 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crates/crab-staging/src/index.rs:8402— crates/crab-staging/src/index.rs:8402-8418 | crates/crab-staging/src/index.rs:8465-8481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-staging/src/index.rs:8402` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crates/crab-vfs/src/daemon.rs:1877— crates/crab-vfs/src/daemon.rs:1877-1893 | crates/crab-vfs/src/pipeline.rs:631-647 — before extracting anything, compare `crates/crab-vfs/src/daemon.rs` and `crates/crab-vfs/src/pipeline.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (17 lines × 2) crab/src/lfs/lock.rs:289— crab/src/lfs/lock.rs:289-305 | crab/src/lfs/lock.rs:339-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/lock.rs:289` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crab/deploy/auth-service/src/app.py:1422— crab/deploy/auth-service/src/app.py:1422-1438 | crab/deploy/auth-service/src/app.py:1458-1474 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) crab/deploy/auth-service/src/policy.py:339— crab/deploy/auth-service/src/policy.py:339-355 | crab/deploy/auth-service/src/policy.py:405-423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/deploy/auth-service/src/policy.py:405` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crab/deploy/auth-service/src/policy.py:337` calls `extend` and `crab/deploy/auth-service/src/policy.py:405` 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) crab/scripts/verify-cache-service-smoke-report.py:1309— crab/scripts/verify-cache-service-smoke-report.py:1309-1325 | crab/scripts/verify-cache-service-smoke-report.py:1337-1353 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-cache-service-smoke-report.py:1309` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) crab/scripts/verify-nfs-smoke-report.py:1549— crab/scripts/verify-nfs-smoke-report.py:1549-1565 | crab/scripts/verify-nfs-smoke-report.py:1822-1838 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crab/scripts/verify-nfs-smoke-report.py:1545` calls `get`, `isinstance` and `crab/scripts/verify-nfs-smoke-report.py:1820` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) crab/scripts/verify-nfs-smoke-report.py:3477— crab/scripts/verify-nfs-smoke-report.py:3477-3493 | crab/scripts/verify-nfs-smoke-report.py:4148-4164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-nfs-smoke-report.py:3477` it begins part-way through the construct above it, so those 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.
crab_s3_gateway::multipart::register_part (cognitive 50) crates/crab-s3-gateway/src/multipart.rs:526— crab_s3_gateway::multipart::register_part has cognitive complexity 50 (threshold 15). Drivers by points: if/else 16 (37 pts), match/switch 5 (10 pts), boolean chains 2, loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_s3_gateway::attributes::load_objects (cognitive 38) crates/crab-s3-gateway/src/attributes.rs:483— crab_s3_gateway::attributes::load_objects has cognitive complexity 38 (threshold 15). Drivers by points: if/else 7 (24 pts), loops 4 (11 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.
crab_s3_gateway::multipart::reconcile_capacity_slot (cognitive 35) crates/crab-s3-gateway/src/multipart.rs:1425— crab_s3_gateway::multipart::reconcile_capacity_slot has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 8 (17 pts), if/else 7 (16 pts), boolean chains 2 (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.
crab_s3_gateway::mutation::upload_built_batch (cognitive 28) crates/crab-s3-gateway/src/mutation.rs:1770— crab_s3_gateway::mutation::upload_built_batch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_s3_gateway::mutation::build_commit (cognitive 28) crates/crab-s3-gateway/src/mutation.rs:2404— crab_s3_gateway::mutation::build_commit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 5, match/switch 4, 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.
crab_s3_gateway::multipart::reserve_transfer (cognitive 22) crates/crab-s3-gateway/src/multipart.rs:682— crab_s3_gateway::multipart::reserve_transfer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_s3_gateway::mutation::apply_with_fences (cognitive 22) crates/crab-s3-gateway/src/mutation.rs:1370— crab_s3_gateway::mutation::apply_with_fences has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 1 (2 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.
crab_s3_gateway::server::serve (cognitive 22) crates/crab-s3-gateway/src/server.rs:78— crab_s3_gateway::server::serve has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 4 (7 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_s3_gateway::gateway::read_selection (cognitive 21) crates/crab-s3-gateway/src/gateway.rs:3751— crab_s3_gateway::gateway::read_selection has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_s3_gateway::multipart::acquire_capacity (cognitive 17) crates/crab-s3-gateway/src/multipart.rs:372— crab_s3_gateway::multipart::acquire_capacity has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_s3_gateway::gateway::verified_crab_stream (cognitive 16) crates/crab-s3-gateway/src/gateway.rs:205— crab_s3_gateway::gateway::verified_crab_stream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_s3_gateway::multipart::freeze (cognitive 16) crates/crab-s3-gateway/src/multipart.rs:998— crab_s3_gateway::multipart::freeze has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×12
Edited copy of a member (26 corresponding lines) crates/crab-vfs/src/daemon.rs:411— crates/crab-vfs/src/daemon.rs:411-442 | crates/crab-vfs/src/daemon.rs:445-470 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crab/src/cmd/exp.rs:2371— crab/src/cmd/exp.rs:2371-2396 | crab/src/cmd/migrate.rs:176-204 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/crab-cache-server/src/cache_store.rs:1353— crates/crab-cache-server/src/cache_store.rs:1353-1380 | crates/crab-cache-server/src/cache_store.rs:1473-1498 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crab/src/cmd/artifacts.rs:685— crab/src/cmd/artifacts.rs:685-710 | crab/src/cmd/data.rs:1841-1866 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crab/src/cmd/metrics.rs:4136— crab/src/cmd/metrics.rs:4136-4161 | crates/crab-workflow/src/params_runtime.rs:776-801 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/crab-storage/src/store.rs:917— crates/crab-storage/src/store.rs:917-942 | crates/crab-storage/src/store.rs:1041-1069 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/crab-coordination/src/write_coordinator.rs:982— crates/crab-coordination/src/write_coordinator.rs:982-1010 | crates/crab-coordination/src/write_coordinator.rs:1470-1495 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/crab-staging/src/index.rs:1084— crates/crab-staging/src/index.rs:1084-1113 | crates/crab-staging/src/index.rs:7174-7199 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crab/src/git/clean.rs:1333— crab/src/git/clean.rs:1333-1358 | crab/src/git/clean.rs:1374-1400 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crab/src/replication/mod.rs:1896— crab/src/replication/mod.rs:1896-1922 | crab/src/replication/mod.rs:1977-2002 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crab/src/cmd/replica.rs:7954— crab/src/cmd/replica.rs:7954-7980 | crab/src/cmd/replica.rs:8034-8059 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (26 corresponding lines) crates/crab-workflow/src/stage_dep.rs:43— crates/crab-workflow/src/stage_dep.rs:43-70 | crates/crab-workflow/src/stage_out.rs:143-168 — 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 copies of one member (3 members, 8+ corresponding lines) · ×12
Edited copies of one member (3 members, 8+ corresponding lines) crab/src/maintenance.rs:34— crab/src/maintenance.rs:34-41 | crab/src/maintenance.rs:130-137 | crab/src/maintenance.rs:145-154 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/crab-http-server/src/cells/repository/pulls.rs:785— crates/crab-http-server/src/cells/repository/pulls.rs:785-792 | crates/crab-http-server/src/cells/repository/pulls.rs:797-804 | crates/crab-http-server/src/cells/repository/pulls.rs:1550-1557 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/crab-http-server/src/cells/repository.rs:1303— crates/crab-http-server/src/cells/repository.rs:1303-1310 | crates/crab-http-server/src/cells/repository/checks.rs:733-740 | crates/crab-http-server/src/cells/repository/pulls.rs:1493-1500 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/crab-vfs/src/nfs.rs:1612— crates/crab-vfs/src/nfs.rs:1612-1619 | crates/crab-vfs/src/nfs.rs:1625-1634 | crates/crab-vfs/src/nfs.rs:1636-1643 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crab/src/cmd/fsck_store.rs:358— crab/src/cmd/fsck_store.rs:358-365 | crab/src/cmd/status_workflow.rs:815-822 | crab/src/git/push.rs:18491-18498 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crab/src/cmd/history_recovery.rs:1072— crab/src/cmd/history_recovery.rs:1072-1079 | crates/crab-metadata/src/path_state/storage.rs:292-299 | crates/crab-metadata/src/segmented_store.rs:21-28 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/crab-http-server/src/cells/repository/checks_codec.rs:303— crates/crab-http-server/src/cells/repository/checks_codec.rs:303-313 | crates/crab-http-server/src/cells/repository/codec.rs:645-655 | crates/crab-http-server/src/cells/repository/settings_codec.rs:91-98 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/crab-http-server/src/app.rs:461— crates/crab-http-server/src/app.rs:461-468 | crates/crab-http-server/src/cells/repository/checks.rs:709-716 | crates/crab-http-server/src/checks.rs:175-182 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crab/src/cmd/metadb.rs:1563— crab/src/cmd/metadb.rs:1563-1570 | REDACTED:1863-1872 | crates/crab-workflow/src/lockfile.rs:736-744 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crab/src/lfs/prune.rs:577— crab/src/lfs/prune.rs:577-585 | crates/crab-auth-server/src/receive/git_workspace.rs:1230-1237 | crates/crab-workflow/src/template/context.rs:299-306 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crab/src/cmd/exp.rs:5099— crab/src/cmd/exp.rs:5099-5107 | crates/crab-workflow/src/artifact.rs:1608-1615 | crates/crab-workflow/src/dvc_migration.rs:553-560 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 8+ corresponding lines) crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1407— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1407-1414 | crates/crab-http-server/src/cells/repository/pulls.rs:1467-1474 | crates/crab-http-server/src/cells/repository/releases.rs:922-929 — 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.
crab_git::receive_wire::read_request_with_limits (cognitive 46) crates/crab-git/src/receive_wire.rs:86— crab_git::receive_wire::read_request_with_limits has cognitive complexity 46 (threshold 15). Drivers by points: if/else 13 (32 pts), match/switch 2 (6 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_git::incoming_pack::quarantine (cognitive 39) crates/crab-git/src/incoming_pack.rs:229— crab_git::incoming_pack::quarantine has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 3 (7 pts), loops 4 (6 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_git::receive_plan::validate (cognitive 35) crates/crab-git/src/receive_plan.rs:179— crab_git::receive_plan::validate has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (24 pts), loops 5 (6 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_git::delta::walk_instructions (cognitive 30) crates/crab-git/src/delta.rs:126— crab_git::delta::walk_instructions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 3 (7 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.
crab_git::repack::consolidate_pack_suffix_with_options (cognitive 27) crates/crab-git/src/repack.rs:495— crab_git::repack::consolidate_pack_suffix_with_options has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 6 (12 pts), boolean chains 1, match/switch 1 (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.
crab_git::pack_locator::validate_reverse (cognitive 22) crates/crab-git/src/pack_locator.rs:918— crab_git::pack_locator::validate_reverse has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (20 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_git::worktree::parse_worktree_list_porcelain (cognitive 19) crates/crab-git/src/worktree.rs:334— crab_git::worktree::parse_worktree_list_porcelain has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 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.
crab_git::pre_push::read_pre_push (cognitive 17) crates/crab-git/src/pre_push.rs:23— crab_git::pre_push::read_pre_push has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_git::incoming_pack::prepared::ordered_objects (cognitive 16) crates/crab-git/src/incoming_pack/prepared.rs:491— crab_git::incoming_pack::prepared::ordered_objects has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_git::incoming_pack::prepared::prepare_delta (cognitive 16) crates/crab-git/src/incoming_pack/prepared.rs:528— crab_git::incoming_pack::prepared::prepare_delta has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_git::pointer_ref::resolve_commit (cognitive 16) crates/crab-git/src/pointer_ref.rs:168— crab_git::pointer_ref::resolve_commit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (6 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.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×11
Edited copy of a member (25 corresponding lines) crates/crab-vfs/src/nfs_control.rs:1134— crates/crab-vfs/src/nfs_control.rs:1134-1158 | crates/crab-vfs/src/nfs_control.rs:1183-1212 — 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) crab/src/cmd/dehydrate.rs:789— crab/src/cmd/dehydrate.rs:789-813 | crab/src/lfs/status.rs:400-438 — 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/crab-auth/src/azure_entra.rs:315— crates/crab-auth/src/azure_entra.rs:315-339 | crates/crab-auth/src/gcp_federation.rs:308-332 — 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) crab/src/metadata/metadb/mod.rs:775— crab/src/metadata/metadb/mod.rs:775-799 | crab/src/metadata/metadb/mod.rs:806-830 — 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) crab/src/cmd/hydrate.rs:2940— crab/src/cmd/hydrate.rs:2940-2964 | crab/src/cmd/hydrate.rs:2973-2997 — 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) crab/src/cmd/doctor.rs:1253— crab/src/cmd/doctor.rs:1253-1277 | crates/crab-cache/src/active_probe.rs:224-248 — 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) crab/src/git/progress.rs:649— crab/src/git/progress.rs:649-674 | crab/src/git/progress.rs:687-711 — 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) crab/src/cmd/replica.rs:4836— crab/src/cmd/replica.rs:4836-4860 | crab/src/cmd/replica.rs:4890-4917 — 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/crab-storage/src/store.rs:1319— crates/crab-storage/src/store.rs:1319-1343 | crates/crab-storage/src/store.rs:1366-1390 — 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/crab-vfs/src/coordinator.rs:664— crates/crab-vfs/src/coordinator.rs:664-688 | crates/crab-vfs/src/coordinator.rs:884-911 — 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/crab-remote-git/src/pack.rs:1717— crates/crab-remote-git/src/pack.rs:1717-1749 | crates/crab-remote-git/src/pack.rs:1757-1781 — 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 (24 corresponding lines) · ×11
Edited copy of a member (24 corresponding lines) crab/src/lfs/lock.rs:397— crab/src/lfs/lock.rs:397-430 | crates/crab-lfs/src/lock.rs:445-468 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crates/crab-workflow/src/checkpoint.rs:77— crates/crab-workflow/src/checkpoint.rs:77-100 | crates/crab-workflow/src/external_hash.rs:64-90 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crab/src/lfs/track.rs:272— crab/src/lfs/track.rs:272-303 | crab/src/lfs/track.rs:310-333 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crates/crab-sdk/src/local/push/git.rs:14— crates/crab-sdk/src/local/push/git.rs:14-37 | crates/crab-sdk/src/local/push/git.rs:133-160 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crab/src/cmd/metrics.rs:1263— crab/src/cmd/metrics.rs:1263-1295 | crab/src/cmd/metrics.rs:1301-1324 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crates/crab-workflow/src/lockfile.rs:994— crates/crab-workflow/src/lockfile.rs:994-1019 | crates/crab-workflow/src/lockfile.rs:1071-1094 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crab/src/cmd/lfs/hooks.rs:74— crab/src/cmd/lfs/hooks.rs:74-102 | crab/src/lfs/track.rs:421-444 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crates/crab-coordination/src/write_coordinator.rs:739— crates/crab-coordination/src/write_coordinator.rs:739-764 | crates/crab-coordination/src/write_coordinator.rs:1238-1261 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crab/src/git/smudge.rs:177— crab/src/git/smudge.rs:177-202 | crab/src/git/smudge.rs:223-246 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crab/src/cmd/freeze.rs:354— crab/src/cmd/freeze.rs:354-377 | crab/src/cmd/run.rs:3863-3888 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (24 corresponding lines) crab/scripts/check-architecture-gates.py:4895— crab/scripts/check-architecture-gates.py:4895-4968 | crab/scripts/release/check-shipped-binary-versions.py:86-109 — 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 (20 corresponding lines) · ×11
Edited copy of a member (20 corresponding lines) crates/crab-workflow/src/yaml.rs:566— crates/crab-workflow/src/yaml.rs:566-589 | crates/crab-workflow/src/yaml.rs:703-722 — 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/crab-http-server/src/catalog.rs:384— crates/crab-http-server/src/catalog.rs:384-409 | crates/crab-http-server/src/catalog.rs:418-437 — 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/crab-auth/src/managed/client.rs:1026— crates/crab-auth/src/managed/client.rs:1026-1045 | crates/crab-auth/src/managed/client.rs:1052-1071 — 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) crab/src/cmd/run.rs:2445— crab/src/cmd/run.rs:2445-2464 | crab/src/cmd/run.rs:4413-4436 — 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) crab/src/git/incremental_walk.rs:450— crab/src/git/incremental_walk.rs:450-473 | crab/src/git/pack_native.rs:148-167 — 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) crab/src/cmd/lfs/env.rs:84— crab/src/cmd/lfs/env.rs:84-103 | crab/src/cmd/lock.rs:230-249 — 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/crab-s3-gateway/src/namespace.rs:111— crates/crab-s3-gateway/src/namespace.rs:111-130 | crates/crab-s3-gateway/src/namespace.rs:132-155 — 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) crab/src/cmd/lfs/install.rs:146— crab/src/cmd/lfs/install.rs:146-170 | crab/src/cmd/lfs/update.rs:42-61 — 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) crab/src/cmd/replica.rs:2371— crab/src/cmd/replica.rs:2371-2390 | crab/src/cmd/replica.rs:2392-2411 — 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/crab-staging/src/index.rs:1389— crates/crab-staging/src/index.rs:1389-1415 | crates/crab-staging/src/index.rs:7685-7704 — 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) crab/src/cmd/replica.rs:12842— crab/src/cmd/replica.rs:12842-12861 | crab/src/cmd/replica.rs:12863-12888 — 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.
Duplicated block (10 lines × 3) crab/src/cmd/push.rs:780— crab/src/cmd/push.rs:780-789 | crab/src/cmd/push.rs:815-824 | crab/src/cmd/push.rs:878-887 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) crab/src/cmd/run.rs:3436— crab/src/cmd/run.rs:3436-3445 | REDACTED:2299-2308 | REDACTED:2454-2463 — before extracting anything, compare `crab/src/cmd/run.rs` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 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 `crab/src/cmd/run.rs:3436` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) crates/crab-auth/src/aws_oidc.rs:166— crates/crab-auth/src/aws_oidc.rs:166-175 | crates/crab-auth/src/azure_entra.rs:192-201 | crates/crab-auth/src/gcp_federation.rs:222-231 — before extracting anything, compare `crates/crab-auth/src/aws_oidc.rs` and `crates/crab-auth/src/azure_entra.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-auth/src/aws_oidc.rs:166` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 3) crates/crab-cache/src/local_cache/maintenance.rs:413— crates/crab-cache/src/local_cache/maintenance.rs:413-422 | crates/crab-cache/src/local_cache/maintenance.rs:459-468 | crates/crab-cache/src/xet_chunk_cache.rs:708-717 — 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/crab-cache/src/local_cache/maintenance.rs:413` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) crates/crab-remote-git/src/operation.rs:979— crates/crab-remote-git/src/operation.rs:979-988 | crates/crab-remote-git/src/operation.rs:1087-1096 | crates/crab-remote-git/src/operation.rs:1109-1118 — 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/crab-remote-git/src/operation.rs:979` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) crates/crab-staging/src/index.rs:2748— crates/crab-staging/src/index.rs:2748-2757 | crates/crab-staging/src/index.rs:3265-3277 | crates/crab-staging/src/index.rs:6790-6801 — 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/crab-staging/src/index.rs:2748` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) crab/src/cost/inventory/report/azure.rs:52— crab/src/cost/inventory/report/azure.rs:52-61 | crab/src/cost/inventory/report/gcs.rs:56-65 | crab/src/cost/inventory/report/s3.rs:62-71 — before extracting anything, compare `crab/src/cost/inventory/report/azure.rs` and `crab/src/cost/inventory/report/gcs.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 3) crates/crab-metadata/src/git_visibility.rs:2512— crates/crab-metadata/src/git_visibility.rs:2512-2521 | crates/crab-metadata/src/git_visibility.rs:3051-3060 | crates/crab-metadata/src/git_visibility.rs:3120-3129 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) crab/src/cmd/add.rs:1298— crab/src/cmd/add.rs:1298-1307 | crab/src/cmd/add.rs:1373-1382 | crab/src/cmd/add.rs:1397-1406 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) crates/crab-remote-git/src/operation.rs:324— crates/crab-remote-git/src/operation.rs:324-333 | crates/crab-remote-git/src/operation.rs:440-449 | crates/crab-remote-git/src/operation.rs:525-534 — 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/crab-remote-git/src/operation.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 (10 lines × 3) crab/scripts/verify-nfs-smoke-report.py:3882— crab/scripts/verify-nfs-smoke-report.py:3882-3891 | crab/scripts/verify-nfs-smoke-report.py:3900-3909 | crab/scripts/verify-nfs-smoke-report.py:3918-3929 — 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 `crab/scripts/verify-nfs-smoke-report.py:3918` it does not close everything it opens, so those 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 × 3) crab/src/cmd/recover.rs:2965— crab/src/cmd/recover.rs:2965-2969 | crab/src/cmd/status_workflow.rs:829-834 | crab/src/lfs/prune.rs:449-453 — 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 `crab/src/cmd/recover.rs:2965` it begins part-way through the construct above it, so those exact lines 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/crab-http-server/src/cells/repository/pull_review_threads.rs:1378— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1378-1382 | crates/crab-http-server/src/cells/repository/pulls.rs:1613-1617 | crates/crab-http-server/src/cells/repository/releases.rs:1181-1185 — before extracting anything, compare `crates/crab-http-server/src/cells/repository/pull_review_threads.rs` and `crates/crab-http-server/src/cells/repository/pulls.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1378` it does not close everything it opens, so those exact lines 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/crab-staging/src/index.rs:4025— crates/crab-staging/src/index.rs:4025-4029 | crates/crab-staging/src/index.rs:6810-6814 | crates/crab-staging/src/index.rs:7362-7366 — 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/crab-staging/src/index.rs:4025` it does not close everything it opens, so those exact lines 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/crab-staging/src/lib.rs:3171— crates/crab-staging/src/lib.rs:3171-3177 | crates/crab-staging/src/lib.rs:3320-3324 | crates/crab-staging/src/lib.rs:4213-4219 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) crates/crab-vfs/src/daemon.rs:938— crates/crab-vfs/src/daemon.rs:938-942 | crates/crab-vfs/src/mount_runtime.rs:100-104 | crates/crab-vfs/src/refresh.rs:848-852 — 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 (5 lines × 3) crates/crab-vfs/src/overlay.rs:573— crates/crab-vfs/src/overlay.rs:573-577 | crates/crab-vfs/src/overlay.rs:606-610 | crates/crab-vfs/src/overlay.rs:751-756 — 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/crab-vfs/src/overlay.rs:573` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 3) crates/crab-metadata/src/path_state/storage.rs:99— crates/crab-metadata/src/path_state/storage.rs:99-103 | crates/crab-metadata/src/shallow_closure.rs:349-353 | crates/crab-metadata/src/split_commit_graph.rs:793-797 — 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/crab-metadata/src/path_state/storage.rs:99` it begins part-way through the construct above it, so those exact lines 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/crab-coordination/src/cosmosdb_coordinator.rs:820— crates/crab-coordination/src/cosmosdb_coordinator.rs:820-824 | crates/crab-coordination/src/dynamodb_coordinator.rs:1088-1092 | crates/crab-coordination/src/spanner_coordinator.rs:1223-1227 — 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 (5 lines × 3) crates/crab-http-server/src/checks.rs:851— crates/crab-http-server/src/checks.rs:851-855 | crates/crab-http-server/src/labels.rs:333-337 | crates/crab-http-server/src/statuses.rs:360-364 — before extracting anything, compare `crates/crab-http-server/src/checks.rs` and `crates/crab-http-server/src/labels.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) crates/crab-staging/src/index.rs:1669— crates/crab-staging/src/index.rs:1669-1673 | crates/crab-staging/src/index.rs:6124-6128 | crates/crab-staging/src/index.rs:7441-7445 — 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/crab-staging/src/index.rs:1669` 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 × 3) crab/src/cmd/gc/journal.rs:609— crab/src/cmd/gc/journal.rs:609-613 | crab/src/cmd/gc/journal.rs:622-626 | crab/src/cmd/gc/journal.rs:645-649 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/journal.rs:609` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
X18 · Disposal-pattern correctness· Explicit release owed and not made on every path · ×11
Explicit release owed and not made on every path crates/crab-read/src/term_resolver.rs:124— `file_index_lookup` (line 124) is a `SharedFileIndexLookup` this function owns and never releases: no `close()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `SharedFileIndexLookup` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
Explicit release owed and not made on every path crates/crab-read/src/term_resolver.rs:271— `file_index_lookup` (line 271) is a `SharedFileIndexLookup` this function owns and never releases: no `close()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `SharedFileIndexLookup` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
Explicit release owed and not made on every path crates/crab-http-server/src/transfer_admission.rs:49— `ticket` (line 49) is a `FixedSlotAdmissionTicket` released by `release()` only on the path that reaches line 58; the `return` on line 58 leaves before that with a success value, and on that path `FixedSlotAdmissionTicket` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it before that `return` too (or return an error there, if the early exit is a failure).
Explicit release owed and not made on every path crab/src/import/coordinator.rs:198— `journal` (line 198) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
Explicit release owed and not made on every path crab/src/import/coordinator.rs:1855— `journal` (line 1855) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
Explicit release owed and not made on every path crab/src/cmd/run.rs:698— `journal` (line 698) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
Explicit release owed and not made on every path crab/src/cmd/run.rs:1370— `journal` (line 1370) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
Explicit release owed and not made on every path crab/src/cmd/run.rs:1506— `journal` (line 1506) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
Explicit release owed and not made on every path crab/src/cmd/run.rs:2147— `journal` (line 2147) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
Explicit release owed and not made on every path crab/src/cmd/run.rs:4782— `journal` (line 4782) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
Explicit release owed and not made on every path crab/src/cmd/workflow_journal.rs:254— `journal` (line 254) is a `Journal` this function owns and never releases: no `close()` or `drop_file()` on any path, and it is not handed on. Rust drops it at the end of the scope, and `Journal` has no `Drop`, so what it holds is only completed by that call and is lost without it. Release it where the work ends.
crab_read::upload_pack::plan_with_operation (cognitive 81) crates/crab-read/src/upload_pack.rs:640— crab_read::upload_pack::plan_with_operation has cognitive complexity 81 (threshold 15). Drivers by points: if/else 27 (63 pts), loops 6 (11 pts), boolean chains 7 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_read::upload_pack::enqueue_children (cognitive 64) crates/crab-read/src/upload_pack.rs:1810— crab_read::upload_pack::enqueue_children has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (42 pts), loops 5 (16 pts), boolean chains 3, match/switch 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.
crab_read::selection::referenced_object_gap (cognitive 46) crates/crab-read/src/selection.rs:320— crab_read::selection::referenced_object_gap has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 4 (10 pts), match/switch 3 (7 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_read::upload_pack_wire::parse_fetch (cognitive 39) crates/crab-read/src/upload_pack_wire.rs:204— crab_read::upload_pack_wire::parse_fetch has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (28 pts), boolean chains 8, match/switch 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_read::upload_pack::visibility_object_selection (cognitive 31) crates/crab-read/src/upload_pack.rs:955— crab_read::upload_pack::visibility_object_selection has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 3 (6 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_read::integrity::verify_origin_recipe (cognitive 30) crates/crab-read/src/integrity.rs:17— crab_read::integrity::verify_origin_recipe has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (21 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_read::upload_pack_wire::read_command_request (cognitive 27) crates/crab-read/src/upload_pack_wire.rs:74— crab_read::upload_pack_wire::read_command_request has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 3 (5 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.
crab_read::store_client::build_range_response_v2 (cognitive 21) crates/crab-read/src/store_client.rs:397— crab_read::store_client::build_range_response_v2 has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 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.
crab_read::upload_pack::parse_filter_component (cognitive 21) crates/crab-read/src/upload_pack.rs:125— crab_read::upload_pack::parse_filter_component has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 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.
crab_read::upload_pack::plan_from_visibility_catalog_ordinals (cognitive 19) crates/crab-read/src/upload_pack.rs:1361— crab_read::upload_pack::plan_from_visibility_catalog_ordinals has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×10
Edited copy of a member (27 corresponding lines) crab/src/cmd/params.rs:579— crab/src/cmd/params.rs:579-611 | crab/src/cmd/params.rs:631-676 — 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/crab-cache-server/src/handlers.rs:1964— crates/crab-cache-server/src/handlers.rs:1964-1990 | crates/crab-cache-server/src/handlers.rs:1996-2032 — 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/crab-lfs/src/lock.rs:178— crates/crab-lfs/src/lock.rs:178-213 | crates/crab-lfs/src/lock.rs:234-260 — 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) crab/src/cmd/add.rs:863— crab/src/cmd/add.rs:863-889 | crab/src/git/progress.rs:1894-1920 — 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) crab/src/cmd/replica.rs:7275— crab/src/cmd/replica.rs:7275-7301 | crab/src/cmd/replica.rs:7310-7336 — 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/crab-workflow/src/signals.rs:754— crates/crab-workflow/src/signals.rs:754-781 | crates/crab-workflow/src/signals.rs:788-814 — 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) crab/src/cmd/mount.rs:3168— crab/src/cmd/mount.rs:3168-3194 | crab/src/cmd/mount.rs:3199-3229 — 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/crab-http-server/src/releases/storage.rs:116— crates/crab-http-server/src/releases/storage.rs:116-144 | crates/crab-http-server/src/releases/storage.rs:152-178 — 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/crab-coordination/src/write_coordinator.rs:1046— crates/crab-coordination/src/write_coordinator.rs:1046-1074 | crates/crab-coordination/src/write_coordinator.rs:1521-1547 — 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/crab-workflow/src/yaml.rs:527— crates/crab-workflow/src/yaml.rs:527-555 | crates/crab-workflow/src/yaml.rs:671-697 — 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.
Duplicated block (19 lines × 2) crab/src/cmd/data.rs:1940— crab/src/cmd/data.rs:1940-1958 | crates/crab-workflow/src/stage_runtime.rs:167-185 — 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 (19 lines × 2) crab/src/cmd/lfs/fetch.rs:256— crab/src/cmd/lfs/fetch.rs:256-274 | crab/src/lfs/batch.rs:143-161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crab/src/lfs/batch.rs:142` calls `check_cancelled` and `crab/src/cmd/lfs/fetch.rs:255` 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 (19 lines × 2) crab/src/cmd/run.rs:2174— crab/src/cmd/run.rs:2174-2192 | crab/src/cmd/run.rs:2808-2826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/run.rs:2174` 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 lines × 2) crab/src/replication/mod.rs:5171— crab/src/replication/mod.rs:5171-5189 | crab/src/replication/mod.rs:5310-5328 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 2) crates/crab-coordination/src/gc_fence.rs:1019— crates/crab-coordination/src/gc_fence.rs:1019-1037 | crates/crab-coordination/src/gc_fence.rs:1075-1093 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-coordination/src/gc_fence.rs:1019` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) crates/crab-http-server/src/pulls.rs:507— crates/crab-http-server/src/pulls.rs:507-525 | crates/crab-http-server/src/pulls.rs:633-651 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/pulls.rs:507` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) REDACTED:1668— REDACTED:1668-1686 | REDACTED:1728-1746 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:1668` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) crates/crab-workflow/src/lockfile.rs:282— crates/crab-workflow/src/lockfile.rs:282-300 | crates/crab-workflow/src/lockfile.rs:315-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-workflow/src/lockfile.rs:282` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) crab/src/cmd/recover.rs:2023— crab/src/cmd/recover.rs:2023-2041 | crab/src/cmd/recover.rs:2280-2298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/recover.rs:2023` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crab/src/cmd/recover.rs:2299` calls `verify_pack_body`, `verified_pack_metadata`, `validate_pack_metadata_object_count` and `crab/src/cmd/recover.rs:2042` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (19 lines × 2) crab/scripts/verify-nfs-smoke-report.py:4333— crab/scripts/verify-nfs-smoke-report.py:4333-4351 | crab/scripts/verify-nfs-smoke-report.py:4358-4376 — both copies are in the same file, so extract the block into 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–14 lines × 2) crab/src/cmd/doctor.rs:2102— crab/src/cmd/doctor.rs:2102-2115 | crates/crab-cache-server/src/onboarding.rs:742-754 — 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 (13–14 lines × 2) crab/src/cmd/repack.rs:560— crab/src/cmd/repack.rs:560-572 | crab/src/replication/mod.rs:8212-8225 — 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 `crab/src/cmd/repack.rs:560` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 lines × 2) crab/src/replication/mod.rs:1909— crab/src/replication/mod.rs:1909-1922 | crab/src/replication/mod.rs:1990-2002 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/replication/mod.rs:1909` it begins part-way through the construct above it, so those exact lines 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) crates/crab-auth-server/src/receive.rs:1837— crates/crab-auth-server/src/receive.rs:1837-1849 | crates/crab-write/src/catalog.rs:706-719 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13–14 lines × 2) crates/crab-metadata/src/pack_origin.rs:152— crates/crab-metadata/src/pack_origin.rs:152-165 | crates/crab-metadata/src/pack_origin.rs:226-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-metadata/src/pack_origin.rs:152` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 lines × 2) crates/crab-remote-git/src/runtime.rs:481— crates/crab-remote-git/src/runtime.rs:481-494 | crates/crab-remote-git/src/runtime.rs:602-614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-remote-git/src/runtime.rs:481` it begins part-way through the construct above it, so those exact lines 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) crates/crab-storage/src/head_batch.rs:156— crates/crab-storage/src/head_batch.rs:156-169 | crates/crab-storage/src/head_batch.rs:230-242 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-storage/src/head_batch.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 (13–14 lines × 2) crates/crab-storage/src/store.rs:335— crates/crab-storage/src/store.rs:335-348 | crates/crab-storage/src/store.rs:364-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-storage/src/store.rs:335` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 lines × 2) crates/crab-workflow/src/template/foreach.rs:139— crates/crab-workflow/src/template/foreach.rs:139-152 | crates/crab-workflow/src/template/matrix.rs:178-190 — before extracting anything, compare `crates/crab-workflow/src/template/foreach.rs` and `crates/crab-workflow/src/template/matrix.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 106 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 (13–14 lines × 2) crates/crab-s3-gateway/src/gateway.rs:2261— crates/crab-s3-gateway/src/gateway.rs:2261-2273 | crates/crab-s3-gateway/src/gateway.rs:2379-2392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `req` to `S3Request<UploadPartInput>` in one and `S3Request<UploadPartCopyInput>` 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 × 3) crab/src/cmd/run.rs:2173— crab/src/cmd/run.rs:2173-2186 | crab/src/cmd/run.rs:2807-2820 | crab/src/cmd/run.rs:3599-3611 — 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 `crab/src/cmd/run.rs:2173` 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 × 3) crab/src/core/config.rs:1386— crab/src/core/config.rs:1386-1398 | crab/src/read/mod.rs:774-786 | crates/crab-git/src/discover.rs:72-84 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `git_dir` to `&std::path::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 (13 lines × 3) crab/src/git/progress.rs:336— crab/src/git/progress.rs:336-348 | crab/src/git/progress.rs:392-404 | crab/src/git/progress.rs:441-453 — 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 `crab/src/git/progress.rs:336` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) crab/src/git/push.rs:11294— crab/src/git/push.rs:11294-11306 | crab/src/git/push.rs:11330-11342 | crab/src/git/push.rs:11369-11381 — 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 `crab/src/git/push.rs:11294` it does not close everything it opens, so those exact lines 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 × 3) crab/src/lfs/lock.rs:316— crab/src/lfs/lock.rs:316-328 | crab/src/lfs/lock.rs:362-374 | crab/src/lfs/lock.rs:418-430 — 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 `crab/src/lfs/lock.rs:316` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) crab/src/replication/mod.rs:5175— crab/src/replication/mod.rs:5175-5187 | crab/src/replication/mod.rs:5314-5326 | crab/src/replication/mod.rs:5334-5346 — 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 (13 lines × 3) crates/crab-metadata/src/git_visibility.rs:1925— crates/crab-metadata/src/git_visibility.rs:1925-1937 | crates/crab-metadata/src/git_visibility.rs:2252-2264 | crates/crab-metadata/src/git_visibility.rs:2377-2389 — 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/crab-metadata/src/git_visibility.rs:1925` 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 × 3) crates/crab-staging/src/index.rs:2723— crates/crab-staging/src/index.rs:2723-2735 | crates/crab-staging/src/index.rs:3225-3237 | crates/crab-staging/src/index.rs:6765-6777 — 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/crab-staging/src/index.rs:2723` it begins part-way through the construct above it, so those exact lines 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 × 3) crab/scripts/check-architecture-gates.py:4675— crab/scripts/check-architecture-gates.py:4675-4687 | crab/scripts/check-architecture-gates.py:4784-4796 | crab/scripts/check-architecture-gates.py:4825-4837 — 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 lines × 3) crab/scripts/verify-nfs-smoke-report.py:4433— crab/scripts/verify-nfs-smoke-report.py:4433-4445 | crab/scripts/verify-nfs-smoke-report.py:4517-4529 | crab/scripts/verify-nfs-smoke-report.py:4613-4625 — 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 `crab/scripts/verify-nfs-smoke-report.py:4433` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 3) crab/src/cmd/gc/mod.rs:1726— crab/src/cmd/gc/mod.rs:1726-1736 | crab/src/cmd/gc/mod.rs:2311-2321 | crab/src/cmd/history_recovery.rs:737-747 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 3) crab/src/core/config_resolver.rs:246— crab/src/core/config_resolver.rs:246-256 | crates/crab-workflow/src/exp_worktree.rs:383-393 | crates/crab-workflow/src/params_runtime.rs:302-312 — 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 `crab/src/core/config_resolver.rs:246` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) crates/crab-sdk/src/local/push/git.rs:15— crates/crab-sdk/src/local/push/git.rs:15-25 | crates/crab-sdk/src/local/push/git.rs:66-76 | crates/crab-sdk/src/local/push/git.rs:134-144 — 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/crab-sdk/src/local/push/git.rs:15` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) crates/crab-sdk/src/managed.rs:306— crates/crab-sdk/src/managed.rs:306-316 | crates/crab-sdk/src/managed.rs:336-346 | crates/crab-sdk/src/managed.rs:366-376 — 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/crab-sdk/src/managed.rs:306` it does not close everything it opens, so those 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/crab-sdk/src/managed.rs:305` calls `to_owned` and `crates/crab-sdk/src/managed.rs:335` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) crab/src/cmd/artifacts.rs:774— crab/src/cmd/artifacts.rs:774-784 | crab/src/cmd/data.rs:1806-1816 | crab/src/cmd/migrate.rs:63-73 — before extracting anything, compare `crab/src/cmd/artifacts.rs` and `crab/src/cmd/data.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 × 3) crates/crab-auth-server/src/receive.rs:796— crates/crab-auth-server/src/receive.rs:796-806 | crates/crab-xet/src/shard.rs:550-560 | crates/crab-xet/src/shard_parse.rs:174-184 — 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/crab-xet/src/shard.rs:550` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) crates/crab-auth/src/managed/client.rs:264— crates/crab-auth/src/managed/client.rs:264-274 | crates/crab-auth/src/managed/client.rs:377-389 | crates/crab-auth/src/managed/client.rs:927-937 — 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/crab-auth/src/managed/client.rs:264` 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 × 3) crab/src/cmd/replica.rs:4432— crab/src/cmd/replica.rs:4432-4442 | crab/src/cmd/replica.rs:4449-4459 | crab/src/cmd/replica.rs:4466-4476 — 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 `crab/src/cmd/replica.rs:4432` 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 × 3) crab/src/replication/mod.rs:4118— crab/src/replication/mod.rs:4118-4128 | crab/src/replication/mod.rs:4146-4156 | crab/src/replication/mod.rs:4180-4190 — 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 `crab/src/replication/mod.rs:4118` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) crab/scripts/verify-nfs-smoke-report.py:1347— crab/scripts/verify-nfs-smoke-report.py:1347-1357 | crab/scripts/verify-nfs-smoke-report.py:1681-1691 | crab/scripts/verify-nfs-smoke-report.py:1771-1781 — 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, `crab/scripts/verify-nfs-smoke-report.py:1358` calls `isinstance`, `get` and `crab/scripts/verify-nfs-smoke-report.py:1692` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 4) crab/src/cmd/exp.rs:5600— crab/src/cmd/exp.rs:5600-5607 | crab/src/cmd/metrics.rs:3537-3544 | crab/src/cmd/params.rs:382-389 | crates/crab-workflow/src/params_runtime.rs:515-522 — before extracting anything, compare `crab/src/cmd/exp.rs` and `crab/src/cmd/metrics.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/exp.rs:5600` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) crab/src/cmd/metadb.rs:1774— crab/src/cmd/metadb.rs:1774-1781 | crab/src/cmd/repack.rs:1337-1344 | crab/src/git/push.rs:18797-18806 | crab/src/optimize/xorbs/reconcile.rs:770-777 — before extracting anything, compare `crab/src/cmd/repack.rs` and `crab/src/git/push.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/metadb.rs:1774` 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 × 4) crab/src/cmd/metadb.rs:2872— crab/src/cmd/metadb.rs:2872-2879 | crab/src/git/push.rs:13310-13317 | crates/crab-auth-server/src/receive.rs:1563-1570 | crates/crab-auth-server/src/receive/git_workspace.rs:436-443 — before extracting anything, compare `crab/src/cmd/metadb.rs` and `crates/crab-auth-server/src/receive.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) crates/crab-cache/src/local_cache.rs:586— crates/crab-cache/src/local_cache.rs:586-593 | crates/crab-cache/src/local_cache.rs:624-631 | crates/crab-cache/src/local_cache.rs:641-648 | crates/crab-cache/src/local_cache.rs:780-787 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) crates/crab-lfs/src/lock.rs:300— crates/crab-lfs/src/lock.rs:300-307 | crates/crab-lfs/src/lock.rs:356-363 | crates/crab-lfs/src/lock.rs:414-421 | crates/crab-lfs/src/lock.rs:476-483 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-lfs/src/lock.rs:300` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) crab/src/lfs/lifecycle.rs:282— crab/src/lfs/lifecycle.rs:282-289 | crates/crab-http-server/src/git_import.rs:1064-1071 | crates/crab-read/src/upload_pack.rs:247-254 | crates/crab-vfs/src/nfs.rs:1887-1894 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (8 lines × 4) crates/crab-staging/src/index.rs:2899— crates/crab-staging/src/index.rs:2899-2908 | crates/crab-staging/src/index.rs:2923-2930 | crates/crab-staging/src/index.rs:5272-5279 | crates/crab-staging/src/index.rs:5364-5371 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-staging/src/index.rs:2899` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 4) crab/src/cmd/dehydrate.rs:1164— crab/src/cmd/dehydrate.rs:1164-1171 | crab/src/cmd/hydrate.rs:2031-2038 | crab/src/cmd/status.rs:1033-1040 | crab/src/cost/report.rs:93-100 — before extracting anything, compare `crab/src/cmd/dehydrate.rs` and `crab/src/cmd/hydrate.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 223 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 `crab/src/cmd/dehydrate.rs:1164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 4) crab/scripts/check-architecture-gates.py:2658— crab/scripts/check-architecture-gates.py:2658-2665 | crab/scripts/check-architecture-gates.py:2704-2711 | crab/scripts/check-architecture-gates.py:2754-2761 | crab/scripts/check-architecture-gates.py:2804-2811 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) crab/scripts/verify-cache-service-smoke-report.py:684— crab/scripts/verify-cache-service-smoke-report.py:684-691 | crab/scripts/verify-cache-service-smoke-report.py:711-718 | crab/scripts/verify-cache-service-smoke-report.py:738-745 | crab/scripts/verify-cache-service-smoke-report.py:1435-1443 — 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 `crab/scripts/verify-cache-service-smoke-report.py:684` it does not close everything it opens, so those 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, `crab/scripts/verify-cache-service-smoke-report.py:1443` calls `int_value` and `crab/scripts/verify-cache-service-smoke-report.py:691` 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 × 4) crab/src/git/incremental_walk.rs:103— crab/src/git/incremental_walk.rs:103-109 | crates/crab-vfs/src/engine.rs:179-185 | crates/crab-vfs/src/snapshot.rs:558-564 | crates/crab-workflow/src/params_runtime.rs:373-379 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times. 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 × 4) crates/crab-http-server/src/cells/repository/checks.rs:685— crates/crab-http-server/src/cells/repository/checks.rs:685-691 | crates/crab-http-server/src/cells/repository/pull_review_threads.rs:824-830 | crates/crab-http-server/src/cells/repository/pulls.rs:672-678 | crates/crab-http-server/src/cells/repository/releases.rs:842-848 — before extracting anything, compare `crates/crab-http-server/src/cells/repository/pull_review_threads.rs` and `crates/crab-http-server/src/cells/repository/pulls.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/cells/repository/checks.rs:685` it does not close everything it opens, so those 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 × 4) crates/crab-staging/src/index.rs:2735— crates/crab-staging/src/index.rs:2735-2741 | crates/crab-staging/src/index.rs:3162-3168 | crates/crab-staging/src/index.rs:3249-3255 | crates/crab-staging/src/index.rs:6777-6783 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-staging/src/index.rs:2735` it begins part-way through the construct above it, so those 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/crab-staging/src/index.rs:3256` calls `push` and `crates/crab-staging/src/index.rs:2742` 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 × 4) crab/src/git/clean.rs:2677— crab/src/git/clean.rs:2677-2683 | crab/src/git/delta_reconstruct.rs:217-223 | crab/src/git/smudge.rs:767-773 | crates/crab-vfs/src/hydration.rs:1503-1509 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (7 lines × 4) crates/crab-http-server/src/checks.rs:843— crates/crab-http-server/src/checks.rs:843-849 | crates/crab-http-server/src/issues.rs:128-134 | crates/crab-http-server/src/labels.rs:313-319 | crates/crab-http-server/src/statuses.rs:352-358 — before extracting anything, compare `crates/crab-http-server/src/checks.rs` and `crates/crab-http-server/src/issues.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) crab/src/cmd/managed_admin.rs:421— crab/src/cmd/managed_admin.rs:421-427 | crab/src/cmd/managed_admin.rs:438-445 | crab/src/cmd/managed_admin.rs:456-463 | crab/src/cmd/managed_admin.rs:474-481 — 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 `crab/src/cmd/managed_admin.rs:421` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crab/src/cmd/managed_admin.rs:421` calls `revision_etag` and `crab/src/cmd/managed_admin.rs:438` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 4) crab/src/cmd/recover.rs:2011— crab/src/cmd/recover.rs:2011-2017 | crab/src/cmd/recover.rs:2125-2131 | crab/src/cmd/recover.rs:2268-2274 | crab/src/cmd/recover.rs:2677-2683 — 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 (7 lines × 4) crab/src/cmd/gc/bucket.rs:1461— crab/src/cmd/gc/bucket.rs:1461-1467 | crab/src/cmd/gc/bucket.rs:1655-1661 | crab/src/cmd/gc/bucket.rs:1719-1725 | crab/src/cmd/gc/bucket.rs:1792-1798 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) crab/src/cmd/exp.rs:2004— crab/src/cmd/exp.rs:2004-2010 | crab/src/cmd/migrate.rs:1320-1326 | crab/src/cmd/migrate.rs:2663-2669 | crab/src/cmd/workflow_checkpoint.rs:615-621 — before extracting anything, compare `crab/src/cmd/exp.rs` and `crab/src/cmd/migrate.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 × 4) REDACTED:376— REDACTED:376-382 | crates/crab-http-server/deploy/cell-issue-fleet/qualify_mode_rollout.py:94-100 | REDACTED:467-473 | crates/crab-http-server/deploy/cell-issue-fleet/render.py:267-273 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/crab-http-server/deploy/cell-issue-fleet/qualify_mode_rollout.py:102` calls `add_argument` and `REDACTED:475` 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.
crab_metadata::git_visibility::storage::apply_catalog_journal_edits (cyclomatic 41) crates/crab-metadata/src/git_visibility.rs:3352— crab_metadata::git_visibility::storage::apply_catalog_journal_edits 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.
crab_metadata::split_commit_graph::update_split_commit_graph (cyclomatic 29) crates/crab-metadata/src/split_commit_graph.rs:425— crab_metadata::split_commit_graph::update_split_commit_graph 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.
crab_metadata::ref_journal::materialize_ref_journal (cyclomatic 24) crates/crab-metadata/src/ref_journal.rs:625— crab_metadata::ref_journal::materialize_ref_journal has cyclomatic complexity 24 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
crab_metadata::path_state::codec::decode_layer (cyclomatic 23) crates/crab-metadata/src/path_state/codec.rs:42— crab_metadata::path_state::codec::decode_layer 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.
crab_metadata::ref_journal::validate_transaction (cyclomatic 23) crates/crab-metadata/src/ref_journal.rs:1038— crab_metadata::ref_journal::validate_transaction 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.
crab_metadata::ref_journal::commit_ref_transaction_inner (cyclomatic 19) crates/crab-metadata/src/ref_journal.rs:247— crab_metadata::ref_journal::commit_ref_transaction_inner has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab_metadata::git_object_locator::reader::lookup_strategy (cyclomatic 18) crates/crab-metadata/src/git_object_locator/reader.rs:892— crab_metadata::git_object_locator::reader::lookup_strategy has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
crab_metadata::path_state::append_path_state (cyclomatic 16) crates/crab-metadata/src/path_state.rs:294— crab_metadata::path_state::append_path_state 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.
crab_metadata::path_state::validate_descriptor (cyclomatic 16) crates/crab-metadata/src/path_state.rs:710— crab_metadata::path_state::validate_descriptor 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.
crab_staging::add_push_plan::prepare_one_file_plan_with_existing_refs (cognitive 48) crates/crab-staging/src/add_push_plan.rs:748— crab_staging::add_push_plan::prepare_one_file_plan_with_existing_refs has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (40 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_staging::stream::stage_file_streaming_inner (cognitive 41) crates/crab-staging/src/stream.rs:602— crab_staging::stream::stage_file_streaming_inner has cognitive complexity 41 (threshold 15). Drivers by points: if/else 24 (31 pts), boolean chains 6, match/switch 4 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
crab_staging::stream::flush_batch (cognitive 38) crates/crab-staging/src/stream.rs:1351— crab_staging::stream::flush_batch has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 5 (12 pts), boolean chains 3 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_staging::stage_owned_chunks_batch_blocking (cognitive 26) crates/crab-staging/src/lib.rs:1808— crab_staging::stage_owned_chunks_batch_blocking has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_staging::read_prepared_staged_chunks_batch (cognitive 23) crates/crab-staging/src/lib.rs:1445— crab_staging::read_prepared_staged_chunks_batch has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_staging::add_push_plan::prepare_uncached_file_plans_with_progress (cognitive 22) crates/crab-staging/src/add_push_plan.rs:378— crab_staging::add_push_plan::prepare_uncached_file_plans_with_progress has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 6 (8 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_staging::stream::stream_chunk_and_stage_producer (cognitive 17) crates/crab-staging/src/stream.rs:1052— crab_staging::stream::stream_chunk_and_stage_producer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 2 (3 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.
crab_staging::verify_pending_recipe_payload (cognitive 16) crates/crab-staging/src/lib.rs:1597— crab_staging::verify_pending_recipe_payload has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_staging::push_plan::accumulate_file_plan_for_hash (cognitive 16) crates/crab-staging/src/push_plan.rs:945— crab_staging::push_plan::accumulate_file_plan_for_hash has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_vfs::publish::commit_overlay_with_snapshot (cognitive 38) crates/crab-vfs/src/publish.rs:253— crab_vfs::publish::commit_overlay_with_snapshot has cognitive complexity 38 (threshold 15). Drivers by points: if/else 24 (37 pts), match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_vfs::publish::export_overlay_with_view (cognitive 21) crates/crab-vfs/src/publish.rs:158— crab_vfs::publish::export_overlay_with_view has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (18 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.
crab_vfs::nfs_mount::run_until_cancelled (cognitive 18) crates/crab-vfs/src/nfs_mount.rs:255— crab_vfs::nfs_mount::run_until_cancelled has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 7). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
crab_vfs::snapshot::deserialize_base_node (cognitive 18) crates/crab-vfs/src/snapshot.rs:831— crab_vfs::snapshot::deserialize_base_node has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (17 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
crab_vfs::ipc_server::handle_mount (cognitive 17) crates/crab-vfs/src/ipc_server.rs:555— crab_vfs::ipc_server::handle_mount has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, match/switch 7, boolean chains 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
crab_vfs::nfs_control::run_unix_server (cognitive 17) crates/crab-vfs/src/nfs_control.rs:839— crab_vfs::nfs_control::run_unix_server has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_vfs::publish::stage_crab_overlay_files (cognitive 17) crates/crab-vfs/src/publish.rs:1419— crab_vfs::publish::stage_crab_overlay_files has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_vfs::signal_handler::run_signal_handler (cognitive 17) crates/crab-vfs/src/signal_handler.rs:42— crab_vfs::signal_handler::run_signal_handler has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (8 pts), if/else 5 (7 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
crab_vfs::publish::apply_records (cognitive 16) crates/crab-vfs/src/publish.rs:827— crab_vfs::publish::apply_records has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyFields: Metrics crab/src/core/metrics.rs:325— TooManyFields — 119 stored fields beside 127 methods. The bar is 30 stored fields; this is 89 over it, 3.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: MetricsInner crates/crab-http-server/src/metrics.rs:155— TooManyFields — 101 stored fields. The bar is 30 stored fields; this is 71 over it, 3.37× 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: PushPipeline crab/src/git/push.rs:4022— TooManyFields — 64 stored fields beside 133 methods. The bar is 30 stored fields; this is 34 over it, 2.13× 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: Config crab/src/core/config.rs:1020— TooManyFields — 63 stored fields beside 35 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: ConfigOverlay crab/src/core/config.rs:1407— 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: PushConfig crab/src/git/push.rs:2839— TooManyFields — 37 stored fields beside 3 methods. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RuntimeSnapshot crates/crab-http-server/src/metrics.rs:320— TooManyFields — 37 stored fields beside 1 method. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ImportArgs crab/src/cmd/import.rs:58— TooManyFields — 33 stored fields beside 5 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RepositoryCellScheduler crates/crab-http-server/src/cells/scheduler.rs:118— TooManyFields — 32 stored fields beside 26 methods. The bar is 30 stored fields; this is 2 over it, 1.07× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
D4 · Code Duplication· Edited copy of a member (5 corresponding lines) · ×9
Edited copy of a member (5 corresponding lines) crab/src/cmd/mirror/reconcile.rs:471— crab/src/cmd/mirror/reconcile.rs:471-476 | crates/crab-metadata/src/manifest_store.rs:73-77 — 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) crab/deploy/auth-service/src/providers/azure.py:30— crab/deploy/auth-service/src/providers/azure.py:30-39 | crab/deploy/auth-service/src/providers/gcp.py:37-41 — 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/crab-auth-server/src/receive/workflow.rs:116— crates/crab-auth-server/src/receive/workflow.rs:116-120 | crates/crab-metadata/src/plan_receipt.rs:667-672 — 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) crab/src/cmd/add.rs:4070— crab/src/cmd/add.rs:4070-4076 | crates/crab-vfs/src/publish.rs:1664-1668 — 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/crab-http-server/src/cells/repository.rs:830— crates/crab-http-server/src/cells/repository.rs:830-834 | crates/crab-http-server/src/cells/repository/projection.rs:1069-1073 — 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/crab-vfs/src/engine.rs:2378— crates/crab-vfs/src/engine.rs:2378-2382 | crates/crab-workflow/src/stage_runtime.rs:421-427 — 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/crab-sdk/src/local/push.rs:168— crates/crab-sdk/src/local/push.rs:168-172 | crates/crab-sdk/src/mutation.rs:770-774 — 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) crab/src/cmd/mirror.rs:917— crab/src/cmd/mirror.rs:917-921 | crab/src/cmd/recover.rs:1205-1210 — 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/crab-http-server/src/cells/repository/checks_codec.rs:279— crates/crab-http-server/src/cells/repository/checks_codec.rs:279-283 | crates/crab-http-server/src/cells/repository/codec.rs:659-663 — 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 (9–10 lines × 2) crab/src/cmd/import.rs:254— crab/src/cmd/import.rs:254-263 | crab/src/import/coordinator.rs:129-137 — 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 `crab/src/cmd/import.rs:254` it does not close everything it opens, so those 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–10 lines × 2) crab/src/cmd/lfs/ls_files.rs:158— crab/src/cmd/lfs/ls_files.rs:158-167 | crab/src/lfs/migrate.rs:2610-2618 — before extracting anything, compare `crab/src/cmd/lfs/ls_files.rs` and `crab/src/lfs/migrate.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–10 lines × 2) crab/src/cmd/metadb.rs:2870— crab/src/cmd/metadb.rs:2870-2879 | crates/crab-auth-server/src/receive/git_workspace.rs:435-443 — 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 `crab/src/cmd/metadb.rs:2870` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/crab-cache-server/src/cache_store.rs:700— crates/crab-cache-server/src/cache_store.rs:700-708 | crates/crab-cache-server/src/cache_store.rs:736-745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-cache-server/src/cache_store.rs:700` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9–10 lines × 2) crates/crab-coordination/src/gc_fence.rs:439— crates/crab-coordination/src/gc_fence.rs:439-447 | crates/crab-coordination/src/gc_fence.rs:495-504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-coordination/src/gc_fence.rs:439` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/crab-remote-git/src/operation.rs:856— crates/crab-remote-git/src/operation.rs:856-864 | crates/crab-remote-git/src/operation.rs:884-893 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-remote-git/src/operation.rs:884` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/crab-remote-git/src/pack.rs:1597— crates/crab-remote-git/src/pack.rs:1597-1605 | crates/crab-remote-git/src/pack.rs:2062-2071 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-remote-git/src/pack.rs:2062` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/crab-remote-git/src/pack.rs:1844— crates/crab-remote-git/src/pack.rs:1844-1853 | crates/crab-remote-git/src/pack.rs:1860-1868 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-remote-git/src/pack.rs:1844` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) crates/crab-workflow/src/lockfile.rs:605— crates/crab-workflow/src/lockfile.rs:605-614 | crates/crab-workflow/src/lockfile.rs:647-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.
Duplicated block (8–9 lines × 2) crab/src/cmd/adopt.rs:207— crab/src/cmd/adopt.rs:207-214 | crab/src/cmd/setup.rs:382-390 — before extracting anything, compare `crab/src/cmd/adopt.rs` and `crab/src/cmd/setup.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 59 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–9 lines × 2) crab/src/cmd/gc/bucket.rs:1541— crab/src/cmd/gc/bucket.rs:1541-1548 | crab/src/cmd/gc/marks.rs:394-402 — 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 `crab/src/cmd/gc/bucket.rs:1541` it begins part-way through the construct above it, so those 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 (8–9 lines × 2) crab/src/cmd/metrics.rs:1469— crab/src/cmd/metrics.rs:1469-1477 | crab/src/cmd/metrics.rs:3339-3346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/metrics.rs:1469` it begins part-way through the construct above it, so those exact lines 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) crab/src/lfs/migrate.rs:1406— crab/src/lfs/migrate.rs:1406-1414 | crab/src/lfs/migrate.rs:1625-1632 — both copies are in the same file, so extract the block into 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/crab-metadata/src/git_visibility.rs:2669— crates/crab-metadata/src/git_visibility.rs:2669-2676 | crates/crab-metadata/src/git_visibility.rs:3175-3183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-metadata/src/git_visibility.rs:2669` 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–9 lines × 2) crates/crab-metadata/src/ref_registry.rs:526— crates/crab-metadata/src/ref_registry.rs:526-534 | crates/crab-metadata/src/ref_registry.rs:906-913 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-metadata/src/ref_registry.rs:526` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/crab-metadata/src/ref_registry.rs:905` calls `retain`, `contains` and `crates/crab-metadata/src/ref_registry.rs:525` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 2) crates/crab-remote-git/src/pack.rs:1575— crates/crab-remote-git/src/pack.rs:1575-1582 | crates/crab-remote-git/src/pack.rs:1817-1825 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-remote-git/src/pack.rs:1575` it begins part-way through the construct above it, so those 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/crab-remote-git/src/pack.rs:1826` calls `Some` and `crates/crab-remote-git/src/pack.rs:1583` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–9 lines × 2) crates/crab-remote-git/src/reader.rs:1515— crates/crab-remote-git/src/reader.rs:1515-1523 | crates/crab-remote-git/src/reader.rs:1561-1568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-remote-git/src/reader.rs:1515` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) crates/crab-vfs/src/publish.rs:1825— crates/crab-vfs/src/publish.rs:1825-1833 | crates/crab-vfs/src/publish.rs:1848-1855 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-vfs/src/publish.rs:1825` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
crab_read::upload_pack::plan_with_operation (cyclomatic 37) crates/crab-read/src/upload_pack.rs:640— crab_read::upload_pack::plan_with_operation has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab_read::upload_pack_wire::parse_fetch (cyclomatic 34) crates/crab-read/src/upload_pack_wire.rs:204— crab_read::upload_pack_wire::parse_fetch 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.
crab_read::upload_pack::enqueue_children (cyclomatic 31) crates/crab-read/src/upload_pack.rs:1810— crab_read::upload_pack::enqueue_children 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.
crab_read::selection::referenced_object_gap (cyclomatic 21) crates/crab-read/src/selection.rs:320— crab_read::selection::referenced_object_gap 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.
crab_read::integrity::verify_origin_recipe (cyclomatic 19) crates/crab-read/src/integrity.rs:17— crab_read::integrity::verify_origin_recipe has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab_read::upload_pack_wire::read_command_request (cyclomatic 19) crates/crab-read/src/upload_pack_wire.rs:74— crab_read::upload_pack_wire::read_command_request has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab_read::upload_pack::visibility_object_selection (cyclomatic 17) crates/crab-read/src/upload_pack.rs:955— crab_read::upload_pack::visibility_object_selection 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.
crab_read::upload_pack::plan_from_visibility_catalog_ordinals (cyclomatic 16) crates/crab-read/src/upload_pack.rs:1361— crab_read::upload_pack::plan_from_visibility_catalog_ordinals 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.
Index::insert_file_push_plans (cognitive 102) crates/crab-staging/src/index.rs:6335— Index::insert_file_push_plans has cognitive complexity 102 (threshold 15). Drivers by points: if/else 22 (61 pts), loops 13 (38 pts), boolean chains 3 (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.
Index::claim_prepared_chunks (cognitive 33) crates/crab-staging/src/index.rs:2283— Index::claim_prepared_chunks has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 8 (11 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Index::locate_batch (cognitive 33) crates/crab-staging/src/index.rs:7718— Index::locate_batch has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 7 (15 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.
Index::register_preparation_payloads (cognitive 29) crates/crab-staging/src/index.rs:2539— Index::register_preparation_payloads has cognitive complexity 29 (threshold 15). Drivers by points: loops 7 (15 pts), if/else 6 (13 pts), boolean chains 1 (nesting depth added 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.
Index::insert_recipe_lease (cognitive 26) crates/crab-staging/src/index.rs:5060— Index::insert_recipe_lease has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Index::batch_dedup_check (cognitive 22) crates/crab-staging/src/index.rs:8337— Index::batch_dedup_check has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 7 (11 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.
Index::append_recording_remote_chunks_in_tx (cognitive 20) crates/crab-staging/src/index.rs:3196— Index::append_recording_remote_chunks_in_tx has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 5 (9 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.
Index::take_coalesced_read_group (cognitive 18) crates/crab-staging/src/index.rs:8056— Index::take_coalesced_read_group has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (20 lines × 2) crab/src/cmd/gc/bucket.rs:1692— crab/src/cmd/gc/bucket.rs:1692-1711 | crab/src/cmd/gc/bucket.rs:1763-1782 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/bucket.rs:1692` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/hydrate.rs:508— crab/src/cmd/hydrate.rs:508-527 | crab/src/cmd/hydrate.rs:1259-1278 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crab/src/cmd/replica.rs:7282— crab/src/cmd/replica.rs:7282-7301 | crab/src/cmd/replica.rs:7317-7336 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/replica.rs:7282` it begins part-way through the construct above it, so those exact lines 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) crab/src/core/error.rs:2387— crab/src/core/error.rs:2387-2406 | crab/src/core/error.rs:2930-2949 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crab/src/replication/mod.rs:7677— crab/src/replication/mod.rs:7677-7696 | crab/src/replication/mod.rs:7718-7737 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/replication/mod.rs:7677` it does not close everything it opens, so those exact lines 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/crab-metadata/src/git_object_locator/reader.rs:476— crates/crab-metadata/src/git_object_locator/reader.rs:476-495 | crates/crab-metadata/src/git_object_locator/writer.rs:816-835 — before extracting anything, compare `crates/crab-metadata/src/git_object_locator/reader.rs` and `crates/crab-metadata/src/git_object_locator/writer.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-metadata/src/git_object_locator/reader.rs:476` it does not close everything it opens, so those exact lines 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/crab-vfs/src/overlay.rs:1070— crates/crab-vfs/src/overlay.rs:1070-1089 | crates/crab-vfs/src/overlay.rs:1352-1371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) crates/crab-staging/src/index.rs:2298— crates/crab-staging/src/index.rs:2298-2317 | crates/crab-staging/src/index.rs:2547-2566 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-staging/src/index.rs:2298` it begins part-way through the construct above it, so those exact lines 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) crab/src/git/progress.rs:320— crab/src/git/progress.rs:320-331 | crab/src/git/progress.rs:376-387 | crab/src/git/progress.rs:425-436 — 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 `crab/src/git/progress.rs:320` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 3) crab/src/import/versions.rs:740— crab/src/import/versions.rs:740-751 | crab/src/import/versions.rs:1081-1092 | crab/src/import/versions.rs:1360-1371 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 3) crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1386— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1386-1397 | crates/crab-http-server/src/cells/repository/pulls.rs:1620-1631 | crates/crab-http-server/src/cells/repository/releases.rs:1188-1199 — before extracting anything, compare `crates/crab-http-server/src/cells/repository/pull_review_threads.rs` and `crates/crab-http-server/src/cells/repository/pulls.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1386` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 3) crates/crab-lfs/src/lock.rs:296— crates/crab-lfs/src/lock.rs:296-307 | crates/crab-lfs/src/lock.rs:352-363 | crates/crab-lfs/src/lock.rs:410-421 — 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/crab-lfs/src/lock.rs:296` it does not close everything it opens, so those exact lines 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/crab-s3-gateway/src/gateway.rs:804— crates/crab-s3-gateway/src/gateway.rs:804-815 | crates/crab-s3-gateway/src/gateway.rs:865-876 | crates/crab-s3-gateway/src/gateway.rs:935-946 — 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/crab-s3-gateway/src/gateway.rs:804` it does not close everything it opens, so those exact lines 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) crab/src/cmd/dehydrate.rs:421— crab/src/cmd/dehydrate.rs:421-432 | crab/src/cmd/hydrate.rs:3503-3514 | crab/src/cmd/reset.rs:458-469 — before extracting anything, compare `crab/src/cmd/dehydrate.rs` and `crab/src/cmd/hydrate.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 223 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) crates/crab-coordination/src/write_coordinator.rs:377— crates/crab-coordination/src/write_coordinator.rs:377-388 | crates/crab-coordination/src/write_coordinator.rs:457-468 | crates/crab-coordination/src/write_coordinator.rs:485-496 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) crab/src/replication/mod.rs:7413— crab/src/replication/mod.rs:7413-7424 | crates/crab-coordination/src/write_coordinator.rs:380-391 | crates/crab-coordination/src/write_coordinator.rs:460-471 — before extracting anything, compare `crab/src/replication/mod.rs` and `crates/crab-coordination/src/write_coordinator.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/replication/mod.rs:7413` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10–11 lines × 2) crab/src/cmd/artifacts.rs:581— crab/src/cmd/artifacts.rs:581-591 | crab/src/cmd/lfs/locks.rs:631-640 — 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 `crab/src/cmd/artifacts.rs:581` it begins part-way through the construct above it, so those exact lines 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) crab/src/cost/inventory/report/azure.rs:31— crab/src/cost/inventory/report/azure.rs:31-40 | crab/src/cost/inventory/report/gcs.rs:36-46 — before extracting anything, compare `crab/src/cost/inventory/report/azure.rs` and `crab/src/cost/inventory/report/gcs.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `crab/src/cost/inventory/report/azure.rs:31` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 2) crab/src/git/pack.rs:731— crab/src/git/pack.rs:731-740 | crab/src/git/pack.rs:936-946 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crab/src/git/pack.rs:933` calls `build_revision_input` and `crab/src/git/pack.rs:729` 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–11 lines × 2) crates/crab-git/src/walk.rs:147— crates/crab-git/src/walk.rs:147-157 | crates/crab-git/src/walk.rs:262-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/crab-s3-gateway/src/gateway.rs:1809— crates/crab-s3-gateway/src/gateway.rs:1809-1819 | crates/crab-s3-gateway/src/gateway.rs:1851-1860 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-s3-gateway/src/gateway.rs:1809` it begins part-way through the construct above it, so those 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 `req` to `S3Request<PutObjectTaggingInput>` in one and `S3Request<DeleteObjectTaggingInput>` 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–11 lines × 2) crates/crab-workflow/src/artifact.rs:1618— crates/crab-workflow/src/artifact.rs:1618-1628 | crates/crab-workflow/src/artifact.rs:1864-1873 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-workflow/src/artifact.rs:1618` it does not close everything it opens, so those 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 (10–11 lines × 2) crates/crab-vfs/src/overlay.rs:685— crates/crab-vfs/src/overlay.rs:685-695 | crates/crab-vfs/src/overlay.rs:712-721 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-vfs/src/overlay.rs:685` it does not close everything it opens, so those exact lines 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) crab/scripts/verify-cache-service-smoke-report.py:936— crab/scripts/verify-cache-service-smoke-report.py:936-946 | crab/scripts/verify-cache-service-smoke-report.py:1059-1068 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-cache-service-smoke-report.py:936` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
Off the main sequence: crab-types — crab-types: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
Off the main sequence: crab-xet — crab-xet: abstractness 0.07, instability 0.00, distance 0.93 — zone of pain — concrete and depended on by 14 project(s), so it's rigid to change.
Off the main sequence: crab-git — crab-git: abstractness 0.04, instability 0.07, distance 0.89 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
Off the main sequence: crab-coordination — crab-coordination: abstractness 0.12, instability 0.00, distance 0.88 — zone of pain — concrete and depended on by 9 project(s), so it's rigid to change.
Off the main sequence: crab-metadata — crab-metadata: abstractness 0.02, instability 0.18, distance 0.80 — zone of pain — concrete and depended on by 9 project(s), so it's rigid to change.
Off the main sequence: crab-cache — crab-cache: abstractness 0.00, instability 0.20, distance 0.80 — zone of pain — concrete and depended on by 8 project(s), so it's rigid to change.
Off the main sequence: crab-storage — crab-storage: abstractness 0.16, instability 0.06, distance 0.79 — zone of pain — concrete and depended on by 16 project(s), so it's rigid to change.
Off the main sequence: crab-lfs — crab-lfs: abstractness 0.00, instability 0.25, distance 0.75 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Outbound HTTP without resilience crab/scripts/qualify_sdk.py:141— `requests.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 crab/src/cmd/data.rs:355— `reqwest::blocking::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crab/src/cmd/data.rs:813— `reqwest::blocking::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crab/src/replication/mod.rs:3206— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/crab-coordination/src/cosmosdb_coordinator.rs:220— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/crab-coordination/src/cosmosdb_coordinator.rs:882— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/crab-coordination/src/spanner_coordinator.rs:337— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience crates/crab-coordination/src/spanner_coordinator.rs:629— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Config::apply_overlay (cyclomatic 40) crab/src/core/config.rs:2079— Config::apply_overlay has cyclomatic complexity 40 (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.
Config::validate (cyclomatic 34) crates/crab-s3-gateway/src/config.rs:113— Config::validate 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.
Config::apply_auth_overlay (cyclomatic 22) crab/src/core/config.rs:2514— Config::apply_auth_overlay 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.
Config::apply_push_overlay (cyclomatic 20) crab/src/core/config.rs:2307— Config::apply_push_overlay has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Config::apply_cache_overlay (cyclomatic 18) crab/src/core/config.rs:2424— Config::apply_cache_overlay 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.
Config::validate_push (cyclomatic 16) crab/src/core/config.rs:1975— Config::validate_push 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.
Config::validate (cyclomatic 16) crates/crab-http-server/src/config.rs:170— Config::validate has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Config::validate (cognitive 43) crates/crab-s3-gateway/src/config.rs:113— Config::validate has cognitive complexity 43 (threshold 15). Drivers by points: if/else 19 (29 pts), boolean chains 10, loops 2, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Config::apply_overlay (cognitive 39) crab/src/core/config.rs:2079— Config::apply_overlay has cognitive complexity 39 (threshold 15). Drivers by points: if/else 38, boolean chains 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.
Config::validate (cognitive 25) crates/crab-http-server/src/config.rs:170— Config::validate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 4, loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Config::apply_auth_overlay (cognitive 24) crab/src/core/config.rs:2514— Config::apply_auth_overlay has cognitive complexity 24 (threshold 15). Drivers by points: if/else 21 (24 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Config::apply_cache_overlay (cognitive 20) crab/src/core/config.rs:2424— Config::apply_cache_overlay has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Config::apply_push_overlay (cognitive 19) crab/src/core/config.rs:2307— Config::apply_push_overlay has cognitive complexity 19 (threshold 15). Drivers by points: if/else 19. 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.
Config::resolve_local_from_with_project (cognitive 16) crab/src/core/config.rs:1835— Config::resolve_local_from_with_project has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 4 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteGitSnapshot::blame (cognitive 42) crates/crab-remote-git/src/snapshot.rs:654— RemoteGitSnapshot::blame has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 5 (12 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteGitSnapshot::path_history (cognitive 24) crates/crab-remote-git/src/snapshot.rs:445— RemoteGitSnapshot::path_history has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteGitSnapshot::list_tree_blobs (cognitive 22) crates/crab-remote-git/src/tree_listing.rs:86— RemoteGitSnapshot::list_tree_blobs has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteGitSnapshot::list_directory_with_metadata (cognitive 21) crates/crab-remote-git/src/snapshot.rs:1056— RemoteGitSnapshot::list_directory_with_metadata has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteGitSnapshot::history (cognitive 20) crates/crab-remote-git/src/snapshot.rs:72— RemoteGitSnapshot::history has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 2 (3 pts), boolean chains 2, 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.
RemoteGitSnapshot::ahead_history (cognitive 19) crates/crab-remote-git/src/snapshot.rs:159— RemoteGitSnapshot::ahead_history has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteGitSnapshot::commit_graph_path_history (cognitive 16) crates/crab-remote-git/src/snapshot.rs:270— RemoteGitSnapshot::commit_graph_path_history has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×7
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (31 corresponding lines) · ×7
Edited copy of a member (31 corresponding lines) crab/src/cmd/metrics.rs:4089— crab/src/cmd/metrics.rs:4089-4119 | crab/src/cmd/params.rs:744-777 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) crates/crab-sdk/src/mutation.rs:692— crates/crab-sdk/src/mutation.rs:692-722 | crates/crab-sdk/src/mutation.rs:734-767 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) crates/crab-coordination/src/cosmosdb_coordinator.rs:534— crates/crab-coordination/src/cosmosdb_coordinator.rs:534-564 | crates/crab-coordination/src/spanner_coordinator.rs:220-250 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) crab/src/cmd/replica.rs:6743— crab/src/cmd/replica.rs:6743-6773 | crab/src/cmd/replica.rs:6775-6805 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) crab/src/replication/mod.rs:7676— crab/src/replication/mod.rs:7676-7710 | crab/src/replication/mod.rs:7717-7747 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) crates/crab-storage/src/store.rs:1674— crates/crab-storage/src/store.rs:1674-1704 | crates/crab-storage/src/store.rs:1750-1782 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (31 corresponding lines) crates/crab-git/src/url.rs:218— crates/crab-git/src/url.rs:218-253 | crates/crab-git/src/url.rs:293-323 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×7
Edited copy of a member (32 corresponding lines) crates/crab-cache/src/active_probe.rs:147— crates/crab-cache/src/active_probe.rs:147-178 | crates/crab-cache/src/active_probe.rs:186-222 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) crab/src/cmd/adopt.rs:665— crab/src/cmd/adopt.rs:665-704 | crab/src/main.rs:2568-2599 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) crab/src/cmd/gc/mod.rs:1820— crab/src/cmd/gc/mod.rs:1820-1852 | crab/src/cmd/gc/mod.rs:2401-2432 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) crates/crab-coordination/src/cosmosdb_coordinator.rs:269— crates/crab-coordination/src/cosmosdb_coordinator.rs:269-300 | crates/crab-coordination/src/cosmosdb_coordinator.rs:310-347 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) crab/src/cmd/lfs/fetch.rs:251— crab/src/cmd/lfs/fetch.rs:251-286 | crab/src/lfs/batch.rs:137-168 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) crab/src/replication/mod.rs:7089— crab/src/replication/mod.rs:7089-7120 | crates/crab-coordination/src/active_active_runtime.rs:109-141 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (32 corresponding lines) crates/crab-http-server/src/releases/storage.rs:241— crates/crab-http-server/src/releases/storage.rs:241-275 | crates/crab-http-server/src/releases/storage.rs:283-314 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 10+ corresponding lines) · ×7
Edited copies of one member (3 members, 10+ corresponding lines) crab/src/replication/mod.rs:6556— crab/src/replication/mod.rs:6556-6565 | crab/src/replication/mod.rs:6581-6590 | crab/src/replication/mod.rs:8494-8503 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) crab/src/cmd/config.rs:649— crab/src/cmd/config.rs:649-660 | crab/src/cmd/data.rs:1691-1700 | crab/src/cmd/stage/add.rs:364-373 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) crates/crab-http-server/src/cells/repository.rs:758— crates/crab-http-server/src/cells/repository.rs:758-768 | crates/crab-http-server/src/cells/repository.rs:770-779 | crates/crab-http-server/src/cells/repository/pull_review_threads.rs:965-974 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) crates/crab-cache-server/src/metrics.rs:296— crates/crab-cache-server/src/metrics.rs:296-305 | crates/crab-cache-server/src/metrics.rs:308-317 | crates/crab-cache-server/src/metrics.rs:320-330 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) crates/crab-http-server/src/cells/repository.rs:1022— crates/crab-http-server/src/cells/repository.rs:1022-1033 | crates/crab-http-server/src/cells/repository.rs:1195-1208 | crates/crab-http-server/src/cells/repository/checks.rs:698-707 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) crates/crab-http-server/src/checks.rs:149— crates/crab-http-server/src/checks.rs:149-162 | crates/crab-http-server/src/labels.rs:59-68 | crates/crab-http-server/src/statuses.rs:68-77 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 10 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 10+ corresponding lines) crates/crab-auth-server/src/receive.rs:276— crates/crab-auth-server/src/receive.rs:276-288 | crates/crab-http-server/src/cells/repository/releases.rs:879-891 | crates/crab-metadata/src/git_visibility.rs:1459-1468 — 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 copy of a member (4 corresponding lines) · ×7
Edited copy of a member (4 corresponding lines) crab/scripts/check-architecture-gates.py:2077— crab/scripts/check-architecture-gates.py:2077-2080 | crab/scripts/release/check-install-layout.py:53-57 — 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) crates/crab-cache/src/private_fs.rs:622— crates/crab-cache/src/private_fs.rs:622-625 | crates/crab-cache/src/private_fs/windows.rs:214-218 — 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) crab/scripts/qualify_sdk.py:375— crab/scripts/qualify_sdk.py:375-378 | crab/scripts/verify-sdk-read-only.py:39-42 — 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) crab/src/git/push.rs:1405— crab/src/git/push.rs:1405-1408 | crates/crab-xet/src/reconstruction.rs:34-37 — 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) crates/crab-vfs/src/mounts_registry.rs:156— crates/crab-vfs/src/mounts_registry.rs:156-160 | crates/crab-workflow/src/artifact.rs:1711-1714 — 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) crab/scripts/qualify_sdk.py:381— crab/scripts/qualify_sdk.py:381-384 | crab/scripts/verify-sdk-read-only.py:45-48 — 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) crates/crab-sdk/src/local.rs:961— crates/crab-sdk/src/local.rs:961-964 | crates/crab-sdk/src/local/edit.rs:1350-1353 — 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 (23 lines × 2) crab/src/cmd/gc/bucket.rs:1855— crab/src/cmd/gc/bucket.rs:1855-1877 | crab/src/cmd/gc/bucket.rs:1908-1930 — both copies are in the same file, so extract the 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 (23 lines × 2) crab/src/cmd/replica.rs:5471— crab/src/cmd/replica.rs:5471-5493 | crab/src/cmd/replica.rs:5517-5539 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/replica.rs:5471` 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 (23 lines × 2) crab/src/replication/mod.rs:7785— crab/src/replication/mod.rs:7785-7807 | crab/src/replication/mod.rs:7834-7856 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/replication/mod.rs:7785` it does not close everything it opens, so those exact lines 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) crab/src/replication/mod.rs:7909— crab/src/replication/mod.rs:7909-7931 | crab/src/replication/mod.rs:7958-7980 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/replication/mod.rs:7909` it does not close everything it opens, so those exact lines 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) crates/crab-metadata/src/git_visibility.rs:2217— crates/crab-metadata/src/git_visibility.rs:2217-2239 | crates/crab-metadata/src/git_visibility.rs:2335-2357 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-metadata/src/git_visibility.rs:2217` it begins part-way through the construct above it, so those exact lines 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) crates/crab-read/src/term_resolver.rs:194— crates/crab-read/src/term_resolver.rs:194-216 | crates/crab-read/src/term_resolver.rs:343-365 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-read/src/term_resolver.rs:194` it begins part-way through the construct above it, so those exact lines 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) crates/crab-staging/src/add_push_plan.rs:207— crates/crab-staging/src/add_push_plan.rs:207-229 | crates/crab-staging/src/add_push_plan.rs:389-411 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-staging/src/add_push_plan.rs:207` it does not close everything it opens, so those exact lines 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 × 4) crab/src/auth/mod.rs:369— crab/src/auth/mod.rs:369-374 | crates/crab-auth-store/src/lib.rs:94-99 | crates/crab-auth-store/src/lib.rs:207-212 | crates/crab-storage/src/provider_store.rs:488-493 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 4) crab/src/cmd/exp.rs:3940— crab/src/cmd/exp.rs:3940-3945 | crab/src/cmd/exp.rs:4199-4204 | crab/src/cmd/recover.rs:2824-2829 | crab/src/cmd/recover.rs:2917-2922 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/exp.rs:3940` it does not close everything it opens, so those exact lines 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 × 4) crab/src/speculation/access_db.rs:337— crab/src/speculation/access_db.rs:337-342 | crab/src/speculation/access_db.rs:354-359 | crab/src/speculation/access_db.rs:388-393 | crab/src/speculation/access_db.rs:405-410 — 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 `crab/src/speculation/access_db.rs:337` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 4) crates/crab-auth/src/aws_oidc.rs:216— crates/crab-auth/src/aws_oidc.rs:216-221 | crates/crab-auth/src/azure_entra.rs:246-251 | crates/crab-auth/src/crab_auth_client.rs:540-545 | crates/crab-auth/src/gcp_federation.rs:272-277 — before extracting anything, compare `crates/crab-auth/src/aws_oidc.rs` and `crates/crab-auth/src/azure_entra.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) crates/crab-auth/src/aws_oidc.rs:232— crates/crab-auth/src/aws_oidc.rs:232-237 | crates/crab-auth/src/azure_entra.rs:262-267 | crates/crab-auth/src/crab_auth_client.rs:556-561 | crates/crab-auth/src/gcp_federation.rs:288-293 — before extracting anything, compare `crates/crab-auth/src/aws_oidc.rs` and `crates/crab-auth/src/azure_entra.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-auth/src/aws_oidc.rs:232` it begins part-way through the construct above it, so those exact lines 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 × 4) crates/crab-staging/src/index.rs:2752— crates/crab-staging/src/index.rs:2752-2757 | crates/crab-staging/src/index.rs:3269-3277 | crates/crab-staging/src/index.rs:6468-6476 | crates/crab-staging/src/index.rs:6794-6801 — 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 (6 lines × 4) crates/crab-http-server/src/cells/repository.rs:358— crates/crab-http-server/src/cells/repository.rs:358-363 | crates/crab-http-server/src/cells/repository/checks.rs:146-151 | crates/crab-http-server/src/cells/repository/checks.rs:247-252 | crates/crab-http-server/src/cells/repository/operations.rs:406-411 — 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 `crates/crab-http-server/src/cells/repository.rs:358` 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.
Hollow method — returns a constant without doing the work crab/src/cmd/gc/class_aware.rs:211— `check_object_lock` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work crab/src/cmd/install.rs:673— `generate_bash_completion` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work crab/src/cmd/install.rs:695— `generate_zsh_completion` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work crab/src/cmd/install.rs:738— `generate_fish_completion` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work crab/src/core/pathmatch.rs:135— `no_attrs` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work crates/crab-cache/src/private_fs/platform/database/file.rs:261— `sector_size` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Hollow method — returns a constant without doing the work crates/crab-xet/src/xorb/parser.rs:297— `verify_compressed_chunk` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
X25 · Inert configuration knob· Configuration option is only ever logged · ×7
Configuration option is only ever logged crab/src/auth/oidc.rs:34— `DeviceAuthResponse.user_code` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is only ever logged crab/src/auth/oidc.rs:35— `DeviceAuthResponse.verification_uri` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is only ever logged crab/src/cmd/metrics.rs:77— `ShowArgs.higher_is_better` is offered as a command-line argument option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is only ever logged crab/src/cmd/metrics.rs:152— `DiffArgs.higher_is_better` is offered as a command-line argument option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is only ever logged crates/crab-vfs/src/nfs_control.rs:59— `NfsMountLifecycleStatus.server_bind_ms` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is only ever logged crates/crab-vfs/src/nfs_control.rs:60— `NfsMountLifecycleStatus.native_mount_ms` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
Configuration option is only ever logged crates/crab-vfs/src/nfs_control.rs:61— `NfsMountLifecycleStatus.startup_ms` is offered as a configuration-file option, so whoever configures the program can set it — but the only production code that touches it writes it to a log or the terminal. A test asserts that it parses, which proves the key is read from the input, not that it does anything. Every value supplied for it is silently ignored. Consult it where it was meant to take effect — or, if it genuinely does nothing, remove it (or mark it deprecated and say so in its documentation) so the configuration stops advertising a setting that changes nothing.
crab_sdk::client::mutation::native_content::prepare_native_sources (cognitive 48) crates/crab-sdk/src/client/mutation/native_content.rs:76— crab_sdk::client::mutation::native_content::prepare_native_sources has cognitive complexity 48 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 10 (17 pts), boolean chains 7, match/switch 2 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_sdk::local::push::content::prepare (cognitive 34) crates/crab-sdk/src/local/push/content.rs:4— crab_sdk::local::push::content::prepare has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 4 (8 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_sdk::archive::open (cognitive 20) crates/crab-sdk/src/archive.rs:63— crab_sdk::archive::open has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2 (5 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_sdk::local::fetch::prepare_fetch_intent (cognitive 20) crates/crab-sdk/src/local/fetch.rs:130— crab_sdk::local::fetch::prepare_fetch_intent has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 5, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_sdk::client::mutation::prepare_batch (cognitive 19) crates/crab-sdk/src/client/mutation.rs:697— crab_sdk::client::mutation::prepare_batch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 4 (5 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_sdk::local::push::content::discover_push_pointers (cognitive 18) crates/crab-sdk/src/local/push/content.rs:171— crab_sdk::local::push::content::discover_push_pointers has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×6
Members sharing a duplicated core (6 members, 50+ identical tokens) crab/src/cmd/add.rs:3146— crab/src/cmd/add.rs:3146-3229 | crab/src/cmd/add.rs:3240-3302 | crab/src/cmd/dehydrate.rs:488-550 | crab/src/cmd/hydrate.rs:3574-3637 | crab/src/cmd/reset.rs:301-358 | crab/src/cmd/status.rs:388-450 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) crab/src/cmd/add.rs:3421— crab/src/cmd/add.rs:3421-3438 | crab/src/cmd/dehydrate.rs:460-477 | crab/src/cmd/du.rs:240-256 | crab/src/cmd/hydrate.rs:3543-3560 | crab/src/cmd/reset.rs:497-514 | crab/src/cmd/status.rs:784-803 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) crab/src/cmd/metadb.rs:1787— crab/src/cmd/metadb.rs:1787-1799 | crab/src/cmd/repack.rs:1346-1363 | crab/src/git/push.rs:18811-18823 | crab/src/optimize/xorbs/reconcile.rs:779-792 | crates/crab-coordination/src/cosmosdb_coordinator.rs:1492-1508 | crates/crab-types/src/time.rs:67-85 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) crab/src/git/push.rs:18295— crab/src/git/push.rs:18295-18303 | crab/src/read/mod.rs:941-949 | crates/crab-auth-server/src/receive.rs:1176-1184 | crates/crab-cache-server/src/onboarding.rs:1018-1026 | crates/crab-metadata/src/shallow_closure.rs:578-586 | crates/crab-metadata/src/split_commit_graph.rs:1031-1039 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/crab-http-server/src/checks.rs:832— crates/crab-http-server/src/checks.rs:832-841 | crates/crab-http-server/src/issues.rs:676-685 | crates/crab-http-server/src/labels.rs:302-311 | crates/crab-http-server/src/pulls/storage.rs:816-825 | crates/crab-http-server/src/releases/storage.rs:415-424 | crates/crab-http-server/src/statuses.rs:341-350 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) crab/scripts/verify-nfs-smoke-report.py:413— crab/scripts/verify-nfs-smoke-report.py:413-551 | crab/scripts/verify-nfs-smoke-report.py:965-1260 | crab/scripts/verify-nfs-smoke-report.py:1270-1504 | crab/scripts/verify-nfs-smoke-report.py:1608-1695 | crab/scripts/verify-nfs-smoke-report.py:1704-1783 | crab/scripts/verify-nfs-smoke-report.py:1871-1937 — 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 (35 corresponding lines) · ×6
Edited copy of a member (35 corresponding lines) crates/crab-staging/src/push_plan.rs:1098— crates/crab-staging/src/push_plan.rs:1098-1132 | crates/crab-staging/src/push_plan.rs:1139-1173 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) crates/crab-workflow/src/exp_worktree.rs:1050— crates/crab-workflow/src/exp_worktree.rs:1050-1099 | crates/crab-workflow/src/params.rs:195-229 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) crates/crab-cache-server/src/cache_store.rs:693— crates/crab-cache-server/src/cache_store.rs:693-727 | crates/crab-cache-server/src/cache_store.rs:729-767 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) crab/src/metadata/metadb/db.rs:307— crab/src/metadata/metadb/db.rs:307-341 | crab/src/metadata/metadb/db.rs:385-437 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) crates/crab-coordination/src/cosmosdb_coordinator.rs:751— crates/crab-coordination/src/cosmosdb_coordinator.rs:751-794 | crates/crab-coordination/src/spanner_coordinator.rs:1053-1087 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (35 corresponding lines) crab/src/cmd/exp.rs:6675— crab/src/cmd/exp.rs:6675-6709 | crab/src/cmd/workflow_journal.rs:581-617 — These two members are one piece of code written twice and then edited apart: 35 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×6
Edited copy of a member (28 corresponding lines) crab/src/cmd/download.rs:410— crab/src/cmd/download.rs:410-437 | crab/src/cmd/export.rs:379-407 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crates/crab-http-server/src/branches.rs:273— crates/crab-http-server/src/branches.rs:273-300 | crates/crab-http-server/src/branches.rs:352-383 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crab/src/tier/provider/azure.rs:63— crab/src/tier/provider/azure.rs:63-90 | crab/src/tier/provider/gcs.rs:52-81 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crates/crab-cache-server/src/handlers.rs:1307— crates/crab-cache-server/src/handlers.rs:1307-1336 | crates/crab-cache-server/src/handlers.rs:1343-1370 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crates/crab-coordination/src/write_coordinator.rs:873— crates/crab-coordination/src/write_coordinator.rs:873-906 | crates/crab-coordination/src/write_coordinator.rs:1367-1394 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (28 corresponding lines) crab/src/core/config.rs:2852— crab/src/core/config.rs:2852-2880 | crab/src/optimize/xorbs/profile.rs:251-278 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×6
Edited copies of one member (3 members, 9+ corresponding lines) crates/crab-workflow/src/hydra.rs:1383— crates/crab-workflow/src/hydra.rs:1383-1391 | crates/crab-workflow/src/template/foreach.rs:348-356 | crates/crab-workflow/src/template/matrix.rs:334-342 — 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/crab-workflow/src/params.rs:110— crates/crab-workflow/src/params.rs:110-119 | crates/crab-workflow/src/params.rs:123-132 | crates/crab-workflow/src/params.rs:135-143 — 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/crab-http-server/src/cells/repository.rs:886— crates/crab-http-server/src/cells/repository.rs:886-894 | crates/crab-http-server/src/cells/repository/projection.rs:1136-1144 | crates/crab-http-server/src/cells/repository/releases.rs:1146-1154 — 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/crab-auth-store/src/refreshing_store.rs:233— crates/crab-auth-store/src/refreshing_store.rs:233-242 | crates/crab-auth-store/src/refreshing_store.rs:317-326 | crates/crab-auth-store/src/refreshing_store.rs:381-389 — 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) crab/src/cmd/lfs/merge_driver.rs:311— crab/src/cmd/lfs/merge_driver.rs:311-320 | crab/src/cmd/replica.rs:3413-3421 | crab/src/cmd/replica.rs:10128-10137 — 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) crab/src/core/error/read_failure.rs:154— crab/src/core/error/read_failure.rs:154-163 | crab/src/core/error/read_failure.rs:165-173 | crab/src/core/error/read_failure.rs:175-183 — 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.
Duplicated block (12–13 lines × 2) crab/src/cmd/gc/bucket.rs:1474— crab/src/cmd/gc/bucket.rs:1474-1486 | crab/src/cmd/gc/bucket.rs:1805-1816 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/bucket.rs:1474` 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 (12–13 lines × 2) crab/src/cmd/gc/mod.rs:2568— crab/src/cmd/gc/mod.rs:2568-2580 | crab/src/cmd/gc/mod.rs:2887-2898 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/mod.rs:2568` it does not close everything it opens, so those exact lines 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) crab/src/cmd/hydrate.rs:498— crab/src/cmd/hydrate.rs:498-510 | crab/src/cmd/hydrate.rs:1027-1038 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/hydrate.rs:498` it does not close everything it opens, so those exact lines 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) crab/src/cmd/install.rs:226— crab/src/cmd/install.rs:226-238 | crab/src/import/assemble.rs:987-998 — 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 `crab/src/cmd/install.rs:226` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) crab/src/git/push.rs:17762— crab/src/git/push.rs:17762-17773 | crab/src/git/push.rs:17836-17848 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push.rs:17762` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–13 lines × 2) crab/src/lfs/batch.rs:91— crab/src/lfs/batch.rs:91-103 | crab/src/lfs/publication.rs:100-111 — 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 `crab/src/lfs/batch.rs:91` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 4) crab/src/cmd/gc/bucket.rs:1470— crab/src/cmd/gc/bucket.rs:1470-1479 | crab/src/cmd/gc/bucket.rs:1665-1674 | crab/src/cmd/gc/bucket.rs:1729-1738 | crab/src/cmd/gc/bucket.rs:1801-1810 — 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 `crab/src/cmd/gc/bucket.rs:1470` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) crab/src/cmd/push.rs:1534— crab/src/cmd/push.rs:1534-1543 | crab/src/cmd/push.rs:1569-1578 | crab/src/cmd/push.rs:1600-1609 | crab/src/git/protected_push.rs:327-336 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/push.rs:1534` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 4) crates/crab-auth/src/aws_oidc.rs:346— crates/crab-auth/src/aws_oidc.rs:346-355 | crates/crab-auth/src/azure_entra.rs:380-389 | crates/crab-auth/src/crab_auth_client.rs:621-630 | crates/crab-auth/src/gcp_federation.rs:377-386 — before extracting anything, compare `crates/crab-auth/src/aws_oidc.rs` and `crates/crab-auth/src/azure_entra.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 4) crates/crab-sdk/src/local/edit.rs:386— crates/crab-sdk/src/local/edit.rs:386-395 | crates/crab-sdk/src/local/edit.rs:443-452 | crates/crab-sdk/src/local/edit.rs:506-515 | crates/crab-sdk/src/local/edit.rs:831-840 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-sdk/src/local/edit.rs:386` it does not close everything it opens, so those 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/crab-sdk/src/local/edit.rs:505` calls `validate_revision` and `crates/crab-sdk/src/local/edit.rs:442` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 4) crates/crab-staging/src/index.rs:2724— crates/crab-staging/src/index.rs:2724-2733 | crates/crab-staging/src/index.rs:3226-3235 | crates/crab-staging/src/index.rs:6542-6551 | crates/crab-staging/src/index.rs:6766-6775 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) crab/scripts/check-architecture-gates.py:2668— crab/scripts/check-architecture-gates.py:2668-2677 | crab/scripts/check-architecture-gates.py:2714-2723 | crab/scripts/check-architecture-gates.py:2764-2773 | crab/scripts/check-architecture-gates.py:2814-2823 — 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 (5 lines × 4) crab/src/cache/add_remote_candidates.rs:548— crab/src/cache/add_remote_candidates.rs:548-554 | crates/crab-staging/src/index.rs:3166-3170 | crates/crab-staging/src/index.rs:3255-3261 | crates/crab-staging/src/index.rs:6563-6569 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cache/add_remote_candidates.rs:548` it begins part-way through the construct above it, so those 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/crab-staging/src/index.rs:3253` calls `push` and `crates/crab-staging/src/index.rs:3165` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 4) crates/crab-staging/src/index.rs:7750— crates/crab-staging/src/index.rs:7750-7754 | crates/crab-staging/src/index.rs:7801-7805 | crates/crab-staging/src/index.rs:8388-8392 | crates/crab-staging/src/index.rs:8451-8455 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-staging/src/index.rs:7750` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) crates/crab-staging/src/index.rs:2969— crates/crab-staging/src/index.rs:2969-2973 | crates/crab-staging/src/index.rs:3892-3899 | crates/crab-staging/src/index.rs:6020-6027 | crates/crab-staging/src/index.rs:6904-6911 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-staging/src/index.rs:2969` it begins part-way through the construct above it, so those 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 × 4) crab/src/read/mod.rs:560— crab/src/read/mod.rs:560-564 | crab/src/read/mod.rs:645-649 | crates/crab-vfs/src/snapshot.rs:574-579 | crates/crab-workflow/src/params_runtime.rs:388-394 — 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 `crab/src/read/mod.rs:560` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) crab/src/git/push.rs:9208— crab/src/git/push.rs:9208-9212 | crab/src/git/push.rs:17130-17134 | crab/src/git/push.rs:17455-17459 | crab/src/git/push.rs:17516-17520 — 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 `crab/src/git/push.rs:9208` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 4) crates/crab-http-server/src/cells/repository/checks.rs:802— crates/crab-http-server/src/cells/repository/checks.rs:802-806 | crates/crab-http-server/src/cells/repository/projection.rs:1125-1129 | crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1271-1275 | crates/crab-http-server/src/cells/repository/releases.rs:1157-1161 — before extracting anything, compare `crates/crab-http-server/src/cells/repository/pull_review_threads.rs` and `crates/crab-http-server/src/cells/repository/releases.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/cells/repository/checks.rs:802` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Low cohesion: ProcessCommand (LCOM4 7) crab/src/cmd/mirror.rs:875— ProcessCommand's methods fall into 7 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 7 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: Store (LCOM4 6) crates/crab-storage/src/store.rs:99— Store'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: CacheCatalog (LCOM4 4) crates/crab-cache/src/catalog.rs:37— CacheCatalog's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: PushOptions (LCOM4 4) crates/crab-sdk/src/local/push.rs:19— PushOptions's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: CloneOptions (LCOM4 4) crates/crab-sdk/src/local.rs:74— CloneOptions's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: FetchOptions (LCOM4 4) crates/crab-sdk/src/local.rs:153— FetchOptions's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
crab_git::receive_plan::validate (cyclomatic 24) crates/crab-git/src/receive_plan.rs:179— crab_git::receive_plan::validate 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.
crab_git::receive_wire::read_request_with_limits (cyclomatic 24) crates/crab-git/src/receive_wire.rs:86— crab_git::receive_wire::read_request_with_limits 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.
crab_git::incoming_pack::quarantine (cyclomatic 22) crates/crab-git/src/incoming_pack.rs:229— crab_git::incoming_pack::quarantine 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.
crab_git::repack::consolidate_pack_suffix_with_options (cyclomatic 17) crates/crab-git/src/repack.rs:495— crab_git::repack::consolidate_pack_suffix_with_options has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
crab_git::pack::install_pack_files_from_paths_with_identity (cyclomatic 16) crates/crab-git/src/pack.rs:418— crab_git::pack::install_pack_files_from_paths_with_identity 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.
TodoComment REDACTED:379— // TODO: phase 3 splits this into local vs remote once the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crab/src/tier/provider/gcs.rs:192— // TODO(crab-storage-economy): wire `auth::CredentialProvider` via — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crab/src/tier/provider/s3.rs:239— // TODO(crab-storage-economy): wire `auth::CredentialProvider` via — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crab/src/git/filter_process.rs:452— // TODO(#cache-pressure): Wire to real ChunkCache usage metrics once — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment crab/src/cmd/adopt.rs:117— // TODO(stretch): Implement history rewrite using git-filter-repo --blob-callback. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Gateway::start_multipart_maintenance (cognitive 50) crates/crab-s3-gateway/src/gateway.rs:527— Gateway::start_multipart_maintenance has cognitive complexity 50 (threshold 15). Drivers by points: if/else 9 (27 pts), match/switch 4 (14 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 33). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Gateway::complete_multipart_upload (cognitive 25) crates/crab-s3-gateway/src/gateway.rs:2428— Gateway::complete_multipart_upload has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5, loops 2 (3 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Gateway::list_objects_v2 (cognitive 22) crates/crab-s3-gateway/src/gateway.rs:2921— Gateway::list_objects_v2 has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 7 (11 pts), if/else 6, loops 3 (5 pts) (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Gateway::list_multipart_uploads (cognitive 18) crates/crab-s3-gateway/src/gateway.rs:2769— Gateway::list_multipart_uploads has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (8 pts), loops 3 (5 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Gateway::delete_objects (cognitive 16) crates/crab-s3-gateway/src/gateway.rs:1926— Gateway::delete_objects has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_auth_server::receive::validate_segmented_index (cognitive 39) crates/crab-auth-server/src/receive.rs:2277— crab_auth_server::receive::validate_segmented_index has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 4 (12 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_auth_server::receive::commit_service_metadata (cognitive 30) crates/crab-auth-server/src/receive.rs:1187— crab_auth_server::receive::commit_service_metadata has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (17 pts), loops 5 (13 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_auth_server::view::objects::commit_view_metadb (cognitive 29) crates/crab-auth-server/src/view/objects.rs:195— crab_auth_server::view::objects::commit_view_metadb has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 4 (8 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.
crab_auth_server::receive::promote_pack_metadata_union (cognitive 27) crates/crab-auth-server/src/receive.rs:487— crab_auth_server::receive::promote_pack_metadata_union has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 3 (8 pts), boolean chains 3, 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.
crab_auth_server::receive::commit_service_git_locators_with_source (cognitive 18) crates/crab-auth-server/src/receive.rs:1765— crab_auth_server::receive::commit_service_git_locators_with_source has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 2 (3 pts), boolean chains 2, loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
crab_cache::xet_chunk_cache::verify_xet_chunk_cache_entry (cognitive 23) crates/crab-cache/src/xet_chunk_cache.rs:655— crab_cache::xet_chunk_cache::verify_xet_chunk_cache_entry has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (16 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.
crab_cache::local_cache::cached_remote_xorb_index (cognitive 22) crates/crab-cache/src/local_cache.rs:1455— crab_cache::local_cache::cached_remote_xorb_index has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_cache::local_cache::maintenance::verify_file (cognitive 21) crates/crab-cache/src/local_cache/maintenance.rs:401— crab_cache::local_cache::maintenance::verify_file has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (3 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_cache::private_fs::platform::database::open_with_generation (cognitive 17) crates/crab-cache/src/private_fs/platform/database.rs:138— crab_cache::private_fs::platform::database::open_with_generation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
crab_cache::private_fs::platform::scan::visit_directory (cognitive 17) crates/crab-cache/src/private_fs/platform/scan.rs:41— crab_cache::private_fs::platform::scan::visit_directory has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 4 (6 pts), 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.
D4 · Code Duplication· Edited copy of a member (41 corresponding lines) · ×5
Edited copy of a member (41 corresponding lines) crab/src/cmd/metrics.rs:1836— crab/src/cmd/metrics.rs:1836-1876 | crab/src/cmd/metrics.rs:1883-1929 — 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) crab/src/import/assemble.rs:336— crab/src/import/assemble.rs:336-390 | crab/src/import/coordinator.rs:1309-1349 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) crates/crab-vfs/src/coordinator.rs:1058— crates/crab-vfs/src/coordinator.rs:1058-1098 | crates/crab-vfs/src/mount.rs:409-451 — These two members are one piece of code written twice and then edited apart: 41 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (41 corresponding lines) crates/crab-auth/src/oidc.rs:103— crates/crab-auth/src/oidc.rs:103-143 | crates/crab-auth/src/oidc.rs:166-206 — 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) crab/src/cmd/replica.rs:10660— crab/src/cmd/replica.rs:10660-10708 | crab/src/cmd/replica.rs:10713-10753 — 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 copies of one member (3 members, 15+ corresponding lines) · ×5
Edited copies of one member (3 members, 15+ corresponding lines) crates/crab-http-server/src/peer.rs:580— crates/crab-http-server/src/peer.rs:580-597 | crates/crab-http-server/src/peer.rs:603-623 | crates/crab-http-server/src/peer.rs:628-642 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) crates/crab-metadata/src/git_visibility.rs:2752— crates/crab-metadata/src/git_visibility.rs:2752-2770 | crates/crab-metadata/src/ref_journal.rs:838-852 | crates/crab-metadata/src/ref_registry.rs:704-718 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) crates/crab-auth-server/src/view.rs:727— crates/crab-auth-server/src/view.rs:727-744 | crates/crab-auth/src/credential_response.rs:225-239 | crates/crab-auth/src/managed/transfer.rs:382-396 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) crates/crab-remote-git/src/operation.rs:323— crates/crab-remote-git/src/operation.rs:323-341 | crates/crab-remote-git/src/operation.rs:524-542 | crates/crab-remote-git/src/operation.rs:551-565 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 15+ corresponding lines) crab/src/replication/mod.rs:1158— crab/src/replication/mod.rs:1158-1172 | crab/src/replication/mod.rs:1346-1360 | crab/src/replication/mod.rs:1557-1571 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 16+ corresponding lines) · ×5
Edited copies of one member (3 members, 16+ corresponding lines) crates/crab-vfs/src/fuse.rs:1086— crates/crab-vfs/src/fuse.rs:1086-1104 | crates/crab-vfs/src/fuse.rs:1171-1186 | crates/crab-vfs/src/fuse.rs:1274-1292 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) crates/crab-lfs/src/object_store.rs:236— crates/crab-lfs/src/object_store.rs:236-273 | crates/crab-lfs/src/object_store.rs:541-556 | crates/crab-lfs/src/object_store.rs:675-706 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) crab/src/cmd/lfs/checkout.rs:437— crab/src/cmd/lfs/checkout.rs:437-453 | crab/src/lfs/status.rs:268-283 | crab/src/lfs/status.rs:449-464 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) crates/crab-vfs/src/engine.rs:899— crates/crab-vfs/src/engine.rs:899-915 | crates/crab-vfs/src/nfs.rs:421-439 | crates/crab-vfs/src/read_lease_pool.rs:45-60 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 16+ corresponding lines) crab/src/git/push.rs:911— crab/src/git/push.rs:911-929 | crab/src/git/push.rs:998-1014 | crab/src/git/push.rs:1021-1036 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 16 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 13+ corresponding lines) · ×5
Edited copies of one member (3 members, 13+ corresponding lines) crab/src/cmd/doctor.rs:1721— crab/src/cmd/doctor.rs:1721-1733 | crab/src/cmd/replica.rs:2845-2858 | crab/src/cmd/replica.rs:2860-2872 — 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) crab/src/cmd/lfs/fsck.rs:309— crab/src/cmd/lfs/fsck.rs:309-324 | crab/src/cmd/lfs/locks.rs:221-233 | crab/src/cmd/lfs/ls_files.rs:277-295 — 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/crab-vfs/src/nfs_control.rs:1252— crates/crab-vfs/src/nfs_control.rs:1252-1264 | crates/crab-vfs/src/nfs_control.rs:1304-1316 | crates/crab-vfs/src/nfs_control.rs:1322-1342 — 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/crab-vfs/src/coordinator.rs:644— crates/crab-vfs/src/coordinator.rs:644-656 | crates/crab-vfs/src/coordinator.rs:846-858 | crates/crab-vfs/src/coordinator.rs:867-880 — 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/crab-auth/src/managed/client.rs:187— crates/crab-auth/src/managed/client.rs:187-199 | crates/crab-auth/src/managed/client.rs:306-323 | crates/crab-auth/src/managed/client.rs:617-632 — 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 copies of one member (3 members, 14+ corresponding lines) · ×5
Edited copies of one member (3 members, 14+ corresponding lines) crates/crab-workflow/src/exp_worktree.rs:1732— crates/crab-workflow/src/exp_worktree.rs:1732-1745 | crates/crab-workflow/src/exp_worktree.rs:1845-1859 | crates/crab-workflow/src/exp_worktree.rs:1959-1972 — 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/crab-remote-git/src/operation.rs:712— crates/crab-remote-git/src/operation.rs:712-725 | crates/crab-remote-git/src/operation.rs:947-970 | crates/crab-remote-git/src/operation.rs:1038-1052 — 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/crab-vfs/src/ipc_server.rs:811— crates/crab-vfs/src/ipc_server.rs:811-828 | crates/crab-vfs/src/ipc_server.rs:838-855 | crates/crab-vfs/src/ipc_server.rs:876-889 — 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/crab-auth/src/aws_oidc.rs:43— crates/crab-auth/src/aws_oidc.rs:43-56 | crates/crab-auth/src/azure_entra.rs:74-87 | crates/crab-auth/src/gcp_federation.rs:74-88 — 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/crab-cache/src/cache_client.rs:676— crates/crab-cache/src/cache_client.rs:676-689 | crates/crab-cache/src/cache_client.rs:692-705 | crates/crab-cache/src/cache_client.rs:708-721 — 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, 12+ corresponding lines) · ×5
Edited copies of one member (3 members, 12+ corresponding lines) crates/crab-http-server/src/cells/repository.rs:1222— crates/crab-http-server/src/cells/repository.rs:1222-1234 | crates/crab-http-server/src/cells/repository.rs:1260-1272 | crates/crab-http-server/src/cells/repository/settings.rs:251-262 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) crab/scripts/verify-nfs-smoke-report.py:600— crab/scripts/verify-nfs-smoke-report.py:600-611 | crab/scripts/verify-nfs-smoke-report.py:644-659 | crab/scripts/verify-nfs-smoke-report.py:668-679 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) crates/crab-workflow/src/exp_worktree.rs:1614— crates/crab-workflow/src/exp_worktree.rs:1614-1625 | crates/crab-workflow/src/exp_worktree.rs:1747-1758 | crates/crab-workflow/src/exp_worktree.rs:1861-1872 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) crates/crab-vfs/src/daemon.rs:397— crates/crab-vfs/src/daemon.rs:397-408 | crates/crab-vfs/src/daemon.rs:485-497 | crates/crab-vfs/src/daemon.rs:500-512 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 12+ corresponding lines) crab/src/import/summary.rs:298— crab/src/import/summary.rs:298-313 | crab/src/import/summary.rs:330-341 | crab/src/import/summary.rs:358-371 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (26 lines × 2) crab/src/cmd/add.rs:3204— crab/src/cmd/add.rs:3204-3229 | crab/src/cmd/add.rs:3277-3302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:3204` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) crates/crab-coordination/src/write_coordinator.rs:921— crates/crab-coordination/src/write_coordinator.rs:921-946 | crates/crab-coordination/src/write_coordinator.rs:1409-1434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-coordination/src/write_coordinator.rs:921` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) crates/crab-sdk/src/mutation.rs:697— crates/crab-sdk/src/mutation.rs:697-722 | crates/crab-sdk/src/mutation.rs:742-767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-sdk/src/mutation.rs:697` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 2) crates/crab-staging/src/lib.rs:3159— crates/crab-staging/src/lib.rs:3159-3184 | crates/crab-staging/src/lib.rs:4201-4226 — both copies are in the same file, so extract the block into 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 lines × 2) crab/src/cmd/params.rs:580— crab/src/cmd/params.rs:580-605 | crab/src/cmd/params.rs:632-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 `crab/src/cmd/params.rs:580` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) crates/crab-lfs/src/lock.rs:302— crates/crab-lfs/src/lock.rs:302-315 | crates/crab-lfs/src/lock.rs:358-371 | crates/crab-lfs/src/lock.rs:478-491 — 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/crab-lfs/src/lock.rs:302` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 3) crab/src/storage/head_class.rs:149— crab/src/storage/head_class.rs:149-164 | crab/src/storage/head_class.rs:169-184 | crab/src/storage/head_class.rs:268-281 — 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 `crab/src/storage/head_class.rs:149` 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 (14 lines × 3) crates/crab-staging/src/index.rs:1447— crates/crab-staging/src/index.rs:1447-1460 | crates/crab-staging/src/index.rs:1476-1489 | crates/crab-staging/src/index.rs:1508-1521 — 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/crab-staging/src/index.rs:1447` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 3) crab/scripts/verify-nfs-smoke-report.py:3495— crab/scripts/verify-nfs-smoke-report.py:3495-3508 | crab/scripts/verify-nfs-smoke-report.py:4118-4131 | crab/scripts/verify-nfs-smoke-report.py:4133-4146 — 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 `crab/scripts/verify-nfs-smoke-report.py:3495` it begins part-way through the construct above it, so those 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 × 3) crab/scripts/verify-nfs-smoke-report.py:4491— crab/scripts/verify-nfs-smoke-report.py:4491-4504 | crab/scripts/verify-nfs-smoke-report.py:4550-4563 | crab/scripts/verify-nfs-smoke-report.py:4583-4596 — 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 (16 lines × 2 locations) packages/ui/src/content-editor.tsx:566— packages/ui/src/content-editor.tsx:566 · packages/ui/src/content-editor.tsx:670 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (16 lines × 2 locations) packages/ui/src/release-api.ts:57— packages/ui/src/release-api.ts:57 · packages/ui/src/release-api.ts:92 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2 locations) packages/web/app/diagrams/remote-helper-flow-svg.tsx:10— packages/web/app/diagrams/remote-helper-flow-svg.tsx:10 · packages/web/app/landing-svgs.tsx:8 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (16 lines × 2 locations) packages/web/components/blog/gc-visuals.tsx:508— packages/web/components/blog/gc-visuals.tsx:508 · packages/web/components/blog/lazy-checkout-visuals.tsx:406 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (16 lines × 2 locations) packages/web/components/ui/dropdown-menu.tsx:166— packages/web/components/ui/dropdown-menu.tsx:166 · packages/web/components/ui/dropdown-menu.tsx:206 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Boundary violation [package:relative-cross-package] packages/ui/src/App.tsx:78— packages/ui/src/App.tsx:78 reaches into another package with a relative path (../../web/crab.optimized.svg) — import the package by name instead.
Boundary violation [package:third-party-deep-import] packages/ui/src/duckdb-query.ts:2— packages/ui/src/duckdb-query.ts:2 imports @duckdb/duckdb-wasm/dist/duckdb-mvp.wasm?url, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/ui/src/duckdb-query.ts:3— packages/ui/src/duckdb-query.ts:3 imports @duckdb/duckdb-wasm/dist/duckdb-browser-mvp.worker.js?url, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/ui/src/pdf-preview.tsx:8— packages/ui/src/pdf-preview.tsx:8 imports pdfjs-dist/build/pdf.worker.min.mjs?url, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
Boundary violation [package:third-party-deep-import] packages/ui/src/sqlite-query.worker.ts:2— packages/ui/src/sqlite-query.worker.ts:2 imports sql.js/dist/sql-wasm.wasm?url, reaching past a declared dependency's public entry into its build output — that path is the package's toolchain layout, not its API, and a minor version bump can relocate it with no semver signal. Import from the package's documented entry point instead.
AC6 · Visual & motion safety· Focus outline removed in CSS without a · ×4
Focus outline removed in CSS without a :focus replacement packages/ui/src/style.css:4516— `.tree-search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/style.css:5013— `.code-symbols-search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/style.css:5188— `.data-search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
Focus outline removed in CSS without a :focus replacement packages/ui/src/style.css:5656— `.data-schema-search input` sets the outline to none/0 and no visible :focus / :focus-visible style for that element replaces it in this stylesheet, so a keyboard user cannot see where focus is. Draw a focus ring (outline, box-shadow or border) under :focus-visible.
crab_staging::stream::stage_file_streaming_inner (cyclomatic 33) crates/crab-staging/src/stream.rs:602— crab_staging::stream::stage_file_streaming_inner has cyclomatic complexity 33 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
crab_staging::add_push_plan::prepare_one_file_plan_with_existing_refs (cyclomatic 24) crates/crab-staging/src/add_push_plan.rs:748— crab_staging::add_push_plan::prepare_one_file_plan_with_existing_refs 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.
crab_staging::stream::flush_batch (cyclomatic 19) crates/crab-staging/src/stream.rs:1351— crab_staging::stream::flush_batch has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab_staging::stage_owned_chunks_batch_blocking (cyclomatic 17) crates/crab-staging/src/lib.rs:1808— crab_staging::stage_owned_chunks_batch_blocking 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.
crab_sdk::client::mutation::native_content::prepare_native_sources (cyclomatic 28) crates/crab-sdk/src/client/mutation/native_content.rs:76— crab_sdk::client::mutation::native_content::prepare_native_sources has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
crab_sdk::local::push::content::prepare (cyclomatic 18) crates/crab-sdk/src/local/push/content.rs:4— crab_sdk::local::push::content::prepare 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.
crab_sdk::local::fetch::prepare_fetch_intent (cyclomatic 17) crates/crab-sdk/src/local/fetch.rs:130— crab_sdk::local::fetch::prepare_fetch_intent has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
crab_sdk::runtime::execute (cyclomatic 17) crates/crab-sdk/src/runtime.rs:150— crab_sdk::runtime::execute has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
crab_s3_gateway::multipart::register_part (cyclomatic 26) crates/crab-s3-gateway/src/multipart.rs:526— crab_s3_gateway::multipart::register_part 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.
crab_s3_gateway::mutation::build_commit (cyclomatic 26) crates/crab-s3-gateway/src/mutation.rs:2404— crab_s3_gateway::mutation::build_commit has cyclomatic complexity 26 (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.
crab_s3_gateway::multipart::reconcile_capacity_slot (cyclomatic 24) crates/crab-s3-gateway/src/multipart.rs:1425— crab_s3_gateway::multipart::reconcile_capacity_slot has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
crab_s3_gateway::mutation::upload_built_batch (cyclomatic 16) crates/crab-s3-gateway/src/mutation.rs:1770— crab_s3_gateway::mutation::upload_built_batch has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RepositoryCellScheduler::scan_cycle (cyclomatic 20) crates/crab-http-server/src/cells/scheduler.rs:307— RepositoryCellScheduler::scan_cycle 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.
RepositoryCellScheduler::process_cell (cyclomatic 18) crates/crab-http-server/src/cells/scheduler.rs:682— RepositoryCellScheduler::process_cell 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.
RepositoryCellScheduler::schedule_node_recovery (cyclomatic 18) crates/crab-http-server/src/cells/scheduler.rs:870— RepositoryCellScheduler::schedule_node_recovery 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.
RepositoryCellScheduler::schedule_migrations (cyclomatic 16) crates/crab-http-server/src/cells/scheduler.rs:488— RepositoryCellScheduler::schedule_migrations 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.
Repeated repair: crab/src/cmd/mount.rs crab/src/cmd/mount.rs:538— crab/src/cmd/mount.rs changed 6 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is crab::cmd::mount::run_mount_with_new_cli at line 538), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(crates): tighten data integrity, cleanup, and diagnostic contracts (#159)”; “fix(vfs): harden macOS NFS mount lifecycle (#140)”; “fix: harden Linux NFS mount parity (#109)”; “fix(ci): stabilize hosted Rust and protocol gates (#50)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/cmd/mount.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crab/src/cmd/lfs/checkout.rs crab/src/cmd/lfs/checkout.rs:184— crab/src/cmd/lfs/checkout.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is crab::cmd::lfs::checkout::checkout_file at line 184), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(s3): harden burst load and large-object clones (#175)”; “fix(lfs): make Crab LFS direct-only (#88)”; “fix(lfs): harden mixed LFS and Xet workflows (#68)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crab/src/cmd/lfs/checkout.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/crab-vfs/src/engine.rs crates/crab-vfs/src/engine.rs:1435— crates/crab-vfs/src/engine.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is VfsEngine::read_at at line 1435), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(crates): tighten data integrity, cleanup, and diagnostic contracts (#159)”; “fix(vfs): harden macOS NFS mount lifecycle (#140)”; “fix: harden NFS Xet mounts and operator workflow (#104)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crates/crab-vfs/src/engine.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/crab-vfs/src/nfs_mount.rs crates/crab-vfs/src/nfs_mount.rs:255— crates/crab-vfs/src/nfs_mount.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 15 (its worst body is crab_vfs::nfs_mount::run_until_cancelled at line 255), AT OR UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(crates): tighten data integrity, cleanup, and diagnostic contracts (#159)”; “fix(vfs): harden macOS NFS mount lifecycle (#140)”; “fix: harden Linux NFS mount parity (#109)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-06-29..2026-09-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-06-29 21:58:14 -07:00' --until='2026-09-27 21:58:14 -07:00' --full-history --no-merges -- crates/crab-vfs/src/nfs_mount.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.
Store::put_multipart_file_resumable (cognitive 101) crates/crab-storage/src/store.rs:1792— Store::put_multipart_file_resumable has cognitive complexity 101 (threshold 15). Drivers by points: if/else 24 (65 pts), match/switch 10 (30 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 62). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Store::put_multipart_source_once (cognitive 26) crates/crab-storage/src/store.rs:2484— Store::put_multipart_source_once has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 4 (8 pts), loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Store::upload_missing_parts (cognitive 22) crates/crab-storage/src/store.rs:2170— Store::upload_missing_parts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (4 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.
Store::put_multipart_once (cognitive 20) crates/crab-storage/src/store.rs:2402— Store::put_multipart_once has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (5 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_cache_server::bin::crab_cache::evidence (cognitive 90) crates/crab-cache-server/src/bin/crab_cache.rs:422— crab_cache_server::bin::crab_cache::evidence has cognitive complexity 90 (threshold 15). Drivers by points: if/else 42 (87 pts), boolean chains 2, match/switch 1 (nesting depth added 45). 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.
crab_cache_server::bin::crab_cache::onboarding (cognitive 39) crates/crab-cache-server/src/bin/crab_cache.rs:578— crab_cache_server::bin::crab_cache::onboarding has cognitive complexity 39 (threshold 15). Drivers by points: if/else 17 (33 pts), match/switch 3 (6 pts) (nesting depth added 19). 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.
crab_cache_server::cache_store::reconcile_unindexed_files (cognitive 33) crates/crab-cache-server/src/cache_store.rs:1675— crab_cache_server::cache_store::reconcile_unindexed_files has cognitive complexity 33 (threshold 15). Drivers by points: if/else 4 (20 pts), loops 3 (8 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_cache_server::handlers::fetch_and_cache_data_locked (cognitive 24) crates/crab-cache-server/src/handlers.rs:1619— crab_cache_server::handlers::fetch_and_cache_data_locked has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 4 (8 pts), boolean chains 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_remote_git::visibility::rebuild_with_operation (cognitive 34) crates/crab-remote-git/src/visibility.rs:55— crab_remote_git::visibility::rebuild_with_operation has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 4 (9 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_remote_git::pack::produce_request_cached_pack (cognitive 23) crates/crab-remote-git/src/pack.rs:1783— crab_remote_git::pack::produce_request_cached_pack has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_remote_git::pack::produce_cached_pack (cognitive 22) crates/crab-remote-git/src/pack.rs:1559— crab_remote_git::pack::produce_cached_pack has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_remote_git::reader::parse_pack_index (cognitive 21) crates/crab-remote-git/src/reader.rs:2407— crab_remote_git::reader::parse_pack_index has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepositoryCellScheduler::scan_cycle (cognitive 32) crates/crab-http-server/src/cells/scheduler.rs:307— RepositoryCellScheduler::scan_cycle has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 5, 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.
RepositoryCellScheduler::schedule_node_recovery (cognitive 28) crates/crab-http-server/src/cells/scheduler.rs:870— RepositoryCellScheduler::schedule_node_recovery has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 2 (4 pts), match/switch 1 (3 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.
RepositoryCellScheduler::schedule_migrations (cognitive 27) crates/crab-http-server/src/cells/scheduler.rs:488— RepositoryCellScheduler::schedule_migrations has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 4, match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepositoryCellScheduler::process_cell (cognitive 23) crates/crab-http-server/src/cells/scheduler.rs:682— RepositoryCellScheduler::process_cell has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 4 (6 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.
crab_coordination::lease_operation::while_renewing_at (cognitive 22) crates/crab-coordination/src/lease_operation.rs:102— crab_coordination::lease_operation::while_renewing_at has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 2 (9 pts), loops 1 (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
crab_coordination::push_lock::retry_coordination_operation_with_deadline (cognitive 19) crates/crab-coordination/src/push_lock.rs:1021— crab_coordination::push_lock::retry_coordination_operation_with_deadline has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_coordination::gc_fence::release_holder (cognitive 18) crates/crab-coordination/src/gc_fence.rs:959— crab_coordination::gc_fence::release_holder has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 4 (7 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_coordination::active_active::validate_active_active_config (cognitive 16) crates/crab-coordination/src/active_active.rs:136— crab_coordination::active_active::validate_active_active_config has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (7 members, 50+ identical tokens) crab/src/cmd/adopt.rs:275— crab/src/cmd/adopt.rs:275-333 | crab/src/cmd/adopt.rs:355-411 | crab/src/cmd/init.rs:743-804 | crab/src/cmd/reset.rs:301-358 | crab/src/cmd/setup.rs:539-616 | crab/src/cmd/status.rs:388-450 | crab/src/cmd/unadopt.rs:207-269 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/crab-http-server/src/checks.rs:869— crates/crab-http-server/src/checks.rs:869-877 | crates/crab-http-server/src/issues.rs:705-713 | crates/crab-http-server/src/labels.rs:339-347 | crates/crab-http-server/src/pulls/storage.rs:843-851 | crates/crab-http-server/src/releases/storage.rs:443-451 | crates/crab-http-server/src/repository_settings.rs:258-266 | crates/crab-http-server/src/statuses.rs:428-436 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/crab-http-server/src/checks.rs:879— crates/crab-http-server/src/checks.rs:879-891 | crates/crab-http-server/src/issues.rs:715-727 | crates/crab-http-server/src/labels.rs:349-361 | crates/crab-http-server/src/pulls/storage.rs:854-866 | crates/crab-http-server/src/releases/storage.rs:453-465 | crates/crab-http-server/src/repository_settings.rs:268-280 | crates/crab-http-server/src/statuses.rs:438-450 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/crab-vfs/src/publish.rs:999— crates/crab-vfs/src/publish.rs:999-1025 | crates/crab-vfs/src/publish.rs:1027-1075 | crates/crab-vfs/src/publish.rs:1235-1292 | crates/crab-vfs/src/publish.rs:1314-1374 | crates/crab-vfs/src/publish.rs:1379-1417 | crates/crab-vfs/src/publish.rs:1592-1614 | crates/crab-vfs/src/publish.rs:1616-1653 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Edited copies of one member (3 members, 24+ corresponding lines) · ×4
Edited copies of one member (3 members, 24+ corresponding lines) crates/crab-http-server/src/cells/repository/pull_review_threads.rs:513— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:513-556 | crates/crab-http-server/src/cells/repository/pulls.rs:937-960 | crates/crab-http-server/src/cells/repository/pulls.rs:1102-1125 — 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) crab/src/cmd/adopt.rs:204— crab/src/cmd/adopt.rs:204-227 | crab/src/cmd/init.rs:711-735 | crab/src/cmd/setup.rs:381-414 — 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) crab/src/cmd/lfs/fsck.rs:358— crab/src/cmd/lfs/fsck.rs:358-381 | crab/src/cmd/lfs/ls_files.rs:358-391 | crab/src/lfs/status.rs:543-569 — 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/crab-coordination/src/cosmosdb_coordinator.rs:625— crates/crab-coordination/src/cosmosdb_coordinator.rs:625-648 | crates/crab-coordination/src/dynamodb_coordinator.rs:894-917 | crates/crab-coordination/src/spanner_coordinator.rs:927-950 — 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 copy of a member (43 corresponding lines) · ×4
Edited copy of a member (43 corresponding lines) crab/src/cmd/metrics.rs:1331— crab/src/cmd/metrics.rs:1331-1383 | crab/src/cmd/metrics.rs:1389-1431 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) crab/src/import/journal.rs:424— crab/src/import/journal.rs:424-467 | crates/crab-metadata/src/persistent_chunk_index.rs:592-634 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) crab/src/cmd/replica.rs:12636— crab/src/cmd/replica.rs:12636-12679 | crab/src/cmd/replica.rs:12798-12840 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (43 corresponding lines) crates/crab-vfs/src/daemon.rs:315— crates/crab-vfs/src/daemon.rs:315-361 | crates/crab-vfs/src/overlay.rs:116-158 — These two members are one piece of code written twice and then edited apart: 43 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (33 corresponding lines) · ×4
Edited copy of a member (33 corresponding lines) crates/crab-http-server/src/labels.rs:186— crates/crab-http-server/src/labels.rs:186-223 | crates/crab-http-server/src/labels.rs:230-262 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) crab/src/cmd/recover.rs:1482— crab/src/cmd/recover.rs:1482-1514 | crab/src/cmd/recover.rs:1516-1559 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) crates/crab-vfs/src/mount_control.rs:264— crates/crab-vfs/src/mount_control.rs:264-296 | crates/crab-vfs/src/mount_control.rs:298-333 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (33 corresponding lines) crab/src/git/progress.rs:469— crab/src/git/progress.rs:469-502 | crab/src/git/progress.rs:512-544 — These two members are one piece of code written twice and then edited apart: 33 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 22+ corresponding lines) · ×4
Edited copies of one member (3 members, 22+ corresponding lines) crab/src/cmd/exp.rs:2862— crab/src/cmd/exp.rs:2862-2887 | crab/src/cmd/exp.rs:4075-4098 | crab/src/cmd/recover.rs:2798-2819 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 22+ corresponding lines) crates/crab-sdk/src/managed.rs:304— crates/crab-sdk/src/managed.rs:304-326 | crates/crab-sdk/src/managed.rs:335-356 | crates/crab-sdk/src/managed.rs:365-386 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 22+ corresponding lines) crates/crab-cache-server/src/chunk_index.rs:112— crates/crab-cache-server/src/chunk_index.rs:112-135 | crates/crab-metadata/src/persistent_chunk_index.rs:271-296 | crates/crab-metadata/src/persistent_chunk_index.rs:314-335 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 22+ corresponding lines) crates/crab-staging/src/index.rs:1429— crates/crab-staging/src/index.rs:1429-1460 | crates/crab-staging/src/index.rs:1468-1489 | crates/crab-staging/src/index.rs:1495-1521 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 22 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 21+ corresponding lines) · ×4
Edited copies of one member (3 members, 21+ corresponding lines) crates/crab-write/src/generation.rs:703— crates/crab-write/src/generation.rs:703-725 | crates/crab-write/src/generation.rs:733-753 | crates/crab-write/src/generation.rs:918-938 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 21+ corresponding lines) crates/crab-auth-server/src/view/git_workspace.rs:415— crates/crab-auth-server/src/view/git_workspace.rs:415-438 | crates/crab-auth-server/src/view/git_workspace.rs:443-464 | crates/crab-auth-server/src/view/git_workspace.rs:469-489 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 21+ corresponding lines) crab/src/git/push.rs:5780— crab/src/git/push.rs:5780-5802 | crab/src/git/push.rs:6403-6423 | crates/crab-write/src/journal.rs:445-466 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 21+ corresponding lines) crab/src/import/journal.rs:1017— crab/src/import/journal.rs:1017-1043 | crab/src/import/journal.rs:1051-1077 | crab/src/import/journal.rs:1081-1101 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 19+ corresponding lines) · ×4
Edited copies of one member (3 members, 19+ corresponding lines) crates/crab-workflow/src/exp_worktree.rs:841— crates/crab-workflow/src/exp_worktree.rs:841-860 | crates/crab-workflow/src/exp_worktree.rs:862-889 | crates/crab-workflow/src/exp_worktree.rs:891-909 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) crab/src/cmd/recover.rs:2959— crab/src/cmd/recover.rs:2959-2978 | crab/src/cmd/status_workflow.rs:824-843 | crab/src/lfs/prune.rs:444-462 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) crab/src/cmd/exp.rs:5789— crab/src/cmd/exp.rs:5789-5810 | crab/src/cmd/exp.rs:5812-5830 | crab/src/cmd/exp.rs:5832-5850 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 19+ corresponding lines) crab/src/lfs/track.rs:506— crab/src/lfs/track.rs:506-524 | crab/src/lfs/track.rs:526-544 | crab/src/lfs/track.rs:546-564 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 19 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×4
Edited copies of one member (3 members, 11+ corresponding lines) crab/src/cmd/metadb.rs:2266— crab/src/cmd/metadb.rs:2266-2277 | crates/crab-remote-git/src/operation.rs:1202-1212 | crates/crab-write/src/lib.rs:73-83 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) crates/crab-auth-server/src/receive/git_workspace.rs:1089— crates/crab-auth-server/src/receive/git_workspace.rs:1089-1103 | crates/crab-auth-server/src/receive/git_workspace.rs:1108-1120 | crates/crab-auth-server/src/receive/git_workspace.rs:1127-1137 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) crab/src/cmd/artifacts.rs:796— crab/src/cmd/artifacts.rs:796-806 | crab/src/cmd/data.rs:1989-1999 | crab/src/cmd/migrate.rs:2701-2711 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 11+ corresponding lines) crab/src/cmd/clone.rs:612— crab/src/cmd/clone.rs:612-624 | crab/src/cmd/mount.rs:2076-2086 | crab/src/git/remote_helper.rs:1919-1932 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×4
Edited copies of one member (4 members, 10+ corresponding lines) crab/src/cmd/migrate.rs:1592— crab/src/cmd/migrate.rs:1592-1602 | crates/crab-cache-server/src/cache_store.rs:1949-1958 | crates/crab-metadata/src/split_commit_graph.rs:1041-1051 | crates/crab-workflow/src/stage_runtime.rs:405-415 — 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) crab/src/cmd/replica.rs:5002— crab/src/cmd/replica.rs:5002-5016 | crab/src/cmd/replica.rs:6154-6163 | crab/src/cmd/replica.rs:6221-6230 | crab/src/cmd/replica.rs:6269-6278 — 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) crab/src/cmd/init.rs:127— crab/src/cmd/init.rs:127-136 | crab/src/cmd/metadb.rs:1113-1129 | crab/src/git/push.rs:5615-5630 | crab/src/git/push.rs:5638-5653 — 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) crab/src/cmd/mount.rs:3934— crab/src/cmd/mount.rs:3934-3945 | crates/crab-vfs/src/coordinator.rs:151-161 | crates/crab-vfs/src/ipc_client.rs:292-301 | crates/crab-vfs/src/mounts_registry.rs:62-71 — 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.
Duplicated block (21 lines × 2) crab/src/cmd/metrics.rs:2739— crab/src/cmd/metrics.rs:2739-2759 | crab/src/cmd/metrics.rs:2768-2788 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/metrics.rs:2739` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) crates/crab-http-server/src/peer.rs:1141— crates/crab-http-server/src/peer.rs:1141-1161 | crates/crab-http-server/src/peer.rs:1234-1254 — both copies are in the same file, so extract the block into 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/crab-staging/src/push_plan.rs:224— crates/crab-staging/src/push_plan.rs:224-244 | crates/crab-staging/src/push_plan.rs:260-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/crab-workflow/src/exp_worktree.rs:1076— crates/crab-workflow/src/exp_worktree.rs:1076-1096 | crates/crab-workflow/src/exp_worktree.rs:1119-1139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-workflow/src/exp_worktree.rs:1076` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 2) crab/src/cmd/lfs/fsck.rs:128— crab/src/cmd/lfs/fsck.rs:128-147 | crab/src/lfs/prune.rs:367-385 — before extracting anything, compare `crab/src/cmd/lfs/fsck.rs` and `crab/src/lfs/prune.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 `crab/src/cmd/lfs/fsck.rs:128` it does not close everything it opens, so those 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 (19–20 lines × 2) crab/src/cmd/run.rs:2237— crab/src/cmd/run.rs:2237-2255 | crab/src/cmd/run.rs:2873-2892 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/run.rs:2237` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 2) crates/crab-coordination/src/write_coordinator.rs:989— crates/crab-coordination/src/write_coordinator.rs:989-1007 | crates/crab-coordination/src/write_coordinator.rs:1476-1495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-coordination/src/write_coordinator.rs:1476` 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 (19–20 lines × 2) crates/crab-git/src/worktree.rs:164— crates/crab-git/src/worktree.rs:164-182 | crates/crab-git/src/worktree.rs:205-224 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-git/src/worktree.rs:205` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) crab/src/cmd/adopt.rs:741— crab/src/cmd/adopt.rs:741-755 | crab/src/cmd/unadopt.rs:341-355 | crab/src/cmd/undo.rs:115-129 — before extracting anything, compare `crab/src/cmd/adopt.rs` and `crab/src/cmd/unadopt.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 108 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 (15 lines × 3) crab/src/cmd/metrics.rs:989— crab/src/cmd/metrics.rs:989-1003 | crab/src/cmd/metrics.rs:1021-1035 | crab/src/cmd/metrics.rs:1059-1073 — 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 `crab/src/cmd/metrics.rs:989` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) crab/src/cmd/run.rs:772— crab/src/cmd/run.rs:772-786 | crab/src/cmd/run.rs:2212-2226 | crab/src/cmd/run.rs:2848-2862 — 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 `crab/src/cmd/run.rs:772` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) crab/src/git/push.rs:5354— crab/src/git/push.rs:5354-5368 | crab/src/git/push.rs:5383-5397 | crab/src/git/push.rs:5419-5434 — 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 `crab/src/git/push.rs:5354` it begins part-way through the construct above it, so those exact lines 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) crab/src/git/smudge.rs:179— crab/src/git/smudge.rs:179-193 | crab/src/git/smudge.rs:225-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/smudge.rs:179` it does not close everything it opens, so those exact lines 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/crab-cache-store/src/lib.rs:584— crates/crab-cache-store/src/lib.rs:584-596 | crates/crab-cache-store/src/lib.rs:605-619 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-cache-store/src/lib.rs:584` 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–15 lines × 2) crates/crab-coordination/src/push_admission.rs:186— crates/crab-coordination/src/push_admission.rs:186-200 | crates/crab-coordination/src/push_admission.rs:211-223 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-coordination/src/push_admission.rs:186` it begins part-way through the construct above it, so those exact lines 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) crab/deploy/auth-service/scripts/e2e-path-acl-local.py:142— crab/deploy/auth-service/scripts/e2e-path-acl-local.py:142-154 | crab/deploy/auth-service/scripts/e2e-path-acl-local.py:185-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/deploy/auth-service/scripts/e2e-path-acl-local.py:185` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) crates/crab-metadata/src/git_object_locator/reader.rs:553— crates/crab-metadata/src/git_object_locator/reader.rs:553-566 | crates/crab-metadata/src/git_object_locator/reader.rs:608-622 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-metadata/src/git_object_locator/reader.rs:553` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) crates/crab-metadata/src/persistent_chunk_index.rs:272— crates/crab-metadata/src/persistent_chunk_index.rs:272-286 | crates/crab-metadata/src/persistent_chunk_index.rs:319-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) crates/crab-workflow/src/journal.rs:455— crates/crab-workflow/src/journal.rs:455-469 | crates/crab-workflow/src/journal.rs:627-640 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-workflow/src/journal.rs:455` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14–15 lines × 2) crates/crab-workflow/src/materialize.rs:94— crates/crab-workflow/src/materialize.rs:94-108 | crates/crab-workflow/src/materialize.rs:173-186 — both copies are in the same file, so extract the 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/crab-workflow/src/materialize.rs:172` calls `validate_tree_manifest` and `crates/crab-workflow/src/materialize.rs:93` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 4) crab/src/cmd/add.rs:3450— crab/src/cmd/add.rs:3450-3462 | crab/src/cmd/dehydrate.rs:444-456 | crab/src/cmd/hydrate.rs:3526-3538 | crab/src/cmd/reset.rs:481-493 — before extracting anything, compare `crab/src/cmd/add.rs` and `crab/src/cmd/dehydrate.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:3450` it begins part-way through the construct above it, so those exact lines 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 × 4) crab/src/cmd/data.rs:1761— crab/src/cmd/data.rs:1761-1773 | crab/src/cmd/exp.rs:1891-1903 | crab/src/cmd/exp.rs:2305-2317 | crab/src/cmd/exp.rs:2418-2430 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/data.rs:1761` 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 × 4) crab/src/cmd/dehydrate.rs:396— crab/src/cmd/dehydrate.rs:396-408 | crab/src/cmd/hydrate.rs:3478-3490 | crab/src/cmd/reset.rs:433-445 | crab/src/cmd/status.rs:655-667 — before extracting anything, compare `crab/src/cmd/dehydrate.rs` and `crab/src/cmd/hydrate.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 223 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 (13 lines × 4) crab/src/git/progress.rs:843— crab/src/git/progress.rs:843-855 | crab/src/git/progress.rs:892-904 | crab/src/git/progress.rs:1238-1250 | crab/src/git/progress.rs:1287-1299 — 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 `crab/src/git/progress.rs:843` 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 × 4) crab/src/cmd/run.rs:3504— crab/src/cmd/run.rs:3504-3515 | crab/src/cmd/status_workflow.rs:939-950 | REDACTED:2375-2386 | REDACTED:2554-2565 — before extracting anything, compare `crab/src/cmd/run.rs` and `crab/src/cmd/status_workflow.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 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 `crab/src/cmd/run.rs:3504` 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 × 4) crates/crab-auth/src/aws_oidc.rs:134— crates/crab-auth/src/aws_oidc.rs:134-145 | crates/crab-auth/src/azure_entra.rs:160-171 | crates/crab-auth/src/crab_auth_client.rs:446-457 | crates/crab-auth/src/gcp_federation.rs:190-201 — before extracting anything, compare `crates/crab-auth/src/aws_oidc.rs` and `crates/crab-auth/src/azure_entra.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-auth/src/aws_oidc.rs:134` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 4) crates/crab-auth/src/aws_oidc.rs:58— crates/crab-auth/src/aws_oidc.rs:58-69 | crates/crab-auth/src/azure_entra.rs:89-100 | crates/crab-auth/src/crab_auth_client.rs:129-140 | crates/crab-auth/src/gcp_federation.rs:90-101 — before extracting anything, compare `crates/crab-auth/src/aws_oidc.rs` and `crates/crab-auth/src/azure_entra.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `cached` to `Option<&CachedAwsCreds>` in one and `Option<&CachedAzureCreds>` 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 × 4) crab/scripts/verify-nfs-smoke-report.py:4433— crab/scripts/verify-nfs-smoke-report.py:4433-4444 | crab/scripts/verify-nfs-smoke-report.py:4517-4528 | crab/scripts/verify-nfs-smoke-report.py:4613-4624 | crab/scripts/verify-nfs-smoke-report.py:4639-4650 — 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 `crab/scripts/verify-nfs-smoke-report.py:4433` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 2) crab/scripts/generate_test_file.rs:288— crab/scripts/generate_test_file.rs:288-299 | crates/crab-workflow/src/cache.rs:116-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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–12 lines × 2) crab/src/cmd/metrics.rs:3658— crab/src/cmd/metrics.rs:3658-3669 | crab/src/cmd/metrics.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 `crab/src/cmd/metrics.rs:3658` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) crab/src/cmd/migrate.rs:2525— crab/src/cmd/migrate.rs:2525-2536 | crab/src/cmd/migrate.rs:2605-2615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/migrate.rs:2525` it begins part-way through the construct above it, so those 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/crab-metadata/src/git_visibility.rs:1885— crates/crab-metadata/src/git_visibility.rs:1885-1896 | crates/crab-metadata/src/git_visibility.rs:2181-2191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-metadata/src/git_visibility.rs:1885` it begins part-way through the construct above it, so those exact lines 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 × 6) crab/src/cmd/workflow_checkpoint.rs:792— crab/src/cmd/workflow_checkpoint.rs:792-800 | crates/crab-workflow/src/artifact.rs:346-354 | crates/crab-workflow/src/checkpoint.rs:121-129 | crates/crab-workflow/src/dvc_inventory.rs:408-416 | crates/crab-workflow/src/external_hash.rs:114-122 | crates/crab-workflow/src/source.rs:77-85 — before extracting anything, compare `crates/crab-workflow/src/artifact.rs` and `crates/crab-workflow/src/checkpoint.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `crab/src/cmd/workflow_checkpoint.rs:792` 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 × 6) crates/crab-http-server/src/checks.rs:833— crates/crab-http-server/src/checks.rs:833-841 | crates/crab-http-server/src/issues.rs:677-685 | crates/crab-http-server/src/labels.rs:303-311 | crates/crab-http-server/src/pulls/storage.rs:817-825 | crates/crab-http-server/src/releases/storage.rs:416-424 | crates/crab-http-server/src/statuses.rs:342-350 — before extracting anything, compare `crates/crab-http-server/src/checks.rs` and `crates/crab-http-server/src/issues.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 6) crab/src/cmd/replica.rs:2886— crab/src/cmd/replica.rs:2886-2895 | crab/src/cmd/replica.rs:2936-2944 | crab/src/replication/mod.rs:7458-7466 | crab/src/replication/mod.rs:7487-7495 | crab/src/replication/mod.rs:7567-7575 | crab/src/replication/mod.rs:7596-7604 — before extracting anything, compare `crab/src/cmd/replica.rs` and `crab/src/replication/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 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 `crab/src/cmd/replica.rs:2886` it begins part-way through the construct above it, so those 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 × 6) crab/src/cmd/replica.rs:4390— crab/src/cmd/replica.rs:4390-4398 | crab/src/cmd/replica.rs:4404-4412 | crab/src/cmd/replica.rs:4418-4426 | crab/src/cmd/replica.rs:4434-4443 | crab/src/cmd/replica.rs:4451-4460 | crab/src/cmd/replica.rs:4468-4477 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/replica.rs:4390` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 5) crab/src/cmd/add.rs:3449— crab/src/cmd/add.rs:3449-3457 | crab/src/cmd/dehydrate.rs:443-451 | crab/src/cmd/hydrate.rs:3525-3533 | crab/src/cmd/reset.rs:480-488 | crab/src/cmd/status.rs:759-767 — before extracting anything, compare `crab/src/cmd/add.rs` and `crab/src/cmd/dehydrate.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:3449` 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 × 5) crates/crab-remote-git/src/error.rs:495— crates/crab-remote-git/src/error.rs:495-503 | crates/crab-sdk/src/content/crab.rs:283-291 | crates/crab-sdk/src/remote_error.rs:139-147 | crates/crab-sdk/src/remote_error.rs:199-207 | crates/crab-storage/src/error.rs:178-186 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 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/crab-remote-git/src/error.rs:495` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `source` to `crab_read::ReadError` in one and `std::io::Error` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (9 lines × 5) crates/crab-workflow/src/lockfile.rs:950— crates/crab-workflow/src/lockfile.rs:950-958 | crates/crab-workflow/src/lockfile.rs:969-978 | crates/crab-workflow/src/lockfile.rs:995-1003 | crates/crab-workflow/src/lockfile.rs:1022-1030 | crates/crab-workflow/src/lockfile.rs:1072-1080 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-workflow/src/lockfile.rs:950` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 5) crab/scripts/check-architecture-gates.py:3173— crab/scripts/check-architecture-gates.py:3173-3181 | crab/scripts/check-architecture-gates.py:4466-4474 | crab/scripts/check-architecture-gates.py:4528-4536 | crab/scripts/check-architecture-gates.py:4592-4600 | crab/scripts/check-architecture-gates.py:4709-4717 — 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 (9 lines × 4) crab/src/cmd/run.rs:3438— crab/src/cmd/run.rs:3438-3446 | crab/src/cmd/status_workflow.rs:902-910 | REDACTED:2301-2309 | REDACTED:2456-2464 — before extracting anything, compare `crab/src/cmd/run.rs` and `crab/src/cmd/status_workflow.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 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 `crab/src/cmd/run.rs:3438` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) crates/crab-workflow/src/exp_worktree.rs:1160— crates/crab-workflow/src/exp_worktree.rs:1160-1168 | crates/crab-workflow/src/exp_worktree.rs:1179-1187 | crates/crab-workflow/src/params.rs:309-317 | crates/crab-workflow/src/params.rs:327-335 — before extracting anything, compare `crates/crab-workflow/src/exp_worktree.rs` and `crates/crab-workflow/src/params.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 94 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 4) crab/src/cmd/push.rs:497— crab/src/cmd/push.rs:497-505 | crab/src/cmd/push.rs:780-788 | crab/src/cmd/push.rs:815-823 | crab/src/cmd/push.rs:878-886 — 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 `crab/src/cmd/push.rs:497` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 4) crab/scripts/check-architecture-gates.py:3177— crab/scripts/check-architecture-gates.py:3177-3185 | crab/scripts/check-architecture-gates.py:3614-3622 | crab/scripts/check-architecture-gates.py:4410-4418 | crab/scripts/check-architecture-gates.py:4596-4604 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–9 lines × 2) crab/src/git/push_native.rs:1066— crab/src/git/push_native.rs:1066-1072 | crab/src/git/push_native.rs:1352-1360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/push_native.rs:1066` it does not close everything it opens, so those 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–9 lines × 2) crab/src/tier/provider/s3.rs:67— crab/src/tier/provider/s3.rs:67-75 | crab/src/tier/provider/s3.rs:555-561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–9 lines × 2) crates/crab-cache-store/src/lib.rs:1519— crates/crab-cache-store/src/lib.rs:1519-1525 | crates/crab-cache-store/src/lib.rs:1569-1577 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-cache-store/src/lib.rs:1519` it does not close everything it opens, so those 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–9 lines × 2) crates/crab-metadata/src/receipts.rs:277— crates/crab-metadata/src/receipts.rs:277-283 | crates/crab-metadata/src/value_codec.rs:54-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-metadata/src/value_codec.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.
Duplicated block (7–8 lines × 2) crab/src/cmd/exp.rs:6051— crab/src/cmd/exp.rs:6051-6057 | crab/src/cmd/exp.rs:6218-6225 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) crab/src/cmd/lfs/mod.rs:704— crab/src/cmd/lfs/mod.rs:704-710 | crates/crab-vfs/src/publish.rs:1547-1554 — 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 `crab/src/cmd/lfs/mod.rs:704` it does not close everything it opens, so those exact lines 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–8 lines × 2) crates/crab-sdk/src/local/push/git.rs:19— crates/crab-sdk/src/local/push/git.rs:19-25 | crates/crab-sdk/src/local/push/git.rs:48-55 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-sdk/src/local/push/git.rs:19` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7–8 lines × 2) crab/src/cache/add_validation.rs:80— crab/src/cache/add_validation.rs:80-86 | crates/crab-staging/src/index.rs:6297-6304 — 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 `crab/src/cache/add_validation.rs:80` it does not close everything it opens, so those 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–8 lines × 2) crab/src/cmd/hydrate.rs:1645— crab/src/cmd/hydrate.rs:1645-1650 | crab/src/cmd/hydrate.rs:2004-2011 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/hydrate.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 (6–8 lines × 2) crab/src/cmd/metadb.rs:2044— crab/src/cmd/metadb.rs:2044-2051 | crab/src/cmd/metadb.rs:2091-2096 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/metadb.rs:2044` it does not close everything it opens, so those 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–8 lines × 2) crab/src/cmd/run.rs:2459— crab/src/cmd/run.rs:2459-2464 | crab/src/cmd/run.rs:4429-4436 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/run.rs:2459` 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–8 lines × 2) crates/crab-workflow/src/artifact.rs:643— crates/crab-workflow/src/artifact.rs:643-648 | crates/crab-workflow/src/artifact.rs:1065-1072 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-workflow/src/artifact.rs:643` it does not close everything it opens, so those 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 × 5) crates/crab-http-server/src/cells.rs:471— crates/crab-http-server/src/cells.rs:471-477 | crates/crab-http-server/src/cells.rs:1066-1072 | crates/crab-http-server/src/cells.rs:1272-1278 | crates/crab-http-server/src/cells.rs:1356-1362 | crates/crab-http-server/src/cells.rs:1421-1427 — 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 lines × 5) crates/crab-http-server/src/cells.rs:831— crates/crab-http-server/src/cells.rs:831-837 | crates/crab-http-server/src/cells.rs:1667-1673 | crates/crab-http-server/src/cells/router.rs:685-691 | crates/crab-http-server/src/projection.rs:192-198 | crates/crab-http-server/src/projection.rs:243-249 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/cells.rs:831` it begins part-way through the construct above it, so those exact lines 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 × 5) crates/crab-staging/src/index.rs:2963— crates/crab-staging/src/index.rs:2963-2969 | crates/crab-staging/src/index.rs:3439-3447 | crates/crab-staging/src/index.rs:3768-3776 | crates/crab-staging/src/index.rs:4769-4777 | crates/crab-staging/src/index.rs:4908-4916 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-staging/src/index.rs:2963` it begins part-way through the construct above it, so those exact lines 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 × 5) crab/scripts/check-architecture-gates.py:2584— crab/scripts/check-architecture-gates.py:2584-2590 | crab/scripts/check-architecture-gates.py:2660-2666 | crab/scripts/check-architecture-gates.py:2706-2712 | crab/scripts/check-architecture-gates.py:2756-2762 | crab/scripts/check-architecture-gates.py:2806-2812 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/check-architecture-gates.py:2584` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2 locations) packages/ui/src/App.tsx:781— packages/ui/src/App.tsx:781 · packages/ui/src/App.tsx:842 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (15 lines × 2 locations) packages/ui/src/pulls.tsx:1063— packages/ui/src/pulls.tsx:1063 · packages/ui/src/pulls.tsx:1097 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (15 lines × 2 locations) packages/web/app/cli/page.tsx:569— packages/web/app/cli/page.tsx:569 · packages/web/app/cli/page.tsx:644 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (15 lines × 2 locations) packages/web/components/marketing/comparison-section.tsx:130— packages/web/components/marketing/comparison-section.tsx:130 · packages/web/components/marketing/comparison-section.tsx:155 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
X2 · Cancellation propagation· Async function without AbortSignal · ×4
Async function without AbortSignal: starCount packages/web/components/site-header.tsx:7— `starCount` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: loadArrowSource packages/ui/src/duckdb-query.ts:68— `loadArrowSource` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: mutateRelease packages/ui/src/release-api.ts:38— `mutateRelease` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
Async function without AbortSignal: changeContent packages/ui/src/content-editor.tsx:114— `changeContent` awaits `fetch(…)` but neither accepts an AbortSignal nor passes one on, so its caller cannot stop the request once it has started. Accept `{ signal }` and pass it through: `fetch(url, { signal })`.
crab_cache_server::bin::crab_cache::evidence (cyclomatic 38) crates/crab-cache-server/src/bin/crab_cache.rs:422— crab_cache_server::bin::crab_cache::evidence has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab_cache_server::bin::crab_cache::onboarding (cyclomatic 16) crates/crab-cache-server/src/bin/crab_cache.rs:578— crab_cache_server::bin::crab_cache::onboarding 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.
crab_cache_server::handlers::fetch_and_cache_data_locked (cyclomatic 16) crates/crab-cache-server/src/handlers.rs:1619— crab_cache_server::handlers::fetch_and_cache_data_locked has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Index::insert_file_push_plans (cyclomatic 36) crates/crab-staging/src/index.rs:6335— Index::insert_file_push_plans 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.
Index::insert_recipe_lease (cyclomatic 22) crates/crab-staging/src/index.rs:5060— Index::insert_recipe_lease 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.
Index::claim_prepared_chunks (cyclomatic 21) crates/crab-staging/src/index.rs:2283— Index::claim_prepared_chunks 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.
crab_cache::xet_chunk_cache::verify_xet_chunk_cache_entry (cyclomatic 20) crates/crab-cache/src/xet_chunk_cache.rs:655— crab_cache::xet_chunk_cache::verify_xet_chunk_cache_entry 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.
crab_cache::local_cache::maintenance::verify_file (cyclomatic 19) crates/crab-cache/src/local_cache/maintenance.rs:401— crab_cache::local_cache::maintenance::verify_file has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
crab_cache::local_cache::cached_remote_xorb_index (cyclomatic 16) crates/crab-cache/src/local_cache.rs:1455— crab_cache::local_cache::cached_remote_xorb_index 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.
Gateway::complete_multipart_upload (cyclomatic 20) crates/crab-s3-gateway/src/gateway.rs:2428— Gateway::complete_multipart_upload has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Gateway::list_objects_v2 (cyclomatic 18) crates/crab-s3-gateway/src/gateway.rs:2921— Gateway::list_objects_v2 has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Gateway::start_multipart_maintenance (cyclomatic 17) crates/crab-s3-gateway/src/gateway.rs:527— Gateway::start_multipart_maintenance 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.
PythonLiteralParser::parse_brace (cognitive 38) crates/crab-workflow/src/params.rs:554— PythonLiteralParser::parse_brace has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 2 (4 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonLiteralParser::parse_tuple_or_group (cognitive 17) crates/crab-workflow/src/params.rs:645— PythonLiteralParser::parse_tuple_or_group has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PythonLiteralParser::parse_number (cognitive 17) crates/crab-workflow/src/params.rs:687— PythonLiteralParser::parse_number has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3 (5 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitObjectLocatorWriter::write_locations_inner (cognitive 35) crates/crab-metadata/src/git_object_locator/writer.rs:558— GitObjectLocatorWriter::write_locations_inner has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (28 pts), boolean chains 4, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitObjectLocatorWriter::sweep_stale_pack_membership (cognitive 34) crates/crab-metadata/src/git_object_locator/writer.rs:1126— GitObjectLocatorWriter::sweep_stale_pack_membership has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (29 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitObjectLocatorWriter::load_or_initialize (cognitive 19) crates/crab-metadata/src/git_object_locator/writer.rs:264— GitObjectLocatorWriter::load_or_initialize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 5 (7 pts), boolean chains 3 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Validator::changed_path_hashes (cognitive 33) crates/crab-git/src/receive_plan/changed_paths.rs:33— Validator::changed_path_hashes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 4 (7 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Validator::parse (cognitive 23) crates/crab-git/src/receive_plan.rs:397— Validator::parse has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (4 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.
Validator::visibility_walk (cognitive 19) crates/crab-git/src/receive_plan/visibility.rs:83— Validator::visibility_walk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Authentication::revoke_identity (cognitive 30) crates/crab-http-server/src/auth.rs:729— Authentication::revoke_identity has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 3 (7 pts), loops 3 (5 pts), boolean chains 4 (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.
Authentication::remove_git_tokens (cognitive 16) crates/crab-http-server/src/auth/git_tokens.rs:192— Authentication::remove_git_tokens has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (9 pts), loops 2 (4 pts), if/else 3 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Authentication::load_session (cognitive 16) crates/crab-http-server/src/auth.rs:575— Authentication::load_session has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_write::generation::collect_commit_graph_inputs (cognitive 30) crates/crab-write/src/generation.rs:814— crab_write::generation::collect_commit_graph_inputs has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 5 (9 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.
crab_write::catalog::write_locator_pack_evidence (cognitive 26) crates/crab-write/src/catalog.rs:489— crab_write::catalog::write_locator_pack_evidence has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 7 (10 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.
crab_write::generation::maintain_path_state (cognitive 19) crates/crab-write/src/generation.rs:335— crab_write::generation::maintain_path_state has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Coordinator::apply_batch (cognitive 27) crates/crab-s3-gateway/src/mutation.rs:320— Coordinator::apply_batch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 3 (10 pts), loops 1 (3 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Coordinator::invalidate_mount_paths (cognitive 17) crates/crab-vfs/src/coordinator.rs:471— Coordinator::invalidate_mount_paths has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Coordinator::apply_one_batch (cognitive 16) crates/crab-s3-gateway/src/mutation.rs:417— Coordinator::apply_one_batch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (5 pts), loops 3 (5 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteGitReader::lookup_batch_from_selected_pack_indexes (cognitive 26) crates/crab-remote-git/src/reader.rs:562— RemoteGitReader::lookup_batch_from_selected_pack_indexes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 1 (4 pts), loops 2 (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.
RemoteGitReader::materialize_packed_entries (cognitive 23) crates/crab-remote-git/src/reader.rs:912— RemoteGitReader::materialize_packed_entries has cognitive complexity 23 (threshold 15). Drivers by points: loops 8 (12 pts), if/else 5 (11 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.
RemoteGitReader::read_packed_many_with_session_and_locators (cognitive 16) crates/crab-remote-git/src/reader.rs:764— RemoteGitReader::read_packed_many_with_session_and_locators has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CachingStore::query_dedup_batches (cognitive 23) crates/crab-cache-store/src/lib.rs:1091— CachingStore::query_dedup_batches has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CachingStore::get_with_etag (cognitive 16) crates/crab-cache-store/src/lib.rs:401— CachingStore::get_with_etag has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CachingStore::dedup_query (cognitive 16) crates/crab-cache-store/src/lib.rs:1006— CachingStore::dedup_query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 2 (5 pts), match/switch 1 (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.
CleanSession::crab_clean_stream (cognitive 19) crab/src/git/clean.rs:2084— CleanSession::crab_clean_stream has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
CleanSession::crab_clean_prepared_stream (cognitive 18) crab/src/git/clean.rs:2243— CleanSession::crab_clean_prepared_stream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
CleanSession::clean_stream (cognitive 16) crab/src/git/clean.rs:1970— CleanSession::clean_stream has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), loops 2 (4 pts), match/switch 3 (4 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.
Near-duplicate member pair (46 shared lines) crab/src/cost/inventory/report/azure.rs:30— crab/src/cost/inventory/report/azure.rs:30-98 | crab/src/cost/inventory/report/gcs.rs:35-101 — These two members are variants of one another: 46 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 (46 shared lines) crates/crab-remote-git/src/snapshot.rs:77— crates/crab-remote-git/src/snapshot.rs:77-152 | crates/crab-remote-git/src/snapshot.rs:164-252 — These two members are variants of one another: 46 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 (46 shared lines) crates/crab-metadata/src/git_visibility.rs:2203— crates/crab-metadata/src/git_visibility.rs:2203-2275 | crates/crab-metadata/src/git_visibility.rs:2321-2402 — These two members are variants of one another: 46 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (85 corresponding lines) · ×3
Edited copy of a member (85 corresponding lines) crates/crab-http-server/src/contents.rs:419— crates/crab-http-server/src/contents.rs:419-505 | crates/crab-http-server/src/contents.rs:513-597 — These two members are one piece of code written twice and then edited apart: 85 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (85 corresponding lines) crates/crab-workflow/src/signals.rs:394— crates/crab-workflow/src/signals.rs:394-497 | crates/crab-workflow/src/signals.rs:504-588 — These two members are one piece of code written twice and then edited apart: 85 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (85 corresponding lines) crab/src/cmd/managed_admin.rs:267— crab/src/cmd/managed_admin.rs:267-356 | crab/src/cmd/managed_admin.rs:492-576 — These two members are one piece of code written twice and then edited apart: 85 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×3
Edited copy of a member (39 corresponding lines) crab/src/cache/add_validation.rs:74— crab/src/cache/add_validation.rs:74-112 | crates/crab-staging/src/index.rs:6291-6332 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) crates/crab-metadata/src/git_object_locator/reader.rs:530— crates/crab-metadata/src/git_object_locator/reader.rs:530-568 | crates/crab-metadata/src/git_object_locator/reader.rs:579-624 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (39 corresponding lines) crab/src/lfs/migrate.rs:2837— crab/src/lfs/migrate.rs:2837-2875 | crates/crab-workflow/src/yaml.rs:1875-1919 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (38 corresponding lines) · ×3
Edited copy of a member (38 corresponding lines) crates/crab-metadata/src/segmented_store.rs:169— crates/crab-metadata/src/segmented_store.rs:169-206 | crates/crab-metadata/src/segmented_store.rs:230-267 — 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.
Edited copy of a member (38 corresponding lines) crates/crab-s3-gateway/src/multipart.rs:1231— crates/crab-s3-gateway/src/multipart.rs:1231-1268 | crates/crab-s3-gateway/src/multipart.rs:1274-1315 — 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.
Edited copy of a member (38 corresponding lines) crab/src/cmd/recover.rs:799— crab/src/cmd/recover.rs:799-843 | crab/src/cmd/recover.rs:845-882 — These two members are one piece of code written twice and then edited apart: 38 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×3
Edited copy of a member (34 corresponding lines) crates/crab-http-server/src/peer.rs:1194— crates/crab-http-server/src/peer.rs:1194-1227 | crates/crab-http-server/src/peer.rs:1274-1326 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) crates/crab-vfs/src/overlay.rs:1060— crates/crab-vfs/src/overlay.rs:1060-1093 | crates/crab-vfs/src/overlay.rs:1331-1375 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (34 corresponding lines) crates/crab-http-server/src/cells/repository/settings.rs:73— crates/crab-http-server/src/cells/repository/settings.rs:73-106 | crates/crab-http-server/src/cells/repository/settings.rs:121-159 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (36 corresponding lines) · ×3
Edited copy of a member (36 corresponding lines) crab/src/read/mod.rs:341— crab/src/read/mod.rs:341-376 | crab/src/read/mod.rs:382-417 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) crates/crab-sdk/src/local/edit.rs:1066— crates/crab-sdk/src/local/edit.rs:1066-1103 | crates/crab-sdk/src/local/fetch/recovery.rs:23-58 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (36 corresponding lines) crab/src/core/metrics.rs:1528— crab/src/core/metrics.rs:1528-1563 | crab/src/core/metrics.rs:1567-1604 — These two members are one piece of code written twice and then edited apart: 36 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×3
Edited copy of a member (30 corresponding lines) crates/crab-remote-git/src/operation.rs:439— crates/crab-remote-git/src/operation.rs:439-468 | crates/crab-remote-git/src/operation.rs:481-518 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) crab/src/cmd/run.rs:2471— crab/src/cmd/run.rs:2471-2500 | crab/src/cmd/run.rs:3054-3085 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (30 corresponding lines) crates/crab-coordination/src/active_active_runtime.rs:268— crates/crab-coordination/src/active_active_runtime.rs:268-297 | crates/crab-coordination/src/active_active_runtime.rs:322-351 — These two members are one piece of code written twice and then edited apart: 30 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 27+ corresponding lines) · ×3
Edited copies of one member (3 members, 27+ corresponding lines) crab/src/cmd/lfs/dedup.rs:412— crab/src/cmd/lfs/dedup.rs:412-440 | crab/src/cmd/lfs/dedup.rs:916-942 | crab/src/cmd/lfs/dedup.rs:1006-1035 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 27+ corresponding lines) crab/src/cmd/stage/list.rs:311— crab/src/cmd/stage/list.rs:311-337 | crates/crab-workflow/src/discover.rs:385-416 | crates/crab-workflow/src/resume.rs:309-336 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 27+ corresponding lines) crab/src/replication/mod.rs:4084— crab/src/replication/mod.rs:4084-4112 | crab/src/replication/mod.rs:4114-4140 | crab/src/replication/mod.rs:4142-4174 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 27 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 13+ corresponding lines) · ×3
Edited copies of one member (4 members, 13+ corresponding lines) crates/crab-http-server/src/cells/repository/pull_review_threads.rs:589— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:589-601 | crates/crab-http-server/src/cells/repository/pull_review_threads.rs:668-680 | crates/crab-http-server/src/cells/repository/pulls.rs:1293-1309 | crates/crab-http-server/src/cells/repository/pulls.rs:1335-1351 — 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.
Edited copies of one member (4 members, 13+ corresponding lines) crates/crab-http-server/src/cells/repository.rs:577— crates/crab-http-server/src/cells/repository.rs:577-590 | crates/crab-http-server/src/cells/repository/checks.rs:494-509 | crates/crab-http-server/src/cells/repository/checks.rs:531-543 | crates/crab-http-server/src/cells/repository/pull_review_threads.rs:864-876 — 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.
Edited copies of one member (4 members, 13+ corresponding lines) crates/crab-storage/src/store.rs:1397— crates/crab-storage/src/store.rs:1397-1409 | crates/crab-storage/src/store.rs:1455-1467 | crates/crab-storage/src/store.rs:1470-1482 | crates/crab-storage/src/store.rs:1557-1570 — 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, 7+ corresponding lines) · ×3
Edited copies of one member (3 members, 7+ corresponding lines) crab/src/git/push.rs:18777— crab/src/git/push.rs:18777-18783 | crates/crab-auth-server/src/receive/git_workspace.rs:917-923 | REDACTED:1517-1523 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) crab/src/cmd/metrics.rs:2217— crab/src/cmd/metrics.rs:2217-2223 | crab/src/cmd/recover.rs:2992-2998 | crab/src/cmd/recover.rs:3000-3006 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 7+ corresponding lines) crab/src/cmd/exp_queue.rs:1286— crab/src/cmd/exp_queue.rs:1286-1292 | crab/src/cmd/migrate.rs:278-284 | crates/crab-vfs/src/hydration.rs:1425-1431 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 6+ corresponding lines) · ×3
Edited copies of one member (3 members, 6+ corresponding lines) crates/crab-auth-server/src/receive.rs:956— crates/crab-auth-server/src/receive.rs:956-961 | crates/crab-auth/src/protected_push.rs:259-264 | crates/crab-metadata/src/validation.rs:18-26 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) crab/src/cmd/mount.rs:2698— crab/src/cmd/mount.rs:2698-2703 | crates/crab-vfs/src/coordinator.rs:1025-1030 | crates/crab-vfs/src/mount.rs:81-86 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 6+ corresponding lines) crates/crab-http-server/src/contents.rs:759— crates/crab-http-server/src/contents.rs:759-764 | crates/crab-http-server/src/pulls/merge.rs:45-50 | crates/crab-http-server/src/statuses.rs:87-94 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 6 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Duplicated block (27 lines × 2) crates/crab-http-server/src/peer.rs:1195— crates/crab-http-server/src/peer.rs:1195-1221 | crates/crab-http-server/src/peer.rs:1275-1301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) crates/crab-xet/src/shard_parse.rs:296— crates/crab-xet/src/shard_parse.rs:296-322 | crates/crab-xet/src/shard_parse.rs:469-495 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) crab/scripts/verify-nfs-smoke-report.py:1669— crab/scripts/verify-nfs-smoke-report.py:1669-1695 | crab/scripts/verify-nfs-smoke-report.py:1757-1783 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-nfs-smoke-report.py:1757` it begins part-way through the construct above it, so those 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 (24 lines × 2) crates/crab-storage/src/store.rs:2200— crates/crab-storage/src/store.rs:2200-2223 | crates/crab-storage/src/store.rs:2264-2287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-storage/src/store.rs:2200` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) crates/crab-sdk/src/local/edit.rs:677— crates/crab-sdk/src/local/edit.rs:677-700 | crates/crab-sdk/src/local/edit.rs:748-771 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-sdk/src/local/edit.rs:677` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) crab/scripts/verify-nfs-smoke-report.py:2271— crab/scripts/verify-nfs-smoke-report.py:2271-2294 | crab/scripts/verify-nfs-smoke-report.py:2302-2325 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21–22 lines × 2) crab/src/cmd/replica.rs:12653— crab/src/cmd/replica.rs:12653-12673 | crab/src/cmd/replica.rs:12813-12834 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/replica.rs:12813` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `payload` to `&DiagnosticsPayload` in one and `&DoctorPayload` 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 (21–22 lines × 2) crab/src/cmd/run.rs:2798— crab/src/cmd/run.rs:2798-2819 | crab/src/cmd/run.rs:3590-3610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/run.rs:2798` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21–22 lines × 2) crab/src/git/progress.rs:470— crab/src/git/progress.rs:470-491 | crab/src/git/progress.rs:513-533 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/progress.rs:470` it does not close everything it opens, so those 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 `Option<Arc<Mutex<JsonlStream<Stdout>>>>` in one and `Option<Arc<Mutex<JsonlStream<Stderr>>>>` 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 (18 lines × 3) crab/src/cmd/metrics.rs:3532— crab/src/cmd/metrics.rs:3532-3549 | crab/src/cmd/params.rs:377-394 | crates/crab-workflow/src/params_runtime.rs:510-527 — before extracting anything, compare `crab/src/cmd/metrics.rs` and `crab/src/cmd/params.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Note first that the copies are not typed on the same thing: the declarations holding them bind `a` to `&MetricMap` in one and `&ParamMap` 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 (18 lines × 3) crab/src/cmd/run.rs:796— crab/src/cmd/run.rs:796-813 | crab/src/cmd/run.rs:2238-2255 | crab/src/cmd/run.rs:2875-2892 — 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 `crab/src/cmd/run.rs:796` 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 × 3) crab/src/import/versions.rs:798— crab/src/import/versions.rs:798-815 | crab/src/import/versions.rs:1136-1153 | crab/src/import/versions.rs:1416-1433 — 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 `crab/src/import/versions.rs:798` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 3) crab/src/cmd/dehydrate.rs:1164— crab/src/cmd/dehydrate.rs:1164-1180 | crab/src/cmd/hydrate.rs:2031-2047 | crab/src/cmd/status.rs:1033-1049 — before extracting anything, compare `crab/src/cmd/dehydrate.rs` and `crab/src/cmd/hydrate.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 223 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 (17 lines × 3) crab/src/cmd/replica.rs:12663— crab/src/cmd/replica.rs:12663-12679 | crab/src/cmd/replica.rs:12727-12743 | crab/src/cmd/replica.rs:12824-12840 — 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 `crab/src/cmd/replica.rs:12663` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `payload` to `&DiagnosticsPayload` in one and `&CertificationPayload` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crab/src/cmd/replica.rs:12660` calls `Some`, `as_ref`, `render_coordinator_status` and `crab/src/cmd/replica.rs:12725` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 3) crab/scripts/verify-nfs-smoke-report.py:4533— crab/scripts/verify-nfs-smoke-report.py:4533-4549 | crab/scripts/verify-nfs-smoke-report.py:4566-4582 | crab/scripts/verify-nfs-smoke-report.py:4599-4615 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–17 lines × 2) crates/crab-coordination/src/write_coordinator.rs:1014— crates/crab-coordination/src/write_coordinator.rs:1014-1029 | crates/crab-coordination/src/write_coordinator.rs:1499-1515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-coordination/src/write_coordinator.rs:1499` 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 (16–17 lines × 2) crates/crab-remote-git/src/pack.rs:1615— crates/crab-remote-git/src/pack.rs:1615-1631 | crates/crab-remote-git/src/pack.rs:1869-1884 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-remote-git/src/pack.rs:1615` it does not close everything it opens, so those exact lines 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/crab-workflow/src/exp_worktree.rs:1630— crates/crab-workflow/src/exp_worktree.rs:1630-1646 | crates/crab-workflow/src/exp_worktree.rs:1701-1716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-workflow/src/exp_worktree.rs:1630` it begins part-way through the construct above it, so those 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/crab-workflow/src/exp_worktree.rs:1649` calls `String`, `to_owned` and `crates/crab-workflow/src/exp_worktree.rs:1718` 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) crab/src/cmd/lfs/fsck.rs:311— crab/src/cmd/lfs/fsck.rs:311-319 | crab/src/cmd/lfs/ls_files.rs:279-289 — before extracting anything, compare `crab/src/cmd/lfs/fsck.rs` and `crab/src/cmd/lfs/ls_files.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/lfs/fsck.rs:311` it begins part-way through the construct above it, so those 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 (9–11 lines × 2) crates/crab-read/src/upload_pack.rs:1005— crates/crab-read/src/upload_pack.rs:1005-1015 | crates/crab-read/src/upload_pack.rs:1410-1418 — both copies are in the same file, so extract the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/crab-read/src/upload_pack.rs:1407` calls `ordinals_for_refs`, `iter`, `copied` and `crates/crab-read/src/upload_pack.rs:1004` 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) crab/deploy/auth-service/scripts/e2e-path-acl-rustfs.py:214— crab/deploy/auth-service/scripts/e2e-path-acl-rustfs.py:214-222 | crab/deploy/auth-service/scripts/e2e-path-acl-rustfs.py:241-251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/deploy/auth-service/scripts/e2e-path-acl-rustfs.py:241` it begins part-way through the construct above it, so those exact lines 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 × 5) crab/src/cmd/lfs/fsck.rs:360— crab/src/cmd/lfs/fsck.rs:360-370 | crab/src/cmd/lfs/fsck.rs:386-396 | crab/src/cmd/lfs/ls_files.rs:360-371 | crab/src/cmd/lfs/ls_files.rs:396-406 | crab/src/lfs/migrate.rs:2796-2805 — before extracting anything, compare `crab/src/cmd/lfs/fsck.rs` and `crab/src/cmd/lfs/ls_files.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/lfs/fsck.rs:360` it does not close everything it opens, so those 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 × 5) crab/src/git/progress.rs:830— crab/src/git/progress.rs:830-839 | crab/src/git/progress.rs:879-888 | crab/src/git/progress.rs:1175-1184 | crab/src/git/progress.rs:1225-1234 | crab/src/git/progress.rs:1274-1283 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/progress.rs:830` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 5) crates/crab-http-server/src/checks.rs:858— crates/crab-http-server/src/checks.rs:858-867 | crates/crab-http-server/src/issues.rs:688-697 | crates/crab-http-server/src/labels.rs:322-331 | crates/crab-http-server/src/repository_settings.rs:247-256 | crates/crab-http-server/src/statuses.rs:367-376 — before extracting anything, compare `crates/crab-http-server/src/checks.rs` and `crates/crab-http-server/src/issues.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9–10 lines × 3) crab/src/cmd/repack.rs:1333— crab/src/cmd/repack.rs:1333-1341 | crab/src/cost/inventory/live.rs:407-416 | crab/src/git/push.rs:18792-18801 — before extracting anything, compare `crab/src/cmd/repack.rs` and `crab/src/git/push.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 3) crab/src/git/push.rs:5752— crab/src/git/push.rs:5752-5760 | crab/src/git/push.rs:6375-6383 | crates/crab-write/src/journal.rs:417-426 — 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 `crab/src/git/push.rs:5752` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 3) crab/src/cmd/run.rs:4081— crab/src/cmd/run.rs:4081-4089 | crab/src/import/coordinator.rs:1110-1118 | crab/src/main.rs:5851-5860 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (8–10 lines × 2) crab/src/import/ingest.rs:748— crab/src/import/ingest.rs:748-757 | crab/src/import/ingest.rs:783-790 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/import/ingest.rs:748` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–10 lines × 2) crates/crab-auth-server/src/receive/session.rs:258— crates/crab-auth-server/src/receive/session.rs:258-265 | crates/crab-auth-server/src/receive/session.rs:271-280 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-auth-server/src/receive/session.rs:258` 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–10 lines × 2) crates/crab-vfs/src/snapshot.rs:146— crates/crab-vfs/src/snapshot.rs:146-155 | crates/crab-vfs/src/snapshot.rs:215-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 `crates/crab-vfs/src/snapshot.rs:146` it does not close everything it opens, so those 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) crab/src/cmd/exp.rs:2686— crab/src/cmd/exp.rs:2686-2691 | crab/src/cmd/exp.rs:3422-3428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/exp.rs:2686` it begins part-way through the construct above it, so those 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, `crab/src/cmd/exp.rs:2693` calls `iter`, `cloned`, `collect` and `crab/src/cmd/exp.rs:3431` 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–7 lines × 2) crab/src/import/versions.rs:1451— crab/src/import/versions.rs:1451-1457 | crab/src/storage/head_class.rs:450-455 — 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 `crab/src/import/versions.rs:1451` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 2) crates/crab-http-server/src/cells/repository/codec.rs:16— crates/crab-http-server/src/cells/repository/codec.rs:16-21 | crates/crab-http-server/src/cells/repository/codec.rs:43-49 — both copies are in the same file, so extract the 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/crab-http-server/src/cells/repository/codec.rs:15` calls `write_u64` and `crates/crab-http-server/src/cells/repository/codec.rs:42` 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.
AC6 · Visual & motion safety· Animation without a prefers-reduced-motion guard · ×2
Animation without a prefers-reduced-motion guard packages/web/components/marketing/typing-code.tsx:232— <span> moves — its `animate-[typing-cursor-blink_1s_step-end_infinite]` utility runs with no motion-safe:/motion-reduce: variant — and nothing reads prefers-reduced-motion for it, so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Gate it on @media (prefers-reduced-motion: no-preference) or motion-safe:.
Animation without a prefers-reduced-motion guard packages/ui/src/style.css:795— `.inline-review-annotation` moves (`transition: background-color 120ms ease,
border-color 120ms ease,
transform 120ms ease`) and nothing reads prefers-reduced-motion for it — no @media (prefers-reduced-motion) rule for this element, no reset this project loads — so a motion-sensitive user cannot turn it off (WCAG 2.3.3). Declare it under @media (prefers-reduced-motion: no-preference), or neutralise it under reduce.
Store::put_multipart_file_resumable (cyclomatic 36) crates/crab-storage/src/store.rs:1792— Store::put_multipart_file_resumable 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.
Store::put_multipart_source_once (cyclomatic 18) crates/crab-storage/src/store.rs:2484— Store::put_multipart_source_once 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.
GitObjectLocatorWriter::write_locations_inner (cyclomatic 25) crates/crab-metadata/src/git_object_locator/writer.rs:558— GitObjectLocatorWriter::write_locations_inner has cyclomatic complexity 25 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GitObjectLocatorWriter::load_or_initialize (cyclomatic 18) crates/crab-metadata/src/git_object_locator/writer.rs:264— GitObjectLocatorWriter::load_or_initialize has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
crab_vfs::publish::commit_overlay_with_snapshot (cyclomatic 24) crates/crab-vfs/src/publish.rs:253— crab_vfs::publish::commit_overlay_with_snapshot 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.
crab_vfs::ipc_server::handle_mount (cyclomatic 16) crates/crab-vfs/src/ipc_server.rs:555— crab_vfs::ipc_server::handle_mount 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.
OptimizeCmd::schema_name (cyclomatic 23) crab/src/main.rs:1476— OptimizeCmd::schema_name has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: Cmd::schema_name (cyclomatic 143) 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.
OptimizeCmd::output_mode (cyclomatic 17) crab/src/main.rs:1436— OptimizeCmd::output_mode has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: Cmd::schema_name (cyclomatic 143) 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.
crab_remote::publication::acquire_ref_leases (cyclomatic 20) crates/crab-remote/src/publication.rs:275— crab_remote::publication::acquire_ref_leases 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.
crab_remote::prepare::prepare (cyclomatic 16) crates/crab-remote/src/prepare.rs:841— crab_remote::prepare::prepare 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.
crab_auth_server::receive::promote_pack_metadata_union (cyclomatic 16) crates/crab-auth-server/src/receive.rs:487— crab_auth_server::receive::promote_pack_metadata_union 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.
crab_auth_server::receive::commit_service_git_locators_with_source (cyclomatic 16) crates/crab-auth-server/src/receive.rs:1765— crab_auth_server::receive::commit_service_git_locators_with_source 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.
ChunkIndexStore::get_batch_with_candidates_inner (cognitive 52) crab/src/metadata/metadb/stores/chunk_index.rs:158— ChunkIndexStore::get_batch_with_candidates_inner has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (36 pts), loops 5 (8 pts), match/switch 2 (7 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChunkIndexStore::get_committed_candidates_page (cognitive 19) crab/src/metadata/metadb/stores/chunk_index.rs:337— ChunkIndexStore::get_committed_candidates_page has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_remote::publication::acquire_ref_leases (cognitive 46) crates/crab-remote/src/publication.rs:275— crab_remote::publication::acquire_ref_leases has cognitive complexity 46 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 5 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_remote::prepare::prepare (cognitive 20) crates/crab-remote/src/prepare.rs:841— crab_remote::prepare::prepare has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 4 (6 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShardSynchronizer::resolve_incremental_delta (cognitive 39) crab/src/metadata/shard_sync.rs:426— ShardSynchronizer::resolve_incremental_delta has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (34 pts), loops 2 (4 pts), boolean chains 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.
ShardSynchronizer::install_shard_data (cognitive 17) crab/src/metadata/shard_sync.rs:764— ShardSynchronizer::install_shard_data has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 2 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteGitRepository::generate_pack_with_bases_mode (cognitive 39) crates/crab-remote-git/src/pack.rs:713— RemoteGitRepository::generate_pack_with_bases_mode has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 5 (18 pts), loops 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteGitRepository::open_inner (cognitive 32) crates/crab-remote-git/src/repository.rs:495— RemoteGitRepository::open_inner has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 6 (16 pts), if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AddRemoteCandidateCache::persist_results_inner (cognitive 33) crab/src/cache/add_remote_candidates.rs:408— AddRemoteCandidateCache::persist_results_inner has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 10 (16 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.
AddRemoteCandidateCache::load_persistent (cognitive 25) crab/src/cache/add_remote_candidates.rs:197— AddRemoteCandidateCache::load_persistent has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4 (8 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.
crab_auth::managed::openapi::compare_schema (cognitive 28) crates/crab-auth/src/managed/openapi.rs:673— crab_auth::managed::openapi::compare_schema has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 6 (9 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_auth::managed::openapi::compare_operation (cognitive 17) crates/crab-auth/src/managed/openapi.rs:600— crab_auth::managed::openapi::compare_operation has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 2, loops 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DaemonService::sync_repos (cognitive 23) crates/crab-vfs/src/daemon.rs:617— DaemonService::sync_repos has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DaemonService::execute_mount_pipeline (cognitive 18) crates/crab-vfs/src/daemon.rs:847— DaemonService::execute_mount_pipeline has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 1, match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
TermResolver::resolve_sequences_batch_with_mode (cognitive 19) crates/crab-read/src/term_resolver.rs:249— TermResolver::resolve_sequences_batch_with_mode has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (5 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.
TermResolver::resolve_batch (cognitive 16) crates/crab-read/src/term_resolver.rs:106— TermResolver::resolve_batch has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 3 (5 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CrabFs::opendir (cognitive 19) crates/crab-vfs/src/fuse.rs:740— CrabFs::opendir has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 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.
CrabFs::setattr (cognitive 18) crates/crab-vfs/src/fuse.rs:643— CrabFs::setattr has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 6 (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.
TooManyFunctions: crab::metadata::manifest crab/src/metadata/manifest.rs:15— TooManyFunctions — 39 free functions. The bar is 30 free functions; this is 9 over it, 1.30× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
TooManyFunctions: crab::lfs::track crab/src/lfs/track.rs:96— TooManyFunctions — 35 free functions. The bar is 30 free functions; this is 5 over it, 1.17× the bar. This type is on a published API surface — a cargo-semver-checks gate in CI (REDACTED) declares its compatibility contractual — so moving members onto a smaller type is a breaking change for every consumer, not a local refactor. To reduce it, treat the split as an API migration: move each cohesive group onto its own published type and keep the old members as deprecated forwards for a deprecation period, removing them at the next compatibility break. Where the surface has to stay as it is, that is a decision to record rather than a change to make.
Near-duplicate member pair (36 shared lines) crates/crab-http-server/src/branches.rs:129— crates/crab-http-server/src/branches.rs:129-265 | crates/crab-http-server/src/contents.rs:231-364 — These two members are variants of one another: 36 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (36 shared lines) REDACTED:1658— REDACTED:1658-1715 | REDACTED:1717-1836 — These two members are variants of one another: 36 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (32 shared lines) crates/crab-metadata/src/git_object_locator/reader.rs:630— crates/crab-metadata/src/git_object_locator/reader.rs:630-716 | crates/crab-metadata/src/git_object_locator/reader.rs:722-803 — These two members are variants of one another: 32 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 (32 shared lines) crates/crab-remote-git/src/pack.rs:1565— crates/crab-remote-git/src/pack.rs:1565-1659 | crates/crab-remote-git/src/pack.rs:1791-1917 — These two members are variants of one another: 32 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 (28 shared lines) crates/crab-remote-git/src/pack.rs:870— crates/crab-remote-git/src/pack.rs:870-1033 | crates/crab-remote-git/src/pack.rs:1040-1095 — These two members are variants of one another: 28 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 (28 shared lines) crates/crab-vfs/src/snapshot.rs:106— crates/crab-vfs/src/snapshot.rs:106-164 | crates/crab-vfs/src/snapshot.rs:172-227 — These two members are variants of one another: 28 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 (11 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (11 members, 50+ identical tokens) crab/src/cmd/cache.rs:255— crab/src/cmd/cache.rs:255-269 | crab/src/cmd/doctor.rs:2521-2535 | crab/src/cmd/du.rs:392-409 | crab/src/cmd/lfs/convert.rs:615-628 | crab/src/cmd/lfs/dedup.rs:1333-1346 | crab/src/cmd/lfs/ls_files.rs:533-547 | crab/src/cmd/ls_files.rs:302-316 | crab/src/cmd/migrate.rs:2976-2990 | crab/src/cmd/mount.rs:4486-4500 | crab/src/lfs/migrate.rs:2895-2909 | crab/src/lfs/prune.rs:993-1007 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
Members sharing a duplicated core (11 members, 50+ identical tokens) crab/src/cmd/compact.rs:97— crab/src/cmd/compact.rs:97-120 | crab/src/cmd/gc/bucket.rs:273-287 | crab/src/cmd/gc/bucket.rs:298-324 | crab/src/cmd/gc/bucket.rs:2450-2503 | crab/src/cmd/history_recovery.rs:398-434 | crab/src/cmd/history_recovery.rs:441-460 | crab/src/cmd/metadb.rs:2210-2264 | crab/src/cmd/recover.rs:2515-2521 | crates/crab-auth-server/src/receive/workflow.rs:236-251 | crates/crab-workflow/src/artifact.rs:927-939 | crates/crab-workflow/src/cache.rs:757-769 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication· Edited copy of a member (66 corresponding lines) · ×2
Edited copy of a member (66 corresponding lines) crates/crab-http-server/src/checks.rs:293— crates/crab-http-server/src/checks.rs:293-361 | crates/crab-http-server/src/checks.rs:444-509 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (66 corresponding lines) crab/src/replication/mod.rs:1729— crab/src/replication/mod.rs:1729-1794 | crab/src/replication/mod.rs:1811-1876 — These two members are one piece of code written twice and then edited apart: 66 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (59 corresponding lines) · ×2
Edited copy of a member (59 corresponding lines) crab/src/metadata/metadb/stores/chunk_index.rs:340— crab/src/metadata/metadb/stores/chunk_index.rs:340-416 | crab/src/metadata/metadb/stores/chunk_index.rs:440-498 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (59 corresponding lines) crates/crab-staging/src/index.rs:2954— crates/crab-staging/src/index.rs:2954-3012 | crates/crab-staging/src/index.rs:3871-3934 — These two members are one piece of code written twice and then edited apart: 59 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (62 corresponding lines) · ×2
Edited copy of a member (62 corresponding lines) crates/crab-metadata/src/git_object_locator/reader.rs:449— crates/crab-metadata/src/git_object_locator/reader.rs:449-510 | crates/crab-metadata/src/git_object_locator/writer.rs:788-852 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (62 corresponding lines) crates/crab-remote-git/src/snapshot.rs:277— crates/crab-remote-git/src/snapshot.rs:277-349 | crates/crab-remote-git/src/snapshot.rs:358-419 — These two members are one piece of code written twice and then edited apart: 62 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (55 corresponding lines) · ×2
Edited copy of a member (55 corresponding lines) crates/crab-http-server/src/cells/repository/operations.rs:221— crates/crab-http-server/src/cells/repository/operations.rs:221-275 | crates/crab-http-server/src/cells/repository/operations.rs:290-367 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (55 corresponding lines) crab/src/cmd/du.rs:164— crab/src/cmd/du.rs:164-218 | crab/src/cmd/status.rs:815-873 — These two members are one piece of code written twice and then edited apart: 55 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (40 corresponding lines) · ×2
Edited copy of a member (40 corresponding lines) crates/crab-workflow/src/params.rs:870— crates/crab-workflow/src/params.rs:870-926 | crates/crab-workflow/src/params.rs:928-967 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (40 corresponding lines) crab/src/cmd/add.rs:2351— crab/src/cmd/add.rs:2351-2390 | crab/src/cmd/add.rs:2430-2470 — These two members are one piece of code written twice and then edited apart: 40 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (52 corresponding lines) · ×2
Edited copy of a member (52 corresponding lines) crab/src/cmd/gc/mod.rs:2091— crab/src/cmd/gc/mod.rs:2091-2143 | crab/src/cmd/gc/mod.rs:2153-2204 — 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.
Edited copy of a member (52 corresponding lines) crab/deploy/auth-service/src/policy.py:328— crab/deploy/auth-service/src/policy.py:328-379 | crab/deploy/auth-service/src/policy.py:392-449 — 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 (47 corresponding lines) · ×2
Edited copy of a member (47 corresponding lines) crab/src/cmd/recover.rs:2000— crab/src/cmd/recover.rs:2000-2046 | crab/src/cmd/recover.rs:2257-2307 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (47 corresponding lines) crab/src/storage/retry.rs:328— crab/src/storage/retry.rs:328-404 | crates/crab-storage/src/retry.rs:123-169 — These two members are one piece of code written twice and then edited apart: 47 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (45 corresponding lines) · ×2
Edited copy of a member (45 corresponding lines) crab/src/git/push.rs:17575— crab/src/git/push.rs:17575-17624 | crates/crab-write/src/generation.rs:818-862 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (45 corresponding lines) crab/src/cmd/doctor.rs:2004— crab/src/cmd/doctor.rs:2004-2048 | crab/src/cmd/doctor.rs:2125-2169 — These two members are one piece of code written twice and then edited apart: 45 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (51 corresponding lines) · ×2
Edited copy of a member (51 corresponding lines) crab/src/cmd/hydrate.rs:1619— crab/src/cmd/hydrate.rs:1619-1669 | crab/src/cmd/hydrate.rs:1968-2027 — 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.
Edited copy of a member (51 corresponding lines) crates/crab-auth/src/azure_entra.rs:190— crates/crab-auth/src/azure_entra.rs:190-244 | crates/crab-auth/src/gcp_federation.rs:220-270 — 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 (42 corresponding lines) · ×2
Edited copy of a member (42 corresponding lines) crates/crab-metadata/src/git_visibility.rs:531— crates/crab-metadata/src/git_visibility.rs:531-572 | crates/crab-metadata/src/git_visibility.rs:1160-1213 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (42 corresponding lines) crates/crab-workflow/src/exp_worktree.rs:401— crates/crab-workflow/src/exp_worktree.rs:401-455 | crates/crab-workflow/src/params_runtime.rs:321-362 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (44 corresponding lines) · ×2
Edited copy of a member (44 corresponding lines) crates/crab-http-server/src/cells/repository/checks.rs:627— crates/crab-http-server/src/cells/repository/checks.rs:627-670 | crates/crab-http-server/src/checks.rs:193-251 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (44 corresponding lines) crab/src/cmd/exp.rs:3557— crab/src/cmd/exp.rs:3557-3602 | crab/src/cmd/exp.rs:5169-5212 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (37 corresponding lines) · ×2
Edited copy of a member (37 corresponding lines) crates/crab-staging/src/lib.rs:569— crates/crab-staging/src/lib.rs:569-605 | crates/crab-staging/src/lib.rs:687-730 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (37 corresponding lines) crab/src/cmd/gc/bucket.rs:148— crab/src/cmd/gc/bucket.rs:148-184 | crab/src/cmd/gc/bucket.rs:195-243 — These two members are one piece of code written twice and then edited apart: 37 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 26+ corresponding lines) · ×2
Edited copies of one member (3 members, 26+ corresponding lines) crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1377— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:1377-1405 | crates/crab-http-server/src/cells/repository/pulls.rs:1612-1639 | crates/crab-http-server/src/cells/repository/releases.rs:1180-1205 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 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, 26+ corresponding lines) crates/crab-vfs/src/fuse.rs:555— crates/crab-vfs/src/fuse.rs:555-586 | crates/crab-vfs/src/fuse.rs:1196-1221 | crates/crab-vfs/src/fuse.rs:1230-1272 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 26 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, 25+ corresponding lines) · ×2
Edited copies of one member (3 members, 25+ corresponding lines) crates/crab-s3-gateway/src/gateway.rs:3316— crates/crab-s3-gateway/src/gateway.rs:3316-3341 | crates/crab-s3-gateway/src/gateway.rs:4038-4073 | crates/crab-s3-gateway/src/gateway.rs:4090-4114 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 25+ corresponding lines) crab/src/cmd/push.rs:1521— crab/src/cmd/push.rs:1521-1551 | crab/src/cmd/push.rs:1557-1581 | crab/src/cmd/push.rs:1587-1612 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 25 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 34+ corresponding lines) · ×2
Edited copies of one member (3 members, 34+ corresponding lines) crab/src/replication/mod.rs:573— crab/src/replication/mod.rs:573-606 | crab/src/replication/mod.rs:723-757 | crab/src/replication/mod.rs:904-944 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 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, 34+ corresponding lines) crates/crab-vfs/src/overlay.rs:851— crates/crab-vfs/src/overlay.rs:851-884 | crates/crab-vfs/src/overlay.rs:886-921 | crates/crab-vfs/src/overlay.rs:1015-1058 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 34 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, 38+ corresponding lines) · ×2
Edited copies of one member (3 members, 38+ corresponding lines) crates/crab-auth/src/aws_oidc.rs:87— crates/crab-auth/src/aws_oidc.rs:87-128 | crates/crab-auth/src/gcp_federation.rs:103-142 | crates/crab-auth/src/gcp_federation.rs:147-184 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 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, 38+ corresponding lines) crates/crab-http-server/src/metrics.rs:1611— crates/crab-http-server/src/metrics.rs:1611-1648 | crates/crab-s3-gateway/src/metrics.rs:441-488 | crates/crab-s3-gateway/src/metrics/backend.rs:54-94 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 38 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 23+ corresponding lines) · ×2
Edited copies of one member (3 members, 23+ corresponding lines) crates/crab-http-server/src/cells/repository.rs:1236— crates/crab-http-server/src/cells/repository.rs:1236-1258 | crates/crab-http-server/src/cells/repository.rs:1274-1301 | crates/crab-http-server/src/cells/repository/settings.rs:264-288 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 23+ corresponding lines) crab/src/replication/mod.rs:1230— crab/src/replication/mod.rs:1230-1260 | crab/src/replication/mod.rs:1382-1404 | crab/src/replication/mod.rs:1409-1431 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 17+ corresponding lines) · ×2
Edited copies of one member (3 members, 17+ corresponding lines) crab/src/cmd/metrics.rs:987— crab/src/cmd/metrics.rs:987-1003 | crab/src/cmd/metrics.rs:1019-1035 | crab/src/cmd/metrics.rs:1057-1073 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 17+ corresponding lines) crates/crab-http-server/src/auth_tests/assignees.rs:12— crates/crab-http-server/src/auth_tests/assignees.rs:12-28 | crates/crab-http-server/src/auth_tests/issues.rs:17-35 | crates/crab-http-server/src/auth_tests/labels.rs:16-33 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 17+ corresponding lines) · ×2
Edited copies of one member (4 members, 17+ corresponding lines) crates/crab-staging/src/index.rs:336— crates/crab-staging/src/index.rs:336-352 | crates/crab-staging/src/index.rs:670-686 | crates/crab-staging/src/index.rs:688-704 | crates/crab-staging/src/index.rs:8517-8550 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 17+ corresponding lines) crab/src/cmd/mount.rs:5006— crab/src/cmd/mount.rs:5006-5022 | crab/src/cmd/mount.rs:5140-5156 | crab/src/cmd/mount.rs:5192-5208 | crab/src/cmd/mount.rs:5212-5228 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 14+ corresponding lines) · ×2
Edited copies of one member (4 members, 14+ corresponding lines) crates/crab-http-server/src/cells/repository/pull_review_threads.rs:616— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:616-635 | crates/crab-http-server/src/cells/repository/pulls.rs:551-571 | crates/crab-http-server/src/cells/repository/pulls.rs:1363-1376 | crates/crab-http-server/src/cells/repository/releases.rs:740-755 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 14+ corresponding lines) crab/src/cmd/login.rs:227— crab/src/cmd/login.rs:227-241 | crab/src/cmd/login.rs:249-263 | crab/src/cmd/logout.rs:150-163 | crab/src/main.rs:5943-5956 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 14 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 18+ corresponding lines) · ×2
Edited copies of one member (3 members, 18+ corresponding lines) crates/crab-http-server/src/cells/repository/pull_review_threads.rs:882— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:882-901 | crates/crab-http-server/src/cells/repository/pull_review_threads.rs:907-926 | crates/crab-http-server/src/cells/repository/pulls.rs:1405-1422 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
Edited copies of one member (3 members, 18+ corresponding lines) crates/crab-http-server/src/pulls/storage.rs:317— crates/crab-http-server/src/pulls/storage.rs:317-339 | crates/crab-http-server/src/pulls/storage.rs:427-444 | crates/crab-http-server/src/releases/storage.rs:89-110 — 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 (4 members, 9+ corresponding lines) · ×2
Edited copies of one member (4 members, 9+ corresponding lines) crab/src/cmd/metrics.rs:3559— crab/src/cmd/metrics.rs:3559-3567 | crab/src/cmd/metrics.rs:3581-3595 | crab/src/cmd/params.rs:404-412 | crab/src/cmd/params.rs:416-430 — 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/crab-http-server/src/cells/repository/codec.rs:216— crates/crab-http-server/src/cells/repository/codec.rs:216-226 | crates/crab-http-server/src/cells/repository/codec.rs:263-272 | crates/crab-http-server/src/cells/repository/codec.rs:451-459 | crates/crab-http-server/src/cells/repository/codec.rs:578-587 — 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, 12+ corresponding lines) · ×2
Edited copies of one member (4 members, 12+ corresponding lines) crab/src/replication/mod.rs:2436— crab/src/replication/mod.rs:2436-2452 | crab/src/replication/mod.rs:2489-2500 | crab/src/replication/mod.rs:2506-2522 | crab/src/replication/mod.rs:2562-2578 — 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.
Edited copies of one member (4 members, 12+ corresponding lines) crates/crab-coordination/src/cosmosdb_coordinator.rs:608— crates/crab-coordination/src/cosmosdb_coordinator.rs:608-619 | crates/crab-coordination/src/dynamodb_coordinator.rs:877-888 | crates/crab-coordination/src/spanner_coordinator.rs:910-921 | crates/crab-coordination/src/write_coordinator.rs:411-423 — 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 (5 members, 11+ corresponding lines) · ×2
Edited copies of one member (5 members, 11+ corresponding lines) crates/crab-http-server/src/pulls.rs:301— crates/crab-http-server/src/pulls.rs:301-311 | crates/crab-http-server/src/pulls/review_threads.rs:57-67 | crates/crab-http-server/src/pulls/review_threads.rs:581-591 | crates/crab-http-server/src/pulls/reviews.rs:87-97 | crates/crab-http-server/src/releases.rs:140-150 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Edited copies of one member (5 members, 11+ corresponding lines) crates/crab-http-server/src/cells/repository/checks_codec.rs:225— crates/crab-http-server/src/cells/repository/checks_codec.rs:225-237 | crates/crab-http-server/src/cells/repository/codec.rs:66-76 | crates/crab-http-server/src/cells/repository/codec.rs:202-214 | crates/crab-http-server/src/cells/repository/codec.rs:250-261 | crates/crab-http-server/src/cells/repository/codec.rs:565-576 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
Duplicated block (42 lines × 2) crab/src/cmd/gc/mod.rs:2098— crab/src/cmd/gc/mod.rs:2098-2139 | crab/src/cmd/gc/mod.rs:2159-2200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/mod.rs:2098` it does not close everything it opens, so those exact lines 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) crab/src/cmd/replica.rs:12589— crab/src/cmd/replica.rs:12589-12630 | crab/src/cmd/replica.rs:12944-12985 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/replica.rs:12589` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `payload` to `&PromotePayload` in one and `&SetPrimaryPayload` 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 (30–36 lines × 2) crab/src/cmd/run.rs:841— crab/src/cmd/run.rs:841-870 | crab/src/cmd/run.rs:2904-2939 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/run.rs:2904` it begins part-way through the construct above it, so those 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 (30–36 lines × 2) REDACTED:2358— REDACTED:2358-2393 | REDACTED:2543-2572 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:2358` 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 (25–33 lines × 2) crab/src/git/filter_process.rs:1450— crab/src/git/filter_process.rs:1450-1474 | crab/src/git/filter_process.rs:1561-1593 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/filter_process.rs:1450` it begins part-way through the construct above it, so those 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 (25–33 lines × 2) crab/src/storage/retry.rs:372— crab/src/storage/retry.rs:372-404 | crates/crab-storage/src/retry.rs:145-169 — before extracting anything, compare `crab/src/storage/retry.rs` and `crates/crab-storage/src/retry.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/storage/retry.rs:372` 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 (30 lines × 2) crates/crab-coordination/src/write_coordinator.rs:951— crates/crab-coordination/src/write_coordinator.rs:951-980 | crates/crab-coordination/src/write_coordinator.rs:1439-1468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-coordination/src/write_coordinator.rs:951` 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 (30 lines × 2) crates/crab-read/src/upload_pack.rs:967— crates/crab-read/src/upload_pack.rs:967-996 | crates/crab-read/src/upload_pack.rs:1372-1401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28 lines × 2) crates/crab-coordination/src/spanner_coordinator.rs:315— crates/crab-coordination/src/spanner_coordinator.rs:315-342 | crates/crab-coordination/src/spanner_coordinator.rs:607-634 — both copies are in the same file, so extract the 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 (28 lines × 2) crates/crab-vfs/src/daemon.rs:1843— crates/crab-vfs/src/daemon.rs:1843-1870 | crates/crab-vfs/src/pipeline.rs:598-625 — before extracting anything, compare `crates/crab-vfs/src/daemon.rs` and `crates/crab-vfs/src/pipeline.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 63 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (24–25 lines × 2) crates/crab-read/src/term_resolver.rs:140— crates/crab-read/src/term_resolver.rs:140-163 | crates/crab-read/src/term_resolver.rs:287-311 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-read/src/term_resolver.rs:140` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24–25 lines × 2) crab/scripts/qualify_sdk.py:393— crab/scripts/qualify_sdk.py:393-417 | crab/scripts/verify-sdk-read-only.py:59-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/qualify_sdk.py:393` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–21 lines × 2) crab/src/git/incremental_walk.rs:292— crab/src/git/incremental_walk.rs:292-310 | crab/src/git/push.rs:18350-18370 — before extracting anything, compare `crab/src/git/incremental_walk.rs` and `crab/src/git/push.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/incremental_walk.rs:292` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–21 lines × 2) crates/crab-remote-git/src/snapshot.rs:117— crates/crab-remote-git/src/snapshot.rs:117-135 | crates/crab-remote-git/src/snapshot.rs:210-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-remote-git/src/snapshot.rs:117` it begins part-way through the construct above it, so those 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 (18–20 lines × 2) crab/src/lfs/migrate.rs:1422— crab/src/lfs/migrate.rs:1422-1441 | crab/src/lfs/migrate.rs:2130-2147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/migrate.rs:1422` it begins part-way through the construct above it, so those 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 `options` to `MigrateImportOptions<'_>` in one and `MigrateExportOptions<'_>` 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 (18–20 lines × 2) crab/src/cmd/exp.rs:4081— crab/src/cmd/exp.rs:4081-4098 | crates/crab-workflow/src/exp_worktree.rs:435-454 — 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 `crab/src/cmd/exp.rs:4081` it begins part-way through the construct above it, so those exact lines 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–19 lines × 2) crab/src/cmd/adopt.rs:759— crab/src/cmd/adopt.rs:759-777 | crab/src/cmd/unadopt.rs:359-376 — before extracting anything, compare `crab/src/cmd/adopt.rs` and `crab/src/cmd/unadopt.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 108 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 `crab/src/cmd/adopt.rs:759` 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–19 lines × 2) crab/src/lfs/status.rs:339— crab/src/lfs/status.rs:339-357 | crab/src/lfs/status.rs:482-499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/status.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 (16–18 lines × 2) crates/crab-cache-server/src/cache_store.rs:526— crates/crab-cache-server/src/cache_store.rs:526-543 | crates/crab-cache-server/src/cache_store.rs:560-575 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-cache-server/src/cache_store.rs:526` 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 (16–18 lines × 2) crab/scripts/verify-nfs-smoke-report.py:3725— crab/scripts/verify-nfs-smoke-report.py:3725-3742 | crab/scripts/verify-nfs-smoke-report.py:3911-3926 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-nfs-smoke-report.py:3725` it does not close everything it opens, so those 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–17 lines × 2) crates/crab-staging/src/index.rs:529— crates/crab-staging/src/index.rs:529-545 | crates/crab-staging/src/index.rs:568-578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-staging/src/index.rs:529` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–17 lines × 2) crates/crab-write/src/journal.rs:578— crates/crab-write/src/journal.rs:578-594 | crates/crab-write/src/journal.rs:612-622 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-write/src/journal.rs:578` it does not close everything it opens, so those 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 (14–15 lines × 3) crab/src/cmd/replica.rs:2885— crab/src/cmd/replica.rs:2885-2899 | crab/src/replication/mod.rs:7457-7470 | crab/src/replication/mod.rs:7486-7499 — before extracting anything, compare `crab/src/cmd/replica.rs` and `crab/src/replication/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 3) crab/src/git/incremental_walk.rs:104— crab/src/git/incremental_walk.rs:104-118 | crates/crab-vfs/src/snapshot.rs:559-573 | crates/crab-workflow/src/params_runtime.rs:374-387 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10–15 lines × 2) crab/src/cmd/run.rs:3448— crab/src/cmd/run.rs:3448-3462 | REDACTED:2311-2320 — before extracting anything, compare `crab/src/cmd/run.rs` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 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 `crab/src/cmd/run.rs:3448` 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–15 lines × 2) crates/crab-http-server/src/branches.rs:218— crates/crab-http-server/src/branches.rs:218-232 | crates/crab-http-server/src/contents.rs:300-309 — before extracting anything, compare `crates/crab-http-server/src/branches.rs` and `crates/crab-http-server/src/contents.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-http-server/src/branches.rs:218` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. 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–11 lines × 3) crab/src/maintenance.rs:73— crab/src/maintenance.rs:73-83 | crates/crab-auth-server/src/receive/workflow.rs:62-70 | crates/crab-workflow/src/store.rs:62-70 — 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 `crab/src/maintenance.rs:73` 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–11 lines × 3) crates/crab-xet/src/shard_parse.rs:490— crates/crab-xet/src/shard_parse.rs:490-500 | crates/crab-xet/src/shard_parse.rs:634-643 | crates/crab-xet/src/shard_parse.rs:774-782 — 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/crab-xet/src/shard_parse.rs:490` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 3) crates/crab-vfs/src/snapshot.rs:863— crates/crab-vfs/src/snapshot.rs:863-873 | crates/crab-vfs/src/snapshot.rs:887-896 | crates/crab-vfs/src/snapshot.rs:915-924 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10–11 lines × 3) crates/crab-workflow/src/exp_worktree.rs:1628— crates/crab-workflow/src/exp_worktree.rs:1628-1638 | crates/crab-workflow/src/exp_worktree.rs:1668-1677 | crates/crab-workflow/src/exp_worktree.rs:1699-1708 — 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/crab-workflow/src/exp_worktree.rs:1628` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–10 lines × 3) crab/src/cmd/adopt.rs:666— crab/src/cmd/adopt.rs:666-675 | crab/src/cmd/init.rs:680-687 | crab/src/cmd/init.rs:714-721 — before extracting anything, compare `crab/src/cmd/adopt.rs` and `crab/src/cmd/init.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 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–10 lines × 3) crab/src/cmd/repack.rs:1336— crab/src/cmd/repack.rs:1336-1343 | crab/src/git/push.rs:18796-18805 | crab/src/optimize/xorbs/reconcile.rs:769-776 — before extracting anything, compare `crab/src/cmd/repack.rs` and `crab/src/git/push.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6–7 lines × 3) crab/src/cmd/exp_queue.rs:1377— crab/src/cmd/exp_queue.rs:1377-1383 | crates/crab-workflow/src/exp_worktree.rs:432-438 | crates/crab-workflow/src/params_runtime.rs:346-351 — 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 `crab/src/cmd/exp_queue.rs:1377` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6–7 lines × 3) crab/src/cmd/ls_files.rs:106— crab/src/cmd/ls_files.rs:106-112 | crates/crab-auth/src/token_cache.rs:223-229 | crates/crab-staging/src/lib.rs:976-981 — 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 `crab/src/cmd/ls_files.rs:106` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 5) crab/src/cmd/gc/bucket.rs:904— crab/src/cmd/gc/bucket.rs:904-909 | crab/src/cmd/gc/bucket.rs:2438-2443 | crab/src/cmd/optimize/xorbs.rs:656-661 | crab/src/replication/mod.rs:8105-8110 | crates/crab-workflow/src/artifact.rs:556-561 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/bucket.rs:904` 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 × 5) crab/src/import/coordinator.rs:1090— crab/src/import/coordinator.rs:1090-1095 | crates/crab-auth/src/aws_oidc.rs:325-330 | crates/crab-auth/src/azure_entra.rs:370-375 | crates/crab-auth/src/crab_auth_client.rs:611-616 | crates/crab-auth/src/gcp_federation.rs:363-368 — before extracting anything, compare `crates/crab-auth/src/aws_oidc.rs` and `crates/crab-auth/src/azure_entra.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 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 × 5) crab/src/cmd/hydrate.rs:2949— crab/src/cmd/hydrate.rs:2949-2956 | crab/src/cmd/hydrate.rs:2982-2989 | crab/src/cmd/hydrate.rs:3008-3015 | crab/src/cmd/hydrate.rs:3139-3146 | crab/src/cmd/hydrate.rs:3187-3194 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/hydrate.rs:2949` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 5) crab/scripts/verify-nfs-smoke-report.py:4205— crab/scripts/verify-nfs-smoke-report.py:4205-4212 | crab/scripts/verify-nfs-smoke-report.py:4277-4284 | crab/scripts/verify-nfs-smoke-report.py:4382-4389 | crab/scripts/verify-nfs-smoke-report.py:4417-4424 | crab/scripts/verify-nfs-smoke-report.py:4679-4686 — 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.
R10 · Code Duplication· Duplicated block with local edits (41 matched lines × 2 locations) · ×2
Duplicated block with local edits (41 matched lines × 2 locations) packages/web/app/cli/page.tsx:488— packages/web/app/cli/page.tsx:488 · packages/web/app/cli/page.tsx:607 — the two spans are one implementation copied and then locally edited — 150 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (41 matched lines × 2 locations) packages/web/app/diagrams/auth-internals-svg.tsx:85— packages/web/app/diagrams/auth-internals-svg.tsx:85 · packages/web/app/diagrams/auth-internals-svg.tsx:208 — the two spans are one implementation copied and then locally edited — 592 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (26 lines × 2 locations) packages/ui/src/discussion-labels.tsx:210— packages/ui/src/discussion-labels.tsx:210 · packages/ui/src/discussion-labels.tsx:325 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (26 lines × 2 locations) packages/web/app/cache/page.tsx:532— packages/web/app/cache/page.tsx:532 · packages/web/app/cli/page.tsx:542 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (21 lines × 2 locations) packages/ui/src/content-editor.tsx:401— packages/ui/src/content-editor.tsx:401 · packages/ui/src/content-editor.tsx:660 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (21 lines × 2 locations) packages/web/app/diagrams/cache-hierarchy-svg.tsx:21— packages/web/app/diagrams/cache-hierarchy-svg.tsx:21 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:20 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (18 lines × 2 locations) packages/web/app/auth/page.tsx:695— packages/web/app/auth/page.tsx:695 · packages/web/app/pricing/page.tsx:589 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (18 lines × 2 locations) packages/web/components/blog/cache-visuals.tsx:427— packages/web/components/blog/cache-visuals.tsx:427 · packages/web/components/blog/reconstruction-visuals.tsx:367 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (17 lines × 2 locations) packages/web/app/auth/page.tsx:543— packages/web/app/auth/page.tsx:543 · packages/web/app/remote-services/page.tsx:156 — the 2 copies are spread across 2 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (17 lines × 2 locations) packages/web/app/cache/page.tsx:423— packages/web/app/cache/page.tsx:423 · packages/web/app/cache/page.tsx:573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Complex function (anonymous) (cyclomatic 13, cognitive 12) packages/web/components/blog/git-architecture-player.tsx:488— (anonymous) has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 13, cognitive 12) packages/web/components/blog/git-architecture-player.tsx:524— (anonymous) has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Dead file (~76 LoC) packages/web/components/ui/accordion.tsx— no import path from any entry point (54 application, 8 tooling, 21 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~76 LoC) packages/web/components/ui/alert.tsx— no import path from any entry point (54 application, 8 tooling, 21 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
AC1 · Text alternatives· <video> without a captions track · ×1
<video> without a captions track packages/ui/src/file-preview.tsx:280— Video with no captions <track> offers no captions. This player's source is set at runtime, so there is no caption file to author here: give the player a way to carry captions — accept a track/captions URL alongside the media and render a <track kind="captions"> when one is supplied — and capture that asset wherever the media enters the product (upload, import or generation).
AC3 · Page structure· Heading level jumps from h1 to h4 · ×1
Heading level jumps from h1 to h4 packages/web/app/landing-page-client.tsx:296— Skipping heading levels breaks the document outline assistive tech relies on. Don't jump levels — increase by at most one.
AC4 · Keyboard semantics· Modal dialog does not manage focus · ×1
Modal dialog does not manage focus packages/web/components/navigation/mobile-nav.tsx:93— This <div role="dialog"> is a modal dialog, but nothing moves focus into it when it opens and nothing keeps focus inside it while it is open, so a keyboard or screen-reader user keeps acting on the content behind it (WCAG 2.4.3). Use a native <dialog> opened with showModal(), a dialog component that traps focus, or move focus to the dialog on open, trap Tab inside it (or make the page behind inert) and return focus to the control that opened it on close.
Low contrast Tailwind colour pair (3.8:1) packages/web/components/library/knowledge-check.tsx:120— This element's Tailwind text/background colour utilities fall below the 4.5:1 WCAG AA minimum for normal text. Pick a darker or lighter shade.
App.RepositoryPage (cyclomatic 117) packages/ui/src/App.tsx:511— App.RepositoryPage has cyclomatic complexity 117 (threshold 15). Of this number, 40 points are the body's own statements and 77 belong to 11 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.
Cmd::output_mode (cyclomatic 105) crab/src/main.rs:2093— Cmd::output_mode has cyclomatic complexity 105 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: Cmd::schema_name (cyclomatic 143) 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.
verify-nfs-smoke-report.self_test (cyclomatic 97) crab/scripts/verify-nfs-smoke-report.py:3256— verify-nfs-smoke-report.self_test has cyclomatic complexity 97 (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.
verify-large-repo-rustfs-report.verify_report (cyclomatic 67) crab/scripts/verify-large-repo-rustfs-report.py:475— verify-large-repo-rustfs-report.verify_report has cyclomatic complexity 67 (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.
verify-nfs-smoke-report.check_native_read_benchmark_artifact (cyclomatic 63) crab/scripts/verify-nfs-smoke-report.py:957— verify-nfs-smoke-report.check_native_read_benchmark_artifact has cyclomatic complexity 63 (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.
data-workbench.DataWorkbench (cyclomatic 61) packages/ui/src/data-workbench.tsx:301— data-workbench.DataWorkbench has cyclomatic complexity 61 (threshold 15). Of this number, 27 points are the body's own statements and 34 belong to 12 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.
nfs-evidence-summary.self_test (cyclomatic 58) crab/scripts/nfs-evidence-summary.py:1409— nfs-evidence-summary.self_test has cyclomatic complexity 58 (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.
tree.RepositoryTree (cyclomatic 55) packages/ui/src/tree.tsx:25— tree.RepositoryTree has cyclomatic complexity 55 (threshold 15). Most of this is not in the body itself: 15 of the 55 points are its own statements and the rest belongs to 16 function literals inside it that branch (lines 209, 271, 317, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
content.FileView (cyclomatic 49) packages/ui/src/content.tsx:132— content.FileView has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 6 of the 49 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 269, 275, 161, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
git-architecture-player.GitArchitecturePlayer (cyclomatic 47) packages/web/components/blog/git-architecture-player.tsx:301— git-architecture-player.GitArchitecturePlayer has cyclomatic complexity 47 (threshold 15). Most of this is not in the body itself: 8 of the 47 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 488, a function literal at line 524, moveTabFocus, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
verify-nfs-smoke-report.check_mount_doctor_artifact (cyclomatic 44) crab/scripts/verify-nfs-smoke-report.py:407— verify-nfs-smoke-report.check_mount_doctor_artifact 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.
nfs-evidence-summary.benchmark_consistency_blockers (cyclomatic 42) crab/scripts/nfs-evidence-summary.py:721— nfs-evidence-summary.benchmark_consistency_blockers has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
verify-nfs-smoke-report.check_mount_status_artifact (cyclomatic 42) crab/scripts/verify-nfs-smoke-report.py:1263— verify-nfs-smoke-report.check_mount_status_artifact has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
nfs-read-path-bench-report.validate_report (cyclomatic 38) crab/scripts/nfs-read-path-bench-report.py:167— nfs-read-path-bench-report.validate_report has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
nfs-evidence-summary.threshold_evidence_tier (cyclomatic 37) crab/scripts/nfs-evidence-summary.py:958— nfs-evidence-summary.threshold_evidence_tier has cyclomatic complexity 37 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
verify-provider-qualification-report.verify_report (cyclomatic 36) crab/scripts/verify-provider-qualification-report.py:44— verify-provider-qualification-report.verify_report has cyclomatic complexity 36 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
git-import.GitImport (cyclomatic 36) packages/ui/src/git-import.tsx:19— git-import.GitImport has cyclomatic complexity 36 (threshold 15). Of this number, 17 points are the body's own statements and 19 belong to 6 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
settings.MemberSettings (cyclomatic 35) packages/ui/src/settings.tsx:148— settings.MemberSettings has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 15 of the 35 points are its own statements and the rest belongs to 8 function items inside it that branch (save, load, saveMember, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
App.App (cyclomatic 35) packages/ui/src/App.tsx:124— App.App has cyclomatic complexity 35 (threshold 15). Of this number, 16 points are the body's own statements and 19 belong to 9 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
qualify_reader_retention.main (cyclomatic 34) crates/crab-http-server/deploy/cell-issue-fleet/qualify_reader_retention.py:48— qualify_reader_retention.main 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.
revision-picker.RevisionPicker (cyclomatic 34) packages/ui/src/revision-picker.tsx:23— revision-picker.RevisionPicker has cyclomatic complexity 34 (threshold 15). Of this number, 16 points are the body's own statements and 18 belong to 7 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.
check-release-archive-contents.check_release_workflow (cyclomatic 33) crab/scripts/release/check-release-archive-contents.py:196— check-release-archive-contents.check_release_workflow 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.
action_traces.join (cyclomatic 33) crates/crab-http-server/deploy/cell-issue-fleet/action_traces.py:109— action_traces.join 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.
verify_sdk_capabilities.validate (cyclomatic 32) crab/scripts/verify_sdk_capabilities.py:28— verify_sdk_capabilities.validate 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.
knowledge-check.KnowledgeCheck (cyclomatic 32) packages/web/components/library/knowledge-check.tsx:9— knowledge-check.KnowledgeCheck has cyclomatic complexity 32 (threshold 15). Most of this is not in the body itself: 9 of the 32 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 95, verify). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
pulls.PullReviewThreads (cyclomatic 31) packages/ui/src/pulls.tsx:796— pulls.PullReviewThreads has cyclomatic complexity 31 (threshold 15). Of this number, 19 points are the body's own statements and 12 belong to 4 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Verifier.verify_route_contract_behavior (cyclomatic 30) crab/scripts/verify-cache-service-smoke-report.py:819— Verifier.verify_route_contract_behavior has cyclomatic complexity 30 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
pulls.ReviewThreadCard (cyclomatic 30) packages/ui/src/pulls.tsx:1139— pulls.ReviewThreadCard has cyclomatic complexity 30 (threshold 15). Of this number, 28 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
nfs-evidence-summary.smoke_summary_consistency_blockers (cyclomatic 29) crab/scripts/nfs-evidence-summary.py:841— nfs-evidence-summary.smoke_summary_consistency_blockers 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.
qualify_reader_perf.main (cyclomatic 29) crates/crab-http-server/deploy/cell-issue-fleet/qualify_reader_perf.py:16— qualify_reader_perf.main 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.
pulls.PullDetail (cyclomatic 29) packages/ui/src/pulls.tsx:614— pulls.PullDetail has cyclomatic complexity 29 (threshold 15). Most of this is not in the body itself: 8 of the 29 points are its own statements and the rest belongs to one function literal inside it that branches (line 651). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
ChunkIndexStore::get_batch_with_candidates_inner (cyclomatic 28) crab/src/metadata/metadb/stores/chunk_index.rs:158— ChunkIndexStore::get_batch_with_candidates_inner has cyclomatic complexity 28 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
XorbBuilder::push_precompressed_with_reserve_and_admission (cyclomatic 28) crates/crab-xet/src/xorb/builder.rs:536— XorbBuilder::push_precompressed_with_reserve_and_admission 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.
nfs-evidence-summary.render_threshold_suggestions (cyclomatic 28) crab/scripts/nfs-evidence-summary.py:1249— nfs-evidence-summary.render_threshold_suggestions 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.
ReadFailure::with_cause (cyclomatic 27) crab/src/core/error/read_failure.rs:31— ReadFailure::with_cause has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
UpdatePull::execute (cyclomatic 27) crates/crab-http-server/src/cells/repository/pulls.rs:444— UpdatePull::execute has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PreparedContent::new (cyclomatic 27) crates/crab-remote/src/prepare.rs:167— PreparedContent::new 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.
check-architecture-gates.check_xet_module_scope (cyclomatic 27) crab/scripts/check-architecture-gates.py:2918— check-architecture-gates.check_xet_module_scope 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.
verify-nfs-smoke-report.check_write_journal_runtime_status (cyclomatic 27) crab/scripts/verify-nfs-smoke-report.py:832— verify-nfs-smoke-report.check_write_journal_runtime_status has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
pulls.MergePanel (cyclomatic 27) packages/ui/src/pulls.tsx:1761— pulls.MergePanel has cyclomatic complexity 27 (threshold 15). Of this number, 24 points are the body's own statements and 3 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AddRemoteChunkClassifier::lookup_existing_candidates (cyclomatic 26) crab/src/git/push.rs:4316— AddRemoteChunkClassifier::lookup_existing_candidates has cyclomatic complexity 26 (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.
UpdateIssue::execute (cyclomatic 26) crates/crab-http-server/src/cells/repository/operations.rs:12— UpdateIssue::execute 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.
verify_git_capability_matrix.validate_report (cyclomatic 26) crab/scripts/verify_git_capability_matrix.py:105— verify_git_capability_matrix.validate_report 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.
check-architecture-gates.check_cache_server_runtime_scope (cyclomatic 25) crab/scripts/check-architecture-gates.py:3823— check-architecture-gates.check_cache_server_runtime_scope 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.
check-architecture-gates.check_metadata_module_scope (cyclomatic 25) crab/scripts/check-architecture-gates.py:4591— check-architecture-gates.check_metadata_module_scope 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.
verify-nfs-smoke-report.validate (cyclomatic 25) crab/scripts/verify-nfs-smoke-report.py:1940— verify-nfs-smoke-report.validate has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
qualify_mode_rollout.main (cyclomatic 25) crates/crab-http-server/deploy/cell-issue-fleet/qualify_mode_rollout.py:93— qualify_mode_rollout.main has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
content.DiffView (cyclomatic 25) packages/ui/src/content.tsx:915— content.DiffView has cyclomatic complexity 25 (threshold 15). Most of this is not in the body itself: 4 of the 25 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 974, 932, 1005, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
settings.BranchProtectionSettings (cyclomatic 24) packages/ui/src/settings.tsx:919— settings.BranchProtectionSettings has cyclomatic complexity 24 (threshold 15). Most of this is not in the body itself: 9 of the 24 points are its own statements and the rest belongs to 4 function items inside it that branch (a function literal at line 1064, replaceRules, saveRule, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
GitVisibilityCatalogV1::validate_binding (cyclomatic 23) crates/crab-metadata/src/git_visibility.rs:1956— GitVisibilityCatalogV1::validate_binding 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.
check-architecture-gates.rust_brace_delta (cyclomatic 23) crab/scripts/check-architecture-gates.py:2274— check-architecture-gates.rust_brace_delta 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.
check-architecture-gates.check_cache_store_module_scope (cyclomatic 23) crab/scripts/check-architecture-gates.py:3376— check-architecture-gates.check_cache_store_module_scope 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.
check-architecture-gates.check_auth_store_adapter_scope (cyclomatic 23) crab/scripts/check-architecture-gates.py:3891— check-architecture-gates.check_auth_store_adapter_scope 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.
verify-nfs-smoke-report.compare_native_read_reports (cyclomatic 23) crab/scripts/verify-nfs-smoke-report.py:2459— verify-nfs-smoke-report.compare_native_read_reports 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.
fault.main (cyclomatic 23) crates/crab-http-server/deploy/cell-issue-fleet/fault.py:315— fault.main 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.
load.main (cyclomatic 23) REDACTED:565— load.main 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.
git-access.GitAccess (cyclomatic 23) packages/ui/src/git-access.tsx:20— git-access.GitAccess has cyclomatic complexity 23 (threshold 15). Of this number, 12 points are the body's own statements and 11 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LfsObjectStore::get_verified_stream_at (cyclomatic 22) crates/crab-lfs/src/object_store.rs:775— LfsObjectStore::get_verified_stream_at 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.
check-architecture-gates.check_coordination_module_scope (cyclomatic 22) crab/scripts/check-architecture-gates.py:3113— check-architecture-gates.check_coordination_module_scope 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.
check-architecture-gates.check_cache_module_scope (cyclomatic 22) crab/scripts/check-architecture-gates.py:3172— check-architecture-gates.check_cache_module_scope 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.
check-architecture-gates.check_lfs_module_scope (cyclomatic 22) crab/scripts/check-architecture-gates.py:4465— check-architecture-gates.check_lfs_module_scope 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.
TailFault.run (cyclomatic 22) crates/crab-http-server/deploy/cell-issue-fleet/fault.py:226— TailFault.run 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.
issues.IssueDetail (cyclomatic 22) packages/ui/src/issues.tsx:304— issues.IssueDetail has cyclomatic complexity 22 (threshold 15). Of this number, 15 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LfsConfig::apply_env (cyclomatic 21) crab/src/lfs/config.rs:168— LfsConfig::apply_env has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PushAdmissionTicket::try_admit (cyclomatic 21) crates/crab-coordination/src/push_admission.rs:153— PushAdmissionTicket::try_admit 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.
GitVisibilityIndex::validate (cyclomatic 21) crates/crab-metadata/src/git_visibility.rs:934— GitVisibilityIndex::validate 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.
RemoteGitRepository::open_inner (cyclomatic 21) crates/crab-remote-git/src/repository.rs:495— RemoteGitRepository::open_inner 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.
CheckpointLineage::append (cyclomatic 21) crates/crab-workflow/src/checkpoint.rs:151— CheckpointLineage::append has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Lockfile::diff_against_resolved (cyclomatic 21) crates/crab-workflow/src/lockfile.rs:229— Lockfile::diff_against_resolved 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.
verify-nfs-smoke-report.check_writeback_artifact (cyclomatic 21) crab/scripts/verify-nfs-smoke-report.py:1601— verify-nfs-smoke-report.check_writeback_artifact 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.
verify_git_capability_matrix.validate (cyclomatic 21) crab/scripts/verify_git_capability_matrix.py:51— verify_git_capability_matrix.validate 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.
data-query.statementBoundary (cyclomatic 21) packages/ui/src/data-query.ts:64— data-query.statementBoundary 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.
discussion.Editor (cyclomatic 21) packages/ui/src/discussion.tsx:192— discussion.Editor has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 4 of the 21 points are its own statements and the rest belongs to 5 function items inside it that branch (formatShortcut, a function literal at line 253, a function literal at line 303, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
hero-section.HeroSection (cyclomatic 21) packages/web/components/marketing/hero-section.tsx:107— hero-section.HeroSection has cyclomatic complexity 21 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
Authentication::revoke_identity (cyclomatic 20) crates/crab-http-server/src/auth.rs:729— Authentication::revoke_identity has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
RepositoryCellRouter::rebalance_once (cyclomatic 20) crates/crab-http-server/src/cells/router.rs:213— RepositoryCellRouter::rebalance_once 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.
PeerHttpRoundTrip::owner (cyclomatic 20) crates/crab-http-server/src/peer/client.rs:176— PeerHttpRoundTrip::owner 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.
ReadFlights::run (cyclomatic 20) crates/crab-remote-git/src/runtime/read_flight.rs:38— ReadFlights::run has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FuseResolver::readdir_page (cyclomatic 20) crates/crab-vfs/src/resolver.rs:355— FuseResolver::readdir_page 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.
check-architecture-gates.check_diff_module_scope (cyclomatic 20) crab/scripts/check-architecture-gates.py:4405— check-architecture-gates.check_diff_module_scope 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.
check-architecture-gates.check_storage_module_scope (cyclomatic 20) crab/scripts/check-architecture-gates.py:4527— check-architecture-gates.check_storage_module_scope 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.
verify-nfs-smoke-report.check_unmount_artifact (cyclomatic 20) crab/scripts/verify-nfs-smoke-report.py:1698— verify-nfs-smoke-report.check_unmount_artifact 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.
verify-nfs-smoke-report.main (cyclomatic 20) crab/scripts/verify-nfs-smoke-report.py:4865— verify-nfs-smoke-report.main has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
pdf-preview.PdfPreview (cyclomatic 20) packages/ui/src/pdf-preview.tsx:10— pdf-preview.PdfPreview has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 3 of the 20 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 56, 79, 37, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
AddRemoteCandidateCache::persist_results_inner (cyclomatic 19) crab/src/cache/add_remote_candidates.rs:408— AddRemoteCandidateCache::persist_results_inner has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AddProgress::render_batch_line (cyclomatic 19) crab/src/cmd/add.rs:522— AddProgress::render_batch_line has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
crab_auth::managed::openapi::compare_schema (cyclomatic 19) crates/crab-auth/src/managed/openapi.rs:673— crab_auth::managed::openapi::compare_schema has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CacheHealthReport::issue (cyclomatic 19) crates/crab-cache/src/health.rs:172— CacheHealthReport::issue 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.
GitCatalogVisibilityIndex::apply_ordinal_edit (cyclomatic 19) crates/crab-metadata/src/git_visibility.rs:685— GitCatalogVisibilityIndex::apply_ordinal_edit 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.
LocalTools::run (cyclomatic 19) crates/crab-remote/src/local.rs:425— LocalTools::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.
crab_types::pointer::is_pointer (cyclomatic 19) crates/crab-types/src/pointer.rs:164— crab_types::pointer::is_pointer 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.
check-architecture-gates.check_cell_runtime_server_boundary (cyclomatic 19) crab/scripts/check-architecture-gates.py:2420— check-architecture-gates.check_cell_runtime_server_boundary has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
check-architecture-gates.check_auth_module_scope (cyclomatic 19) crab/scripts/check-architecture-gates.py:3609— check-architecture-gates.check_auth_module_scope has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
verify-nfs-smoke-report.verify_directory (cyclomatic 19) crab/scripts/verify-nfs-smoke-report.py:2170— verify-nfs-smoke-report.verify_directory has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
import_image.artifact_metadata (cyclomatic 19) crates/crab-http-server/deploy/cell-issue-fleet/import_image.py:20— import_image.artifact_metadata 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.
browse.Directory (cyclomatic 19) packages/ui/src/browse.tsx:100— browse.Directory has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 147, 202, 137). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
issues.IssueList (cyclomatic 19) packages/ui/src/issues.tsx:97— issues.IssueList has cyclomatic complexity 19 (threshold 15). Most of this is not in the body itself: 3 of the 19 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 155, 136, 123, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
release-form.NewRelease (cyclomatic 19) packages/ui/src/release-form.tsx:375— release-form.NewRelease has cyclomatic complexity 19 (threshold 15). Of this number, 11 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
settings.DefaultBranchSettings (cyclomatic 19) packages/ui/src/settings.tsx:587— settings.DefaultBranchSettings has cyclomatic complexity 19 (threshold 15). Of this number, 13 points are the body's own statements and 6 belong to one function item inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
StoreChecker::verify_pointer_data (cyclomatic 18) crab/src/cmd/fsck_store.rs:101— StoreChecker::verify_pointer_data 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.
GcFenceState::validate (cyclomatic 18) crates/crab-coordination/src/gc_fence.rs:109— GcFenceState::validate has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
UpdatePullReviewThread::execute (cyclomatic 18) crates/crab-http-server/src/cells/repository/pull_review_threads.rs:329— UpdatePullReviewThread::execute 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.
check-architecture-gates.check_workflow_module_scope (cyclomatic 18) crab/scripts/check-architecture-gates.py:4708— check-architecture-gates.check_workflow_module_scope 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.
verify-nfs-smoke-report.check_mount_list_artifact (cyclomatic 18) crab/scripts/verify-nfs-smoke-report.py:351— verify-nfs-smoke-report.check_mount_list_artifact 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.
verify-sdk-read-only.main (cyclomatic 18) crab/scripts/verify-sdk-read-only.py:87— verify-sdk-read-only.main 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.
qualify.run_stage (cyclomatic 18) REDACTED:232— qualify.run_stage 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.
qualify_reader_first_loss.main (cyclomatic 18) crates/crab-http-server/deploy/cell-issue-fleet/qualify_reader_first_loss.py:31— qualify_reader_first_loss.main has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
pulls.PullList (cyclomatic 18) packages/ui/src/pulls.tsx:305— pulls.PullList has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 3 of the 18 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 371, 349, 375, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
pulls.RequiredChecks (cyclomatic 18) packages/ui/src/pulls.tsx:1957— pulls.RequiredChecks has cyclomatic complexity 18 (threshold 15). Most of this is not in the body itself: 8 of the 18 points are its own statements and the rest belongs to 3 function literals inside it that branch (lines 1998, 1970, 1973). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
S3VersionedList::walk_versions (cyclomatic 17) crab/src/import/versions.rs:754— S3VersionedList::walk_versions 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.
TransferCoordinator::execute (cyclomatic 17) crab/src/lfs/coordinator.rs:248— TransferCoordinator::execute has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
AzureReplicationControlPlaneBackend::apply (cyclomatic 17) crab/src/replication/mod.rs:476— AzureReplicationControlPlaneBackend::apply has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: crab::replication::control_plane_check_code (cyclomatic 18) 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.
GcFenceLease::acquire_with_holder (cyclomatic 17) crates/crab-coordination/src/gc_fence.rs:411— GcFenceLease::acquire_with_holder 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.
NodePublisher::run_shared (cyclomatic 17) crates/crab-http-server/src/peer.rs:358— NodePublisher::run_shared has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: crab_http_server::peer::required_mutation_action (cyclomatic 22) 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.
RemoteGitSnapshot::blame (cyclomatic 17) crates/crab-remote-git/src/snapshot.rs:654— RemoteGitSnapshot::blame 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.
crab_remote_git::reader::parse_pack_index (cyclomatic 17) crates/crab-remote-git/src/reader.rs:2407— crab_remote_git::reader::parse_pack_index 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.
CrabFs::setattr (cyclomatic 17) crates/crab-vfs/src/fuse.rs:643— CrabFs::setattr 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.
crab_write::generation::maintain_path_state (cyclomatic 17) crates/crab-write/src/generation.rs:335— crab_write::generation::maintain_path_state 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.
check-architecture-gates.check_workspace_dependency_sources (cyclomatic 17) crab/scripts/check-architecture-gates.py:2564— check-architecture-gates.check_workspace_dependency_sources 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.
check-architecture-gates.check_read_module_scope (cyclomatic 17) crab/scripts/check-architecture-gates.py:4122— check-architecture-gates.check_read_module_scope 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.
check-architecture-gates.check_deleted_workflow_reexport_adapters_removed (cyclomatic 17) crab/scripts/check-architecture-gates.py:4758— check-architecture-gates.check_deleted_workflow_reexport_adapters_removed 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.
nfs-evidence-summary.render_benchmark_markdown (cyclomatic 17) crab/scripts/nfs-evidence-summary.py:236— nfs-evidence-summary.render_benchmark_markdown 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.
check-install-layout.check_layout (cyclomatic 17) crab/scripts/release/check-install-layout.py:205— check-install-layout.check_layout 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.
verify-nfs-smoke-report.compare_directory (cyclomatic 17) crab/scripts/verify-nfs-smoke-report.py:2641— verify-nfs-smoke-report.compare_directory 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.
qualify_read_replicas.prove_reader_targets (cyclomatic 17) REDACTED:239— qualify_read_replicas.prove_reader_targets 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.
qualify_reader_partition.qualify (cyclomatic 17) REDACTED:39— qualify_reader_partition.qualify has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
content-editor.UploadFiles (cyclomatic 17) packages/ui/src/content-editor.tsx:333— content-editor.UploadFiles has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 3 function items inside it that branch (submit, selectFiles, a function literal at line 480). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
refs.RefsPage (cyclomatic 17) packages/ui/src/refs.tsx:171— refs.RefsPage has cyclomatic complexity 17 (threshold 15). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, 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.
page.PricingPage (cyclomatic 17) packages/web/app/pricing/page.tsx:298— page.PricingPage has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 372, 509, 440). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
CleanSession::crab_clean_stream (cyclomatic 16) crab/src/git/clean.rs:2084— CleanSession::crab_clean_stream 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.
ShardSynchronizer::resolve_incremental_delta (cyclomatic 16) crab/src/metadata/shard_sync.rs:426— ShardSynchronizer::resolve_incremental_delta 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.
GoogleGcsReplicationControlPlaneClient::validate_policy (cyclomatic 16) crab/src/replication/mod.rs:3324— GoogleGcsReplicationControlPlaneClient::validate_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. This is NOT this file's highest cyclomatic complexity: crab::replication::control_plane_check_code (cyclomatic 18) 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.
Validator::parse (cyclomatic 16) crates/crab-git/src/receive_plan.rs:397— Validator::parse 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.
ApplyProjectionBatch::execute (cyclomatic 16) crates/crab-http-server/src/cells/repository/projection.rs:233— ApplyProjectionBatch::execute 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.
StoreClient::load_shard_for_file (cyclomatic 16) crates/crab-read/src/store_client.rs:173— StoreClient::load_shard_for_file 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.
DvcMigrationJournal::validate (cyclomatic 16) crates/crab-workflow/src/dvc_inventory.rs:448— DvcMigrationJournal::validate 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.
check-architecture-gates.check_git_module_scope (cyclomatic 16) crab/scripts/check-architecture-gates.py:4276— check-architecture-gates.check_git_module_scope 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.
check-architecture-gates.check_deleted_metadata_reexport_adapters_removed (cyclomatic 16) crab/scripts/check-architecture-gates.py:4661— check-architecture-gates.check_deleted_metadata_reexport_adapters_removed 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.
nfs-evidence-summary.render_smoke_markdown (cyclomatic 16) crab/scripts/nfs-evidence-summary.py:350— nfs-evidence-summary.render_smoke_markdown 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.
qualify_sdk.compare_read (cyclomatic 16) crab/scripts/qualify_sdk.py:250— qualify_sdk.compare_read 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.
verify-nfs-smoke-report.check_remount_artifact (cyclomatic 16) crab/scripts/verify-nfs-smoke-report.py:1864— verify-nfs-smoke-report.check_remount_artifact 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.
TailFault.preflight (cyclomatic 16) crates/crab-http-server/deploy/cell-issue-fleet/fault.py:99— TailFault.preflight 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.
fault.verify_unique_results (cyclomatic 16) crates/crab-http-server/deploy/cell-issue-fleet/fault.py:41— fault.verify_unique_results 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.
load.wait_for_placement (cyclomatic 16) REDACTED:337— load.wait_for_placement 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.
load.observe_nodes (cyclomatic 16) REDACTED:442— load.observe_nodes 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.
qualify.prove_owner_loss (cyclomatic 16) REDACTED:322— qualify.prove_owner_loss 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.
qualify.main (cyclomatic 16) REDACTED:375— qualify.main 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.
content.ChangeWorkspace (cyclomatic 16) packages/ui/src/content.tsx:684— content.ChangeWorkspace has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 710, a function literal at line 715, scrollToChange, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
content.ChangeTree (cyclomatic 16) packages/ui/src/content.tsx:800— content.ChangeTree has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 7 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 834, 882). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
release-form.EditReleaseForm (cyclomatic 16) packages/ui/src/release-form.tsx:220— release-form.EditReleaseForm has cyclomatic complexity 16 (threshold 15). Of this number, 9 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
settings.ArchiveSettings (cyclomatic 16) packages/ui/src/settings.tsx:776— settings.ArchiveSettings has cyclomatic complexity 16 (threshold 15). Of this number, 12 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
App.RepositoryPage (cognitive 372) packages/ui/src/App.tsx:511— App.RepositoryPage has cognitive complexity 372 (threshold 15). Drivers by points: ternaries 49 (322 pts), boolean chains 39, if/else 10 (11 pts) (nesting depth added 274). Of this number, 40 points are the body's own statements and 332 belong to 11 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.
verify-nfs-smoke-report.self_test (cognitive 104) crab/scripts/verify-nfs-smoke-report.py:3256— verify-nfs-smoke-report.self_test has cognitive complexity 104 (threshold 15). Drivers by points: if/else 78 (83 pts), loops 13 (16 pts), boolean chains 5 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
nfs-evidence-summary.benchmark_consistency_blockers (cognitive 88) crab/scripts/nfs-evidence-summary.py:721— nfs-evidence-summary.benchmark_consistency_blockers has cognitive complexity 88 (threshold 15). Drivers by points: if/else 29 (73 pts), loops 5 (10 pts), boolean chains 5 (nesting depth added 49). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify-large-repo-rustfs-report.verify_report (cognitive 77) crab/scripts/verify-large-repo-rustfs-report.py:475— verify-large-repo-rustfs-report.verify_report has cognitive complexity 77 (threshold 15). Drivers by points: if/else 24 (30 pts), boolean chains 27, loops 16 (20 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.
data-workbench.DataWorkbench (cognitive 75) packages/ui/src/data-workbench.tsx:301— data-workbench.DataWorkbench has cognitive complexity 75 (threshold 15). Drivers by points: ternaries 21 (37 pts), boolean chains 19, if/else 14 (16 pts), error handling 3 (nesting depth added 18). Of this number, 40 points are the body's own statements and 35 belong to 12 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tree.RepositoryTree (cognitive 71) packages/ui/src/tree.tsx:25— tree.RepositoryTree has cognitive complexity 71 (threshold 15). Drivers by points: if/else 24 (30 pts), ternaries 11 (24 pts), boolean chains 10, loops 5 (6 pts), error handling 1 (nesting depth added 20). Of this number, 19 points are the body's own statements and 52 belong to 16 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify-nfs-smoke-report.check_native_read_benchmark_artifact (cognitive 66) crab/scripts/verify-nfs-smoke-report.py:957— verify-nfs-smoke-report.check_native_read_benchmark_artifact has cognitive complexity 66 (threshold 15). Drivers by points: if/else 33 (39 pts), boolean chains 20, loops 5, error handling 1, ternaries 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
nfs-evidence-summary.self_test (cognitive 64) crab/scripts/nfs-evidence-summary.py:1409— nfs-evidence-summary.self_test has cognitive complexity 64 (threshold 15). Drivers by points: if/else 38 (47 pts), loops 7, boolean chains 6, error handling 4 (nesting depth added 9). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
nfs-read-path-bench-report.validate_report (cognitive 64) crab/scripts/nfs-read-path-bench-report.py:167— nfs-read-path-bench-report.validate_report has cognitive complexity 64 (threshold 15). Drivers by points: if/else 28 (47 pts), boolean chains 10, loops 3 (7 pts) (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify-nfs-smoke-report.check_mount_doctor_artifact (cognitive 63) crab/scripts/verify-nfs-smoke-report.py:407— verify-nfs-smoke-report.check_mount_doctor_artifact has cognitive complexity 63 (threshold 15). Drivers by points: if/else 26 (42 pts), loops 5 (9 pts), boolean chains 8, ternaries 1 (3 pts), error handling 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify-nfs-smoke-report.check_mount_status_artifact (cognitive 61) crab/scripts/verify-nfs-smoke-report.py:1263— verify-nfs-smoke-report.check_mount_status_artifact has cognitive complexity 61 (threshold 15). Drivers by points: if/else 27 (40 pts), boolean chains 13, loops 3 (7 pts), error handling 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
content.FileView (cognitive 55) packages/ui/src/content.tsx:132— content.FileView has cognitive complexity 55 (threshold 15). Drivers by points: ternaries 18 (33 pts), boolean chains 15, if/else 5 (7 pts) (nesting depth added 17). Most of this is not in the body itself: 4 of the 55 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 269, 275, 161, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
action_traces.join (cognitive 54) crates/crab-http-server/deploy/cell-issue-fleet/action_traces.py:109— action_traces.join has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20 (41 pts), boolean chains 8, loops 2, ternaries 1 (2 pts), error handling 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
git-architecture-player.GitArchitecturePlayer (cognitive 54) packages/web/components/blog/git-architecture-player.tsx:301— git-architecture-player.GitArchitecturePlayer has cognitive complexity 54 (threshold 15). Drivers by points: ternaries 33 (42 pts), if/else 9, boolean chains 3 (nesting depth added 9). Most of this is not in the body itself: 8 of the 54 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 524, a function literal at line 488, a function literal at line 400, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
verify_sdk_capabilities.validate (cognitive 52) crab/scripts/verify_sdk_capabilities.py:28— verify_sdk_capabilities.validate has cognitive complexity 52 (threshold 15). Drivers by points: if/else 20 (38 pts), loops 5 (7 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
App.App (cognitive 49) packages/ui/src/App.tsx:124— App.App has cognitive complexity 49 (threshold 15). Drivers by points: ternaries 13 (31 pts), boolean chains 12, if/else 5, error handling 1 (nesting depth added 18). Of this number, 24 points are the body's own statements and 25 belong to 9 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AddRemoteChunkClassifier::lookup_existing_candidates (cognitive 48) crab/src/git/push.rs:4316— AddRemoteChunkClassifier::lookup_existing_candidates has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 6 (17 pts), loops 4 (9 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qualify_reader_perf.main (cognitive 47) crates/crab-http-server/deploy/cell-issue-fleet/qualify_reader_perf.py:16— qualify_reader_perf.main has cognitive complexity 47 (threshold 15). Drivers by points: if/else 18 (35 pts), loops 4 (5 pts), boolean chains 4, ternaries 2 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_xet_module_scope (cognitive 46) crab/scripts/check-architecture-gates.py:2918— check-architecture-gates.check_xet_module_scope has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 6 (9 pts), boolean chains 5, error handling 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nfs-evidence-summary.smoke_summary_consistency_blockers (cognitive 46) crab/scripts/nfs-evidence-summary.py:841— nfs-evidence-summary.smoke_summary_consistency_blockers has cognitive complexity 46 (threshold 15). Drivers by points: if/else 17 (35 pts), boolean chains 5, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pulls.MergePanel (cognitive 46) packages/ui/src/pulls.tsx:1761— pulls.MergePanel has cognitive complexity 46 (threshold 15). Drivers by points: ternaries 14 (34 pts), boolean chains 7, if/else 4 (5 pts) (nesting depth added 21). Of this number, 39 points are the body's own statements and 7 belong to one function literal inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
check-release-archive-contents.check_release_workflow (cognitive 44) crab/scripts/release/check-release-archive-contents.py:196— check-release-archive-contents.check_release_workflow has cognitive complexity 44 (threshold 15). Drivers by points: if/else 14 (25 pts), loops 11, error handling 7 (8 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.rust_brace_delta (cognitive 42) crab/scripts/check-architecture-gates.py:2274— check-architecture-gates.rust_brace_delta has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (36 pts), boolean chains 5, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_workspace_dependency_sources (cognitive 41) crab/scripts/check-architecture-gates.py:2564— check-architecture-gates.check_workspace_dependency_sources has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 5 (8 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.
nfs-evidence-summary.render_threshold_suggestions (cognitive 41) crab/scripts/nfs-evidence-summary.py:1249— nfs-evidence-summary.render_threshold_suggestions has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (24 pts), boolean chains 10, loops 3 (7 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qualify_reader_retention.main (cognitive 41) crates/crab-http-server/deploy/cell-issue-fleet/qualify_reader_retention.py:48— qualify_reader_retention.main has cognitive complexity 41 (threshold 15). Drivers by points: if/else 18 (27 pts), boolean chains 7, loops 5 (6 pts), ternaries 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_cell_runtime_server_boundary (cognitive 40) crab/scripts/check-architecture-gates.py:2420— check-architecture-gates.check_cell_runtime_server_boundary has cognitive complexity 40 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 7 (14 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_cache_server_runtime_scope (cognitive 40) crab/scripts/check-architecture-gates.py:3823— check-architecture-gates.check_cache_server_runtime_scope has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 5 (8 pts), boolean chains 5, error handling 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.
check-architecture-gates.check_cache_module_scope (cognitive 39) crab/scripts/check-architecture-gates.py:3172— check-architecture-gates.check_cache_module_scope has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 6 (9 pts), boolean chains 3, error handling 1 (3 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_metadata_module_scope (cognitive 39) crab/scripts/check-architecture-gates.py:4591— check-architecture-gates.check_metadata_module_scope has cognitive complexity 39 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 7 (10 pts), boolean chains 3, error handling 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.
NodePublisher::run_shared (cognitive 38) crates/crab-http-server/src/peer.rs:358— NodePublisher::run_shared has cognitive complexity 38 (threshold 15). Drivers by points: if/else 6 (23 pts), match/switch 5 (11 pts), loops 2 (3 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.
ReadFlights::run (cognitive 38) crates/crab-remote-git/src/runtime/read_flight.rs:38— ReadFlights::run has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (25 pts), match/switch 4 (8 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_auth_store_adapter_scope (cognitive 38) crab/scripts/check-architecture-gates.py:3891— check-architecture-gates.check_auth_store_adapter_scope has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 7 (10 pts), error handling 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.
verify-provider-qualification-report.verify_report (cognitive 38) crab/scripts/verify-provider-qualification-report.py:44— verify-provider-qualification-report.verify_report has cognitive complexity 38 (threshold 15). Drivers by points: if/else 25 (28 pts), boolean chains 8, loops 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.
PreparedContent::new (cognitive 37) crates/crab-remote/src/prepare.rs:167— PreparedContent::new has cognitive complexity 37 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 8, loops 4 (5 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.
XorbBuilder::push_precompressed_with_reserve_and_admission (cognitive 37) crates/crab-xet/src/xorb/builder.rs:536— XorbBuilder::push_precompressed_with_reserve_and_admission has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 10, match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nfs-evidence-summary.threshold_evidence_tier (cognitive 37) crab/scripts/nfs-evidence-summary.py:958— nfs-evidence-summary.threshold_evidence_tier has cognitive complexity 37 (threshold 15). Drivers by points: if/else 27 (28 pts), boolean chains 5, ternaries 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
revision-picker.RevisionPicker (cognitive 37) packages/ui/src/revision-picker.tsx:23— revision-picker.RevisionPicker has cognitive complexity 37 (threshold 15). Drivers by points: ternaries 15 (25 pts), boolean chains 7, if/else 4, error handling 1 (nesting depth added 10). Most of this is not in the body itself: 14 of the 37 points are its own statements and the rest belongs to 7 function items inside it that branch (a function literal at line 172, createBranch, a function literal at line 140, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
check-architecture-gates.check_cache_store_module_scope (cognitive 36) crab/scripts/check-architecture-gates.py:3376— check-architecture-gates.check_cache_store_module_scope has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 6 (9 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_lfs_module_scope (cognitive 36) crab/scripts/check-architecture-gates.py:4465— check-architecture-gates.check_lfs_module_scope has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 6 (9 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify-nfs-smoke-report.compare_native_read_reports (cognitive 36) crab/scripts/verify-nfs-smoke-report.py:2459— verify-nfs-smoke-report.compare_native_read_reports has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 6 (12 pts), boolean chains 3, ternaries 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
settings.MemberSettings (cognitive 36) packages/ui/src/settings.tsx:148— settings.MemberSettings has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 12, ternaries 6 (9 pts), error handling 2 (nesting depth added 4). Most of this is not in the body itself: 11 of the 36 points are its own statements and the rest belongs to 8 function items inside it that branch (save, load, saveMember, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
check-architecture-gates.check_coordination_module_scope (cognitive 35) crab/scripts/check-architecture-gates.py:3113— check-architecture-gates.check_coordination_module_scope has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 6 (9 pts), error handling 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.
PeerHttpRoundTrip::owner (cognitive 34) crates/crab-http-server/src/peer/client.rs:176— PeerHttpRoundTrip::owner has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 6 (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.
GitVisibilityCatalogV1::validate_binding (cognitive 34) crates/crab-metadata/src/git_visibility.rs:1956— GitVisibilityCatalogV1::validate_binding has cognitive complexity 34 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 6, loops 4 (6 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.
git-import.GitImport (cognitive 34) packages/ui/src/git-import.tsx:19— git-import.GitImport has cognitive complexity 34 (threshold 15). Drivers by points: boolean chains 18, ternaries 5 (8 pts), if/else 7, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 14 of the 34 points are its own statements and the rest belongs to 6 function items inside it that branch (submit, a function literal at line 49, a function literal at line 40, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
pulls.PullDetail (cognitive 34) packages/ui/src/pulls.tsx:614— pulls.PullDetail has cognitive complexity 34 (threshold 15). Drivers by points: ternaries 18 (27 pts), boolean chains 7 (nesting depth added 9). Most of this is not in the body itself: 6 of the 34 points are its own statements and the rest belongs to one function literal inside it that branches (line 651). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
PushAdmissionTicket::try_admit (cognitive 33) crates/crab-coordination/src/push_admission.rs:153— PushAdmissionTicket::try_admit has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 6 (13 pts), loops 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_workspace_xet_dependency_sources (cognitive 33) crab/scripts/check-architecture-gates.py:2633— check-architecture-gates.check_workspace_xet_dependency_sources has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 5 (8 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.
check-architecture-gates.check_storage_module_scope (cognitive 33) crab/scripts/check-architecture-gates.py:4527— check-architecture-gates.check_storage_module_scope has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (20 pts), loops 6 (9 pts), error handling 1 (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.
load.observe_nodes (cognitive 33) REDACTED:442— load.observe_nodes has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 3 (5 pts), error handling 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.
data-query.statementBoundary (cognitive 33) packages/ui/src/data-query.ts:64— data-query.statementBoundary has cognitive complexity 33 (threshold 15). Drivers by points: if/else 14 (27 pts), boolean chains 5, 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.
code-symbols.worker.containingName (cognitive 33) packages/ui/src/code-symbols.worker.ts:102— code-symbols.worker.containingName has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (27 pts), ternaries 1 (5 pts), loops 1 (nesting depth added 22). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Verifier.verify_route_contract_behavior (cognitive 32) crab/scripts/verify-cache-service-smoke-report.py:819— Verifier.verify_route_contract_behavior has cognitive complexity 32 (threshold 15). Drivers by points: boolean chains 16, ternaries 6 (7 pts), loops 5, if/else 2 (4 pts) (nesting depth added 3). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
verify-nfs-smoke-report.verify_directory (cognitive 32) crab/scripts/verify-nfs-smoke-report.py:2170— verify-nfs-smoke-report.verify_directory has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 4 (10 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.
qualify_read_replicas.prove_reader_targets (cognitive 32) REDACTED:239— qualify_read_replicas.prove_reader_targets has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 5, error handling 1 (3 pts), loops 2 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FuseResolver::readdir_page (cognitive 31) crates/crab-vfs/src/resolver.rs:355— FuseResolver::readdir_page has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 4 (7 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_workspace_gitoxide_dependency_sources (cognitive 31) crab/scripts/check-architecture-gates.py:2693— check-architecture-gates.check_workspace_gitoxide_dependency_sources has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 5 (8 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (check-architecture-gates.check_workspace_provider_sdk_dependency_sources, check-architecture-gates.check_workspace_third_party_dependency_sources) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
check-architecture-gates.check_workspace_provider_sdk_dependency_sources (cognitive 31) crab/scripts/check-architecture-gates.py:2743— check-architecture-gates.check_workspace_provider_sdk_dependency_sources has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 5 (8 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (check-architecture-gates.check_workspace_gitoxide_dependency_sources, check-architecture-gates.check_workspace_third_party_dependency_sources) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
check-architecture-gates.check_workspace_third_party_dependency_sources (cognitive 31) crab/scripts/check-architecture-gates.py:2793— check-architecture-gates.check_workspace_third_party_dependency_sources has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (23 pts), loops 5 (8 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (check-architecture-gates.check_workspace_gitoxide_dependency_sources, check-architecture-gates.check_workspace_provider_sdk_dependency_sources) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 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.
check-architecture-gates.check_read_module_scope (cognitive 31) crab/scripts/check-architecture-gates.py:4122— check-architecture-gates.check_read_module_scope has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 5 (8 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_diff_module_scope (cognitive 31) crab/scripts/check-architecture-gates.py:4405— check-architecture-gates.check_diff_module_scope has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 6 (9 pts), boolean chains 3, error handling 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.
check-architecture-gates.check_deleted_workflow_reexport_adapters_removed (cognitive 31) crab/scripts/check-architecture-gates.py:4758— check-architecture-gates.check_deleted_workflow_reexport_adapters_removed has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 6 (10 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.
fault.verify_unique_results (cognitive 31) crates/crab-http-server/deploy/cell-issue-fleet/fault.py:41— fault.verify_unique_results has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (20 pts), loops 4 (7 pts), boolean chains 4 (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.
StoreChecker::verify_pointer_data (cognitive 30) crab/src/cmd/fsck_store.rs:101— StoreChecker::verify_pointer_data has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 7 (13 pts), loops 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_auth_module_scope (cognitive 30) crab/scripts/check-architecture-gates.py:3609— check-architecture-gates.check_auth_module_scope has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 6 (9 pts), error handling 1 (3 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_workflow_module_scope (cognitive 30) crab/scripts/check-architecture-gates.py:4708— check-architecture-gates.check_workflow_module_scope has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 6 (9 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nfs-evidence-summary.render_benchmark_markdown (cognitive 30) crab/scripts/nfs-evidence-summary.py:236— nfs-evidence-summary.render_benchmark_markdown has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (8 pts), ternaries 4 (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.
verify-nfs-smoke-report.main (cognitive 30) crab/scripts/verify-nfs-smoke-report.py:4865— verify-nfs-smoke-report.main has cognitive complexity 30 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 9 (12 pts), boolean chains 4, error handling 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify_git_capability_matrix.validate_report (cognitive 30) crab/scripts/verify_git_capability_matrix.py:105— verify_git_capability_matrix.validate_report has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (18 pts), boolean chains 9, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
S3VersionedList::walk_versions (cognitive 29) crab/src/import/versions.rs:754— S3VersionedList::walk_versions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpdatePull::execute (cognitive 29) crates/crab-http-server/src/cells/repository/pulls.rs:444— UpdatePull::execute has cognitive complexity 29 (threshold 15). Drivers by points: if/else 16 (18 pts), boolean chains 9, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Graph::build (cognitive 29) crates/crab-workflow/src/graph.rs:65— Graph::build has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 6 (8 pts), match/switch 2 (6 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify-nfs-smoke-report.compare_directory (cognitive 29) crab/scripts/verify-nfs-smoke-report.py:2641— verify-nfs-smoke-report.compare_directory has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 4 (9 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.
verify_git_capability_matrix.validate (cognitive 29) crab/scripts/verify_git_capability_matrix.py:51— verify_git_capability_matrix.validate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (22 pts), loops 3 (4 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.
GcsVersionedList::walk_versions (cognitive 28) crab/src/import/versions.rs:1095— GcsVersionedList::walk_versions has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_diff::pointer_pairs::pair_files (cognitive 28) crates/crab-diff/src/pointer_pairs.rs:13— crab_diff::pointer_pairs::pair_files has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (22 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpdateIssue::execute (cognitive 28) crates/crab-http-server/src/cells/repository/operations.rs:12— UpdateIssue::execute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20 (23 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
TransitionPullMerge::execute (cognitive 28) crates/crab-http-server/src/cells/repository/pulls.rs:1177— TransitionPullMerge::execute has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (25 pts), boolean chains 2, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitVisibilityIndex::validate (cognitive 28) crates/crab-metadata/src/git_visibility.rs:934— GitVisibilityIndex::validate has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 5 (7 pts), boolean chains 6 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_git_module_scope (cognitive 28) crab/scripts/check-architecture-gates.py:4276— check-architecture-gates.check_git_module_scope has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 6 (9 pts), error handling 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.
check-architecture-gates.check_deleted_metadata_reexport_adapters_removed (cognitive 28) crab/scripts/check-architecture-gates.py:4661— check-architecture-gates.check_deleted_metadata_reexport_adapters_removed has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 5 (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.
verify-nfs-smoke-report.check_write_journal_runtime_status (cognitive 28) crab/scripts/verify-nfs-smoke-report.py:832— verify-nfs-smoke-report.check_write_journal_runtime_status has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 7, loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
qualify.main (cognitive 28) REDACTED:375— qualify.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (5 pts), error handling 2, boolean chains 1, ternaries 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qualify_mode_rollout.main (cognitive 28) crates/crab-http-server/deploy/cell-issue-fleet/qualify_mode_rollout.py:93— qualify_mode_rollout.main has cognitive complexity 28 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 5 (7 pts), boolean chains 4 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
GoogleGcsReplicationControlPlaneClient::validate_policy (cognitive 27) crab/src/replication/mod.rs:3324— GoogleGcsReplicationControlPlaneClient::validate_policy has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (24 pts), boolean chains 2, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RepositoryCellRouter::rebalance_once (cognitive 27) crates/crab-http-server/src/cells/router.rs:213— RepositoryCellRouter::rebalance_once 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.
LfsObjectStore::get_verified_stream_at (cognitive 27) crates/crab-lfs/src/object_store.rs:775— LfsObjectStore::get_verified_stream_at has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 8, loops 1 (2 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
check-architecture-gates.check_auth_provider_dispatch_owner (cognitive 27) crab/scripts/check-architecture-gates.py:4858— check-architecture-gates.check_auth_provider_dispatch_owner has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (9 pts), ternaries 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nfs-evidence-summary.render_smoke_markdown (cognitive 27) crab/scripts/nfs-evidence-summary.py:350— nfs-evidence-summary.render_smoke_markdown has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (14 pts), ternaries 6 (10 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
discussion.Editor (cognitive 27) packages/ui/src/discussion.tsx:192— discussion.Editor has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 11 (18 pts), boolean chains 5, if/else 4 (nesting depth added 7). Most of this is not in the body itself: 3 of the 27 points are its own statements and the rest belongs to 5 function items inside it that branch (formatShortcut, a function literal at line 303, a function literal at line 253, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
issues.IssueList (cognitive 27) packages/ui/src/issues.tsx:97— issues.IssueList has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 10 (19 pts), boolean chains 8 (nesting depth added 9). Most of this is not in the body itself: 2 of the 27 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 155, 136, 123, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
pulls.PullReviewThreads (cognitive 27) packages/ui/src/pulls.tsx:796— pulls.PullReviewThreads has cognitive complexity 27 (threshold 15). Drivers by points: ternaries 13 (14 pts), boolean chains 9, if/else 4 (nesting depth added 1). Of this number, 14 points are the body's own statements and 13 belong to 4 function items inside it that branch. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
verify-nfs-smoke-report.check_writeback_artifact (cognitive 26) crab/scripts/verify-nfs-smoke-report.py:1601— verify-nfs-smoke-report.check_writeback_artifact has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 6, loops 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
knowledge-check.KnowledgeCheck (cognitive 26) packages/web/components/library/knowledge-check.tsx:9— knowledge-check.KnowledgeCheck has cognitive complexity 26 (threshold 15). Drivers by points: boolean chains 12, ternaries 6 (8 pts), if/else 3 (4 pts), error handling 1 (2 pts) (nesting depth added 4). Most of this is not in the body itself: 7 of the 26 points are its own statements and the rest belongs to 2 function items inside it that branch (a function literal at line 95, verify). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
AzureVersionedList::walk_versions (cognitive 25) crab/src/import/versions.rs:1374— AzureVersionedList::walk_versions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-architecture-gates.check_deleted_auth_provider_reexport_adapters_removed (cognitive 25) crab/scripts/check-architecture-gates.py:4817— check-architecture-gates.check_deleted_auth_provider_reexport_adapters_removed has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (8 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.
check-install-layout.check_layout (cognitive 25) crab/scripts/release/check-install-layout.py:205— check-install-layout.check_layout has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify-nfs-smoke-report.check_unmount_artifact (cognitive 25) crab/scripts/verify-nfs-smoke-report.py:1698— verify-nfs-smoke-report.check_unmount_artifact has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 5, loops 1 (2 pts), error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify-nfs-smoke-report.validate (cognitive 25) crab/scripts/verify-nfs-smoke-report.py:1940— verify-nfs-smoke-report.validate has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 12 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
TailFault.run (cognitive 25) crates/crab-http-server/deploy/cell-issue-fleet/fault.py:226— TailFault.run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 7, error handling 2 (3 pts), loops 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
fault.main (cognitive 25) crates/crab-http-server/deploy/cell-issue-fleet/fault.py:315— fault.main has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (15 pts), ternaries 2 (4 pts), boolean chains 3, loops 2, error handling 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
load.main (cognitive 25) REDACTED:565— load.main has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 3, loops 3, error handling 2, ternaries 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
settings.BranchProtectionSettings (cognitive 25) packages/ui/src/settings.tsx:919— settings.BranchProtectionSettings has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (9 pts), boolean chains 8, if/else 6 (7 pts), error handling 1 (nesting depth added 5). Most of this is not in the body itself: 5 of the 25 points are its own statements and the rest belongs to 4 function items inside it that branch (replaceRules, a function literal at line 1064, saveRule, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
UpdatePullReviewThread::execute (cognitive 24) crates/crab-http-server/src/cells/repository/pull_review_threads.rs:329— UpdatePullReviewThread::execute has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), boolean chains 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OfflineAdvertisement::run (cognitive 24) crates/crab-http-server/src/cells.rs:1818— OfflineAdvertisement::run has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 7 (17 pts), if/else 1 (4 pts), loops 2 (3 pts) (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
StoreClient::batch_get_reconstruction (cognitive 24) crates/crab-read/src/store_client.rs:596— StoreClient::batch_get_reconstruction has cognitive complexity 24 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
LocalTools::run (cognitive 24) crates/crab-remote/src/local.rs:425— LocalTools::run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (18 pts), match/switch 3, loops 1 (2 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.
ReadContent::stream (cognitive 24) crates/crab-s3-gateway/src/gateway.rs:272— ReadContent::stream has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
CheckpointLineage::append (cognitive 24) crates/crab-workflow/src/checkpoint.rs:151— CheckpointLineage::append has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 8, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
nfs-evidence-summary.suggest_smoke_verify_args (cognitive 24) crab/scripts/nfs-evidence-summary.py:488— nfs-evidence-summary.suggest_smoke_verify_args has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (6 pts), ternaries 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.
qualify.run_stage (cognitive 24) REDACTED:232— qualify.run_stage has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 5 (6 pts), boolean chains 2, ternaries 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
browse.Directory (cognitive 24) packages/ui/src/browse.tsx:100— browse.Directory has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 8 (15 pts), boolean chains 8, if/else 1 (nesting depth added 7). Most of this is not in the body itself: 1 of the 24 points is its own statement and the rest belongs to 3 function literals inside it that branch (lines 202, 147, 137). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
pulls.PullList (cognitive 24) packages/ui/src/pulls.tsx:305— pulls.PullList has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 9 (16 pts), boolean chains 8 (nesting depth added 7). Most of this is not in the body itself: 2 of the 24 points are its own statements and the rest belongs to 4 function literals inside it that branch (lines 371, 349, 375, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
TransferCoordinator::execute (cognitive 23) crab/src/lfs/coordinator.rs:248— TransferCoordinator::execute has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 5 (9 pts), boolean chains 3, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteGitRuntime::generate_pack_singleflight (cognitive 23) crates/crab-remote-git/src/runtime.rs:851— RemoteGitRuntime::generate_pack_singleflight has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 4 (11 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.
LocalRepository::prepare_push_with_options (cognitive 23) crates/crab-sdk/src/local/push.rs:333— LocalRepository::prepare_push_with_options has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 5 (9 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.
Lockfile::diff_against_resolved (cognitive 23) crates/crab-workflow/src/lockfile.rs:229— Lockfile::diff_against_resolved has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 4 (7 pts), loops 6 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qualify_sdk.benchmark_read (cognitive 23) crab/scripts/qualify_sdk.py:422— qualify_sdk.benchmark_read has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (6 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.
code-symbols-panel.CodeSymbolsPanel (cognitive 23) packages/ui/src/code-symbols-panel.tsx:41— code-symbols-panel.CodeSymbolsPanel has cognitive complexity 23 (threshold 15). Drivers by points: ternaries 8 (20 pts), boolean chains 2, loops 1 (nesting depth added 12). Of this number, 15 points are the body's own statements and 8 belong to 5 function literals inside it that branch. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
GcFenceLease::acquire_with_holder (cognitive 22) crates/crab-coordination/src/gc_fence.rs:411— GcFenceLease::acquire_with_holder has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 3 (7 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.
OverlayStore::reconcile (cognitive 22) crates/crab-vfs/src/overlay.rs:368— OverlayStore::reconcile has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 2 (6 pts), loops 3, 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.
check-architecture-gates.check_xet_owner_imports (cognitive 22) crab/scripts/check-architecture-gates.py:3731— check-architecture-gates.check_xet_owner_imports has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (7 pts), error handling 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.
check-architecture-gates.check_cache_server_origin_construction (cognitive 22) crab/scripts/check-architecture-gates.py:3788— check-architecture-gates.check_cache_server_origin_construction has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (7 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (check-architecture-gates.check_auth_server_runtime_scope) 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.
check-architecture-gates.check_auth_server_runtime_scope (cognitive 22) crab/scripts/check-architecture-gates.py:3982— check-architecture-gates.check_auth_server_runtime_scope has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 4 (7 pts), error handling 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (check-architecture-gates.check_cache_server_origin_construction) 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.
nfs-read-path-bench-report.validate_comparison_thresholds (cognitive 22) crab/scripts/nfs-read-path-bench-report.py:393— nfs-read-path-bench-report.validate_comparison_thresholds has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (6 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.
verify-nfs-smoke-report.check_mount_list_artifact (cognitive 22) crab/scripts/verify-nfs-smoke-report.py:351— verify-nfs-smoke-report.check_mount_list_artifact has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 2 (3 pts), error handling 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TailFault.preflight (cognitive 22) crates/crab-http-server/deploy/cell-issue-fleet/fault.py:99— TailFault.preflight has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 6, 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.
load.wait_for_placement (cognitive 22) REDACTED:337— load.wait_for_placement has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 5, loops 2 (3 pts), error handling 1 (2 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pdf-preview.PdfPreview (cognitive 22) packages/ui/src/pdf-preview.tsx:10— pdf-preview.PdfPreview has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, ternaries 3 (6 pts), boolean chains 5 (nesting depth added 3). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 7 function literals inside it that branch (lines 56, 79, 37, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
content.DiffView (cognitive 22) packages/ui/src/content.tsx:915— content.DiffView has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 8 (9 pts), boolean chains 7, if/else 6 (nesting depth added 1). Most of this is not in the body itself: 3 of the 22 points are its own statements and the rest belongs to 8 function literals inside it that branch (lines 974, 932, 941, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
release-form.EditReleaseForm (cognitive 22) packages/ui/src/release-form.tsx:220— release-form.EditReleaseForm has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 10 (18 pts), boolean chains 2, error handling 1, if/else 1 (nesting depth added 8). Most of this is not in the body itself: 9 of the 22 points are its own statements and the rest belongs to one function item inside it that branches (update). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
StoreRepairer::abort_multipart (cognitive 21) crab/src/cmd/fsck_store.rs:990— StoreRepairer::abort_multipart has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SmudgeSessionHydrator::hydrate_batch (cognitive 21) crab/src/cmd/hydrate.rs:488— SmudgeSessionHydrator::hydrate_batch has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 3 (7 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.
CheckpointScheduler::run_ref (cognitive 21) crates/crab-s3-gateway/src/mutation.rs:653— CheckpointScheduler::run_ref has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 5 (10 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
check-nfs-smoke-scripts.self_test (cognitive 21) crab/scripts/check-nfs-smoke-scripts.py:311— check-nfs-smoke-scripts.self_test has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
verify-sdk-read-only.main (cognitive 21) crab/scripts/verify-sdk-read-only.py:87— verify-sdk-read-only.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 7, error handling 1 (2 pts), loops 2, ternaries 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.
qualify.prove_owner_loss (cognitive 21) REDACTED:322— qualify.prove_owner_loss has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 5, error handling 1 (2 pts), loops 2, ternaries 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.
qualify_read_replicas.measure_refresh (cognitive 21) REDACTED:137— qualify_read_replicas.measure_refresh has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, error handling 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.
release-form.NewRelease (cognitive 21) packages/ui/src/release-form.tsx:375— release-form.NewRelease has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 6 (9 pts), boolean chains 6, if/else 5, error handling 1 (nesting depth added 3). Most of this is not in the body itself: 10 of the 21 points are its own statements and the rest belongs to one function item inside it that branches (submit). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
LfsConfig::apply_env (cognitive 20) crab/src/lfs/config.rs:168— LfsConfig::apply_env has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, boolean chains 7, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GitCatalogVisibilityIndex::apply_ordinal_edit (cognitive 20) crates/crab-metadata/src/git_visibility.rs:685— GitCatalogVisibilityIndex::apply_ordinal_edit has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12, boolean chains 4, loops 2 (3 pts), match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Manifest::complete_listing (cognitive 20) crates/crab-s3-gateway/src/attributes.rs:310— Manifest::complete_listing has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 2, loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StagingAreaReadOnly::push_plan_stats (cognitive 20) crates/crab-staging/src/lib.rs:4283— StagingAreaReadOnly::push_plan_stats has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreparedXorbCache::insert_candidate (cognitive 20) crates/crab-staging/src/push_plan.rs:190— PreparedXorbCache::insert_candidate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
crab_storage::retry::retry (cognitive 20) crates/crab-storage/src/retry.rs:119— crab_storage::retry::retry has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 3 (7 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.
ArtifactDecl::from_value (cognitive 20) crates/crab-workflow/src/artifact.rs:203— ArtifactDecl::from_value has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 3, loops 2 (3 pts), 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.
ArtifactRegistry::validate (cognitive 20) crates/crab-workflow/src/artifact.rs:381— ArtifactRegistry::validate has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AwsProvider.cleanup_staging (cognitive 20) crab/deploy/auth-service/src/providers/aws.py:120— AwsProvider.cleanup_staging has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 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.
qualify_sdk.compare_read (cognitive 20) crab/scripts/qualify_sdk.py:250— qualify_sdk.compare_read has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, loops 1, ternaries 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.
load.recover_owner (cognitive 20) REDACTED:506— load.recover_owner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, error handling 1 (2 pts), loops 2, ternaries 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.
git-access.GitAccess (cognitive 20) packages/ui/src/git-access.tsx:20— git-access.GitAccess has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 9, ternaries 6 (7 pts), if/else 3, error handling 1 (nesting depth added 1). Most of this is not in the body itself: 9 of the 20 points are its own statements and the rest belongs to 3 function items inside it that branch (change, a function literal at line 118, a function literal at line 148). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
hero-section.HeroSection (cognitive 20) packages/web/components/marketing/hero-section.tsx:107— hero-section.HeroSection has cognitive complexity 20 (threshold 15). Drivers by points: boolean chains 15, ternaries 4 (5 pts) (nesting depth added 1). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
AddProgress::render_batch_line (cognitive 19) crab/src/cmd/add.rs:522— AddProgress::render_batch_line has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 5, boolean chains 3 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DurableMarkReader::load_partition (cognitive 19) crab/src/cmd/gc/marks.rs:277— DurableMarkReader::load_partition has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 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.
SpeculativeDriver::launch_speculative (cognitive 19) crab/src/speculation/driver.rs:132— SpeculativeDriver::launch_speculative has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), 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.
Generation::open (cognitive 19) crates/crab-cache/src/private_fs/platform/database/generation.rs:35— Generation::open has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ChunkIndex::rebuild_from_shards (cognitive 19) crates/crab-cache-server/src/chunk_index.rs:141— ChunkIndex::rebuild_from_shards has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 6 (10 pts), loops 2 (5 pts), if/else 2 (4 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.
Prepared::upload (cognitive 19) crates/crab-remote/src/prepare.rs:585— Prepared::upload has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommitGraphIndex::reachable_from_roots (cognitive 19) crates/crab-remote-git/src/commit_graph.rs:100— CommitGraphIndex::reachable_from_roots has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RefreshService::poll_remote (cognitive 19) crates/crab-vfs/src/refresh.rs:690— RefreshService::poll_remote has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StageName::parse (cognitive 19) crates/crab-workflow/src/stage_name.rs:26— StageName::parse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 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.
check-architecture-gates.check_object_store_features (cognitive 19) crab/scripts/check-architecture-gates.py:2135— check-architecture-gates.check_object_store_features has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), ternaries 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.
check-architecture-gates.check_package_release_policy (cognitive 19) crab/scripts/check-architecture-gates.py:2171— check-architecture-gates.check_package_release_policy has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 6 (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.
check-architecture-gates.check_server_fixture_dependencies (cognitive 19) crab/scripts/check-architecture-gates.py:2227— check-architecture-gates.check_server_fixture_dependencies has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (5 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.
check-sdk-features.violations (cognitive 19) crab/scripts/check-sdk-features.py:24— check-sdk-features.violations has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 5 (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.
nfs-read-path-bench-report.validate_record (cognitive 19) crab/scripts/nfs-read-path-bench-report.py:95— nfs-read-path-bench-report.validate_record has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 4, 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.
qualify_reader_first_loss.main (cognitive 19) crates/crab-http-server/deploy/cell-issue-fleet/qualify_reader_first_loss.py:31— qualify_reader_first_loss.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, loops 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
pulls.ReviewThreadCard (cognitive 19) packages/ui/src/pulls.tsx:1139— pulls.ReviewThreadCard has cognitive complexity 19 (threshold 15). Drivers by points: boolean chains 10, ternaries 6 (7 pts), if/else 2 (nesting depth added 1). Of this number, 17 points are the body's own statements and 2 belong to 2 function items inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
pulls.RequiredChecks (cognitive 19) packages/ui/src/pulls.tsx:1957— pulls.RequiredChecks has cognitive complexity 19 (threshold 15). Drivers by points: ternaries 10 (15 pts), boolean chains 3, if/else 1 (nesting depth added 5). Of this number, 10 points are the body's own statements and 9 belong to 3 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativePushProgress::report_dedup (cognitive 18) crab/src/git/progress.rs:1135— NativePushProgress::report_dedup has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), 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.
GcFenceState::validate (cognitive 18) crates/crab-coordination/src/gc_fence.rs:109— GcFenceState::validate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (10 pts), boolean chains 7, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MutableTree::commit (cognitive 18) crates/crab-s3-gateway/src/mutation.rs:2275— MutableTree::commit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 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.
crab_types::pointer::is_pointer (cognitive 18) crates/crab-types/src/pointer.rs:164— crab_types::pointer::is_pointer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 5. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CrabNfsDirIter::next (cognitive 18) crates/crab-vfs/src/nfs.rs:2030— CrabNfsDirIter::next has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (5 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.
GcpProvider.cleanup_staging (cognitive 18) crab/deploy/auth-service/src/providers/gcp.py:117— GcpProvider.cleanup_staging has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
action_traces.parse_log (cognitive 18) crates/crab-http-server/deploy/cell-issue-fleet/action_traces.py:24— action_traces.parse_log has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 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.
import_image.artifact_metadata (cognitive 18) crates/crab-http-server/deploy/cell-issue-fleet/import_image.py:20— import_image.artifact_metadata has cognitive complexity 18 (threshold 15). Drivers by points: if/else 13, boolean chains 4, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
issues.IssueDetail (cognitive 18) packages/ui/src/issues.tsx:304— issues.IssueDetail has cognitive complexity 18 (threshold 15). Drivers by points: boolean chains 11, ternaries 3 (5 pts), if/else 2 (nesting depth added 2). Of this number, 11 points are the body's own statements and 7 belong to 4 function literals inside it that branch. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
source.attachIcons (cognitive 18) packages/web/lib/source.ts:45— source.attachIcons has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (17 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.
MetaDbTomlConfig::apply_env_overrides (cognitive 17) crab/src/core/config.rs:556— MetaDbTomlConfig::apply_env_overrides has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (17 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
AzureReplicationControlPlaneBackend::apply (cognitive 17) crab/src/replication/mod.rs:476— AzureReplicationControlPlaneBackend::apply has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ListIssues::execute (cognitive 17) crates/crab-http-server/src/cells/repository/operations.rs:218— ListIssues::execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileIndexLookupSession::manifest_scoped_lookup_batch (cognitive 17) crates/crab-metadata/src/file_index_lookup.rs:517— FileIndexLookupSession::manifest_scoped_lookup_batch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitVisibilityStoredClosureV1::into_positions (cognitive 17) crates/crab-metadata/src/git_visibility.rs:2443— GitVisibilityStoredClosureV1::into_positions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
TreeEdits::build (cognitive 17) crates/crab-remote/src/objects.rs:228— TreeEdits::build has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (8 pts), if/else 3 (6 pts), loops 2, boolean chains 1 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ArchiveReader::next_entry (cognitive 17) crates/crab-remote-git/src/snapshot.rs:1384— ArchiveReader::next_entry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WriteAdmission::enqueue (cognitive 17) crates/crab-s3-gateway/src/mutation.rs:1043— WriteAdmission::enqueue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RequestBinding::validate (cognitive 17) crates/crab-sdk/src/mutation.rs:594— RequestBinding::validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 6, match/switch 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Composer::apply_group_override (cognitive 17) crates/crab-workflow/src/hydra.rs:240— Composer::apply_group_override has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 2 (4 pts), loops 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.
check-architecture-gates.check_workspace_dependency_policy (cognitive 17) crab/scripts/check-architecture-gates.py:2479— check-architecture-gates.check_workspace_dependency_policy has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 5 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
load.scheduled_load (cognitive 17) REDACTED:264— load.scheduled_load has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (4 pts), ternaries 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
load.drain_publication (cognitive 17) REDACTED:417— load.drain_publication has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qualify_read_replicas.prove_all_reader_loss (cognitive 17) REDACTED:350— qualify_read_replicas.prove_all_reader_loss has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, error handling 1 (2 pts), loops 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.
repository-markdown.repositoryTarget (cognitive 17) packages/ui/src/repository-markdown.tsx:28— repository-markdown.repositoryTarget has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), ternaries 3, boolean chains 2, error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
refs.RefsPage (cognitive 17) packages/ui/src/refs.tsx:171— refs.RefsPage has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 11 (12 pts), boolean chains 5 (nesting depth added 1). Of this number, 16 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
GcsReplicationControlPlaneBackend::gcs_backfill_check (cognitive 16) crab/src/replication/mod.rs:1262— GcsReplicationControlPlaneBackend::gcs_backfill_check has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RestoreOrchestrator::ensure_warm (cognitive 16) crab/src/tier/restore.rs:109— RestoreOrchestrator::ensure_warm has cognitive complexity 16 (threshold 15). Drivers by points: if/else 2 (8 pts), match/switch 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManagedDiscoveryClient::resolve_profile_at (cognitive 16) crates/crab-auth/src/managed/profile_discovery.rs:94— ManagedDiscoveryClient::resolve_profile_at has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GitReceiveWorkspace::materialize_source_push_in (cognitive 16) crates/crab-auth-server/src/receive/git_workspace.rs:176— GitReceiveWorkspace::materialize_source_push_in has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CacheHealthReport::issue (cognitive 16) crates/crab-cache/src/health.rs:172— CacheHealthReport::issue has cognitive complexity 16 (threshold 15). Drivers by points: boolean chains 6, if/else 5 (6 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CatalogDocument::validate (cognitive 16) crates/crab-http-server/src/catalog.rs:132— CatalogDocument::validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 6, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ListComments::execute (cognitive 16) crates/crab-http-server/src/cells/repository/operations.rs:287— ListComments::execute has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommitGraphSummary::is_ancestor (cognitive 16) crates/crab-metadata/src/commit_graph.rs:184— CommitGraphSummary::is_ancestor has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OperationContext::open_inner (cognitive 16) crates/crab-remote-git/src/operation.rs:213— OperationContext::open_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
AdmissionBody::poll_frame (cognitive 16) crates/crab-storage/src/transport_read_admission.rs:285— AdmissionBody::poll_frame has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (8 pts), loops 2 (5 pts), if/else 2 (3 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.
IpcServer::run_with_bound_hook (cognitive 16) crates/crab-vfs/src/ipc_server.rs:356— IpcServer::run_with_bound_hook has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 2 (5 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DvcMigrationJournal::validate (cognitive 16) crates/crab-workflow/src/dvc_inventory.rs:448— DvcMigrationJournal::validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (9 pts), boolean chains 6, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DagScheduler::handle_failure (cognitive 16) crates/crab-workflow/src/scheduler.rs:219— DagScheduler::handle_failure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
aws._build_session_policy (cognitive 16) crab/deploy/auth-service/src/providers/aws.py:177— aws._build_session_policy has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
check-architecture-gates.manifest_dependency_tables (cognitive 16) crab/scripts/check-architecture-gates.py:2524— check-architecture-gates.manifest_dependency_tables has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
nfs-evidence-summary.benchmark_expected_ratios (cognitive 16) crab/scripts/nfs-evidence-summary.py:695— nfs-evidence-summary.benchmark_expected_ratios has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 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.
nfs-evidence-summary.thresholds_command (cognitive 16) crab/scripts/nfs-evidence-summary.py:1375— nfs-evidence-summary.thresholds_command has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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.
verify-nfs-smoke-report.check_remount_artifact (cognitive 16) crab/scripts/verify-nfs-smoke-report.py:1864— verify-nfs-smoke-report.check_remount_artifact has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 4, error handling 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
qualify.request_json (cognitive 16) REDACTED:99— qualify.request_json has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), ternaries 2 (3 pts), error handling 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qualify_read_replicas.main (cognitive 16) REDACTED:466— qualify_read_replicas.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
qualify_reader_load.main (cognitive 16) REDACTED:107— qualify_reader_load.main has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 3, 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.
qualify_reader_partition.qualify (cognitive 16) REDACTED:39— qualify_reader_partition.qualify has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 4, error handling 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
content-editor.UploadFiles (cognitive 16) packages/ui/src/content-editor.tsx:333— content-editor.UploadFiles has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5, ternaries 4 (5 pts), boolean chains 4, error handling 1, loops 1 (nesting depth added 1). Most of this is not in the body itself: 2 of the 16 points are its own statements and the rest belongs to 3 function items inside it that branch (submit, selectFiles, a function literal at line 480). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
file-preview.FilePreview (cognitive 16) packages/ui/src/file-preview.tsx:519— file-preview.FilePreview has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 4 (13 pts), if/else 3 (nesting depth added 9). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
content.ChangeWorkspace (cognitive 16) packages/ui/src/content.tsx:684— content.ChangeWorkspace has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 4 (5 pts), boolean chains 2, loops 1 (nesting depth added 3). Most of this is not in the body itself: 4 of the 16 points are its own statements and the rest belongs to 6 function items inside it that branch (a function literal at line 715, a function literal at line 710, scrollToChange, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
content.ChangeTree (cognitive 16) packages/ui/src/content.tsx:800— content.ChangeTree has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (7 pts), ternaries 5, boolean chains 3, loops 1 (nesting depth added 1). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to 2 function literals inside it that branch (lines 834, 882). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
code-symbols.worker.extractSymbols (cognitive 16) packages/ui/src/code-symbols.worker.ts:155— code-symbols.worker.extractSymbols has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). Of this number, 14 points are the body's own statements and 2 belong to 2 function literals inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page.PricingPage (cognitive 16) packages/web/app/pricing/page.tsx:298— page.PricingPage has cognitive complexity 16 (threshold 15). Drivers by points: ternaries 11, boolean chains 5. None of this is in the body itself: all 16 points belong to 3 function literals inside it that branch (lines 372, 509, 440). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
D4 · Code Duplication· Near-duplicate member family (4 members, 21 shared lines) · ×1
Near-duplicate member family (4 members, 21 shared lines) crab/src/cmd/run.rs:3435— crab/src/cmd/run.rs:3435-3528 | crab/src/cmd/status_workflow.rs:898-964 | REDACTED:2298-2393 | REDACTED:2442-2572 — These 4 members are variants of one another: a block of 21 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 17 shared lines) · ×1
Near-duplicate member family (4 members, 17 shared lines) crab/src/cmd/gc/bucket.rs:1460— crab/src/cmd/gc/bucket.rs:1460-1501 | crab/src/cmd/gc/bucket.rs:1654-1711 | crab/src/cmd/gc/bucket.rs:1718-1782 | crab/src/cmd/gc/bucket.rs:1791-1833 — These 4 members are variants of one another: a block of 17 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 36 shared lines) · ×1
Near-duplicate member family (3 members, 36 shared lines) crab/src/git/progress.rs:306— crab/src/git/progress.rs:306-348 | crab/src/git/progress.rs:359-404 | crab/src/git/progress.rs:411-453 — These 3 members are variants of one another: a block of 36 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 (98 shared lines) crab/src/cmd/run.rs:2144— crab/src/cmd/run.rs:2144-2308 | crab/src/cmd/run.rs:2784-2956 — These two members are variants of one another: 98 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 (69 shared lines) crates/crab-read/src/term_resolver.rs:110— crates/crab-read/src/term_resolver.rs:110-216 | crates/crab-read/src/term_resolver.rs:255-365 — These two members are variants of one another: 69 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (41 shared lines) crab/src/git/filter_process.rs:1418— crab/src/git/filter_process.rs:1418-1519 | crab/src/git/filter_process.rs:1531-1647 — These two members are variants of one another: 41 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 (26 shared lines) crab/src/cmd/exp.rs:2627— crab/src/cmd/exp.rs:2627-2715 | crab/src/cmd/exp.rs:3357-3448 — These two members are variants of one another: 26 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (24 shared lines) crates/crab-staging/src/index.rs:7056— crates/crab-staging/src/index.rs:7056-7122 | crates/crab-staging/src/index.rs:7257-7338 — These two members are variants of one another: 24 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 (17 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (17 members, 50+ identical tokens) crab/scripts/check-architecture-gates.py:2919— crab/scripts/check-architecture-gates.py:2919-2980 | crab/scripts/check-architecture-gates.py:3114-3169 | crab/scripts/check-architecture-gates.py:3173-3226 | crab/scripts/check-architecture-gates.py:3377-3447 | crab/scripts/check-architecture-gates.py:3610-3659 | crab/scripts/check-architecture-gates.py:3789-3820 | crab/scripts/check-architecture-gates.py:3824-3888 | crab/scripts/check-architecture-gates.py:3983-4014 | crab/scripts/check-architecture-gates.py:4123-4168 | crab/scripts/check-architecture-gates.py:4277-4319 | crab/scripts/check-architecture-gates.py:4466-4524 | crab/scripts/check-architecture-gates.py:4528-4588 | crab/scripts/check-architecture-gates.py:4592-4658 | crab/scripts/check-architecture-gates.py:4662-4705 | crab/scripts/check-architecture-gates.py:4709-4755 | crab/scripts/check-architecture-gates.py:4759-4814 | crab/scripts/check-architecture-gates.py:4818-4855 — These 17 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 17 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 17 times.
D4 · Code Duplication· Members sharing a duplicated core (16 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (16 members, 50+ identical tokens) crab/scripts/check-architecture-gates.py:2919— crab/scripts/check-architecture-gates.py:2919-2980 | crab/scripts/check-architecture-gates.py:3114-3169 | crab/scripts/check-architecture-gates.py:3173-3226 | crab/scripts/check-architecture-gates.py:3377-3447 | crab/scripts/check-architecture-gates.py:3610-3659 | crab/scripts/check-architecture-gates.py:3789-3820 | crab/scripts/check-architecture-gates.py:3824-3888 | crab/scripts/check-architecture-gates.py:3892-3979 | crab/scripts/check-architecture-gates.py:3983-4014 | crab/scripts/check-architecture-gates.py:4123-4168 | crab/scripts/check-architecture-gates.py:4277-4319 | crab/scripts/check-architecture-gates.py:4406-4462 | crab/scripts/check-architecture-gates.py:4466-4524 | crab/scripts/check-architecture-gates.py:4528-4588 | crab/scripts/check-architecture-gates.py:4592-4658 | crab/scripts/check-architecture-gates.py:4709-4755 — These 16 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 16 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 16 times.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) crates/crab-sdk/src/local.rs:356— crates/crab-sdk/src/local.rs:356-384 | crates/crab-sdk/src/local/edit.rs:378-428 | crates/crab-sdk/src/local/edit.rs:442-485 | crates/crab-sdk/src/local/edit.rs:504-531 | crates/crab-sdk/src/local/edit.rs:542-662 | crates/crab-sdk/src/local/edit.rs:676-733 | crates/crab-sdk/src/local/edit.rs:747-792 | crates/crab-sdk/src/local/edit.rs:829-862 | crates/crab-sdk/src/local/push.rs:337-586 — These 9 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 9 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 9 times.
D4 · Code Duplication· Edited copy of a member (172 corresponding lines) · ×1
Edited copy of a member (172 corresponding lines) crab/src/core/error.rs:2462— crab/src/core/error.rs:2462-2633 | crab/src/core/error_catalog.rs:1396-1568 — These two members are one piece of code written twice and then edited apart: 172 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (197 corresponding lines) · ×1
Edited copy of a member (197 corresponding lines) crab/src/lfs/migrate.rs:1398— crab/src/lfs/migrate.rs:1398-1616 | crab/src/lfs/migrate.rs:2109-2305 — These two members are one piece of code written twice and then edited apart: 197 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (119 corresponding lines) · ×1
Edited copy of a member (119 corresponding lines) crates/crab-staging/src/index.rs:7718— crates/crab-staging/src/index.rs:7718-7836 | crates/crab-staging/src/index.rs:8341-8506 — These two members are one piece of code written twice and then edited apart: 119 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (113 corresponding lines) · ×1
Edited copy of a member (113 corresponding lines) crab/src/cmd/gc/mod.rs:1689— crab/src/cmd/gc/mod.rs:1689-1801 | crab/src/cmd/gc/mod.rs:2240-2394 — These two members are one piece of code written twice and then edited apart: 113 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (86 corresponding lines) · ×1
Edited copy of a member (86 corresponding lines) crab/src/lfs/migrate.rs:1968— crab/src/lfs/migrate.rs:1968-2079 | crab/src/lfs/migrate.rs:2348-2433 — These two members are one piece of code written twice and then edited apart: 86 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (72 corresponding lines) · ×1
Edited copy of a member (72 corresponding lines) crates/crab-coordination/src/write_coordinator.rs:771— crates/crab-coordination/src/write_coordinator.rs:771-843 | crates/crab-coordination/src/write_coordinator.rs:1268-1339 — These two members are one piece of code written twice and then edited apart: 72 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (122 corresponding lines) · ×1
Edited copy of a member (122 corresponding lines) crates/crab-staging/src/index.rs:3394— crates/crab-staging/src/index.rs:3394-3536 | crates/crab-staging/src/index.rs:3748-3869 — These two members are one piece of code written twice and then edited apart: 122 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (82 corresponding lines) · ×1
Edited copy of a member (82 corresponding lines) crates/crab-cache-store/src/lib.rs:401— crates/crab-cache-store/src/lib.rs:401-487 | crates/crab-cache-store/src/lib.rs:494-575 — These two members are one piece of code written twice and then edited apart: 82 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (58 corresponding lines) · ×1
Edited copy of a member (58 corresponding lines) crates/crab-http-server/src/cells/repository/pull_review_threads.rs:417— crates/crab-http-server/src/cells/repository/pull_review_threads.rs:417-498 | crates/crab-http-server/src/cells/repository/pulls.rs:865-922 — These two members are one piece of code written twice and then edited apart: 58 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (67 corresponding lines) · ×1
Edited copy of a member (67 corresponding lines) crab/src/cmd/gc/mod.rs:2601— crab/src/cmd/gc/mod.rs:2601-2671 | crab/src/cmd/gc/mod.rs:2925-2991 — These two members are one piece of code written twice and then edited apart: 67 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 69+ corresponding lines) · ×1
Edited copies of one member (3 members, 69+ corresponding lines) crab/src/cmd/doctor.rs:1314— crab/src/cmd/doctor.rs:1314-1382 | crab/src/cmd/doctor.rs:1389-1462 | crab/src/cmd/doctor.rs:1468-1536 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 69 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 (77 corresponding lines) · ×1
Edited copy of a member (77 corresponding lines) crates/crab-auth/src/crab_auth_client.rs:159— crates/crab-auth/src/crab_auth_client.rs:159-235 | crates/crab-auth/src/crab_auth_client.rs:246-322 — 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 (50 corresponding lines) · ×1
Edited copy of a member (50 corresponding lines) crab/src/cmd/metrics.rs:497— crab/src/cmd/metrics.rs:497-561 | crab/src/cmd/metrics.rs:567-616 — These two members are one piece of code written twice and then edited apart: 50 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (80 corresponding lines) · ×1
Edited copy of a member (80 corresponding lines) crab/src/replication/mod.rs:5989— crab/src/replication/mod.rs:5989-6080 | crab/src/replication/mod.rs:6158-6237 — These two members are one piece of code written twice and then edited apart: 80 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (70 corresponding lines) · ×1
Edited copy of a member (70 corresponding lines) crab/src/replication/mod.rs:1266— crab/src/replication/mod.rs:1266-1339 | crab/src/replication/mod.rs:1481-1550 — These two members are one piece of code written twice and then edited apart: 70 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (54 corresponding lines) · ×1
Edited copy of a member (54 corresponding lines) crates/crab-staging/src/lib.rs:624— crates/crab-staging/src/lib.rs:624-677 | crates/crab-staging/src/lib.rs:738-797 — These two members are one piece of code written twice and then edited apart: 54 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (68 corresponding lines) · ×1
Edited copy of a member (68 corresponding lines) crab/src/cmd/replica.rs:12563— crab/src/cmd/replica.rs:12563-12630 | crab/src/cmd/replica.rs:12916-12985 — These two members are one piece of code written twice and then edited apart: 68 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (46 corresponding lines) · ×1
Edited copy of a member (46 corresponding lines) crab/src/git/incremental_walk.rs:265— crab/src/git/incremental_walk.rs:265-310 | crab/src/git/push.rs:18311-18370 — These two members are one piece of code written twice and then edited apart: 46 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (75 corresponding lines) · ×1
Edited copy of a member (75 corresponding lines) crates/crab-coordination/src/write_coordinator.rs:1970— crates/crab-coordination/src/write_coordinator.rs:1970-2044 | crates/crab-coordination/src/write_coordinator.rs:2051-2128 — These two members are one piece of code written twice and then edited apart: 75 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) crab/src/cmd/metadb.rs:1407— crab/src/cmd/metadb.rs:1407-1462 | crab/src/cmd/metadb.rs:1469-1524 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 35+ corresponding lines) · ×1
Edited copies of one member (6 members, 35+ corresponding lines) crab/src/cmd/workflow_checkpoint.rs:777— crab/src/cmd/workflow_checkpoint.rs:777-811 | crates/crab-workflow/src/artifact.rs:323-365 | crates/crab-workflow/src/checkpoint.rs:103-140 | crates/crab-workflow/src/dvc_inventory.rs:391-427 | crates/crab-workflow/src/external_hash.rs:93-133 | crates/crab-workflow/src/source.rs:60-96 — These 6 members are one piece of code written 6 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 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (49 corresponding lines) · ×1
Edited copy of a member (49 corresponding lines) crab/src/cost/recommendations.rs:148— crab/src/cost/recommendations.rs:148-197 | crab/src/cost/recommendations.rs:200-248 — These two members are one piece of code written twice and then edited apart: 49 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 46+ corresponding lines) · ×1
Edited copies of one member (3 members, 46+ corresponding lines) crab/src/cmd/recover.rs:1938— crab/src/cmd/recover.rs:1938-1991 | crab/src/cmd/recover.rs:2059-2104 | crab/src/cmd/recover.rs:2197-2247 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 46 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, 43+ corresponding lines) · ×1
Edited copies of one member (3 members, 43+ corresponding lines) crab/src/git/push.rs:5729— crab/src/git/push.rs:5729-5772 | crab/src/git/push.rs:6353-6395 | crates/crab-write/src/journal.rs:392-438 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 43 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, 62+ corresponding lines) · ×1
Edited copies of one member (3 members, 62+ corresponding lines) crab/src/storage/head_class.rs:143— crab/src/storage/head_class.rs:143-204 | crab/src/storage/head_class.rs:239-309 | crab/src/storage/head_class.rs:348-420 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 62 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 (60 corresponding lines) · ×1
Edited copy of a member (60 corresponding lines) crates/crab-coordination/src/cosmosdb_coordinator.rs:653— crates/crab-coordination/src/cosmosdb_coordinator.rs:653-712 | crates/crab-coordination/src/spanner_coordinator.rs:955-1014 — These two members are one piece of code written twice and then edited apart: 60 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 29+ corresponding lines) · ×1
Edited copies of one member (3 members, 29+ corresponding lines) crab/src/cmd/exp.rs:4810— crab/src/cmd/exp.rs:4810-4842 | crab/src/cmd/metrics.rs:1534-1564 | crab/src/cmd/metrics.rs:3364-3392 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 29 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, 32+ corresponding lines) · ×1
Edited copies of one member (3 members, 32+ corresponding lines) crab/src/maintenance.rs:63— crab/src/maintenance.rs:63-94 | crates/crab-auth-server/src/receive/workflow.rs:45-80 | crates/crab-workflow/src/store.rs:46-81 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 32 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, 31+ corresponding lines) · ×1
Edited copies of one member (4 members, 31+ corresponding lines) crates/crab-http-server/src/peer/node_log_client.rs:84— crates/crab-http-server/src/peer/node_log_client.rs:84-123 | crates/crab-http-server/src/peer/node_log_client.rs:129-159 | crates/crab-http-server/src/peer/node_log_client.rs:165-201 | crates/crab-http-server/src/peer/node_log_client.rs:256-297 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 23+ corresponding lines) · ×1
Edited copies of one member (4 members, 23+ corresponding lines) crab/scripts/check-architecture-gates.py:4221— crab/scripts/check-architecture-gates.py:4221-4245 | crab/scripts/check-architecture-gates.py:4249-4273 | crab/scripts/check-architecture-gates.py:4323-4347 | crab/scripts/check-architecture-gates.py:4351-4373 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 23 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 20+ corresponding lines) · ×1
Edited copies of one member (3 members, 20+ corresponding lines) crates/crab-sdk/src/client.rs:623— crates/crab-sdk/src/client.rs:623-646 | crates/crab-sdk/src/client.rs:760-784 | crates/crab-sdk/src/client.rs:791-810 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 28+ corresponding lines) · ×1
Edited copies of one member (3 members, 28+ corresponding lines) crates/crab-workflow/src/exp_worktree.rs:1627— crates/crab-workflow/src/exp_worktree.rs:1627-1660 | crates/crab-workflow/src/exp_worktree.rs:1667-1696 | crates/crab-workflow/src/exp_worktree.rs:1698-1725 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 28 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, 27+ corresponding lines) · ×1
Edited copies of one member (4 members, 27+ corresponding lines) crates/crab-workflow/src/exp_worktree.rs:1760— crates/crab-workflow/src/exp_worktree.rs:1760-1787 | crates/crab-workflow/src/exp_worktree.rs:1794-1820 | crates/crab-workflow/src/exp_worktree.rs:1874-1901 | crates/crab-workflow/src/exp_worktree.rs:1908-1934 — 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 (7 members, 17+ corresponding lines) · ×1
Edited copies of one member (7 members, 17+ corresponding lines) crab/src/cmd/add.rs:3444— crab/src/cmd/add.rs:3444-3462 | crab/src/cmd/dehydrate.rs:438-456 | crab/src/cmd/du.rs:221-237 | crab/src/cmd/hydrate.rs:3520-3538 | crab/src/cmd/ls_files.rs:80-96 | crab/src/cmd/reset.rs:475-493 | crab/src/cmd/status.rs:754-775 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 39+ corresponding lines) · ×1
Edited copies of one member (4 members, 39+ corresponding lines) crab/src/replication/mod.rs:7784— crab/src/replication/mod.rs:7784-7826 | crab/src/replication/mod.rs:7833-7871 | crab/src/replication/mod.rs:7908-7950 | crab/src/replication/mod.rs:7957-7995 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 39 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 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) crab/src/speculation/access_db.rs:125— crab/src/speculation/access_db.rs:125-159 | crab/src/speculation/access_db.rs:177-206 | crates/crab-workflow/src/journal.rs:609-640 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 30 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 20+ corresponding lines) · ×1
Edited copies of one member (4 members, 20+ corresponding lines) crates/crab-coordination/src/cosmosdb_coordinator.rs:569— crates/crab-coordination/src/cosmosdb_coordinator.rs:569-588 | crates/crab-coordination/src/dynamodb_coordinator.rs:460-480 | crates/crab-coordination/src/dynamodb_coordinator.rs:838-857 | crates/crab-coordination/src/spanner_coordinator.rs:255-274 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 20 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 21+ corresponding lines) · ×1
Edited copies of one member (7 members, 21+ corresponding lines) crab/scripts/check-architecture-gates.py:4018— crab/scripts/check-architecture-gates.py:4018-4038 | crab/scripts/check-architecture-gates.py:4042-4065 | crab/scripts/check-architecture-gates.py:4069-4092 | crab/scripts/check-architecture-gates.py:4096-4119 | crab/scripts/check-architecture-gates.py:4172-4193 | crab/scripts/check-architecture-gates.py:4197-4217 | crab/scripts/check-architecture-gates.py:4377-4402 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 17+ corresponding lines) · ×1
Edited copies of one member (6 members, 17+ corresponding lines) crates/crab-vfs/src/ipc_client.rs:353— crates/crab-vfs/src/ipc_client.rs:353-375 | crates/crab-vfs/src/ipc_client.rs:421-443 | crates/crab-vfs/src/ipc_client.rs:448-471 | crates/crab-vfs/src/ipc_client.rs:474-490 | crates/crab-vfs/src/ipc_client.rs:493-510 | crates/crab-vfs/src/ipc_client.rs:513-530 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 17 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (6 members, 26+ corresponding lines) · ×1
Edited copies of one member (6 members, 26+ corresponding lines) crab/src/replication/mod.rs:2072— crab/src/replication/mod.rs:2072-2097 | crab/src/replication/mod.rs:2099-2124 | crab/src/replication/mod.rs:7409-7435 | crates/crab-coordination/src/write_coordinator.rs:376-402 | crates/crab-coordination/src/write_coordinator.rs:456-482 | crates/crab-coordination/src/write_coordinator.rs:484-510 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 26 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 12+ corresponding lines) · ×1
Edited copies of one member (5 members, 12+ corresponding lines) crab/src/cmd/run.rs:2317— crab/src/cmd/run.rs:2317-2328 | crab/src/cmd/run.rs:2337-2349 | crab/src/cmd/run.rs:2359-2373 | crab/src/cmd/run.rs:2380-2391 | crab/src/cmd/run.rs:2424-2437 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 15+ corresponding lines) · ×1
Edited copies of one member (7 members, 15+ corresponding lines) crates/crab-vfs/src/engine.rs:1563— crates/crab-vfs/src/engine.rs:1563-1577 | crates/crab-vfs/src/engine.rs:1585-1599 | crates/crab-vfs/src/engine.rs:1602-1616 | crates/crab-vfs/src/engine.rs:1619-1633 | crates/crab-vfs/src/engine.rs:1636-1650 | crates/crab-vfs/src/engine.rs:1692-1710 | crates/crab-vfs/src/engine.rs:1713-1731 — These 7 members are one piece of code written 7 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 18+ corresponding lines) · ×1
Edited copies of one member (4 members, 18+ corresponding lines) crates/crab-remote-git/src/operation.rs:975— crates/crab-remote-git/src/operation.rs:975-1002 | crates/crab-remote-git/src/operation.rs:1008-1033 | crates/crab-remote-git/src/operation.rs:1083-1100 | crates/crab-remote-git/src/operation.rs:1105-1122 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 18 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 16+ corresponding lines) · ×1
Edited copies of one member (4 members, 16+ corresponding lines) crates/crab-coordination/src/cosmosdb_coordinator.rs:590— crates/crab-coordination/src/cosmosdb_coordinator.rs:590-605 | crates/crab-coordination/src/dynamodb_coordinator.rs:814-833 | crates/crab-coordination/src/dynamodb_coordinator.rs:859-874 | crates/crab-coordination/src/spanner_coordinator.rs:276-291 — 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 (5 members, 21+ corresponding lines) · ×1
Edited copies of one member (5 members, 21+ corresponding lines) crates/crab-auth/src/managed/client.rs:226— crates/crab-auth/src/managed/client.rs:226-246 | crates/crab-auth/src/managed/client.rs:255-277 | crates/crab-auth/src/managed/client.rs:332-356 | crates/crab-auth/src/managed/client.rs:366-392 | crates/crab-auth/src/managed/client.rs:685-710 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 21 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 13+ corresponding lines) · ×1
Edited copies of one member (5 members, 13+ corresponding lines) crab/src/cmd/dehydrate.rs:1085— crab/src/cmd/dehydrate.rs:1085-1101 | crab/src/cmd/history_recovery.rs:1081-1093 | crab/src/cmd/migrate.rs:2646-2660 | crab/src/cmd/recover.rs:2945-2957 | crates/crab-staging/src/push_plan.rs:1079-1091 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 13 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (8 members, 10+ corresponding lines) · ×1
Edited copies of one member (8 members, 10+ corresponding lines) crab/src/cmd/push.rs:1094— crab/src/cmd/push.rs:1094-1105 | crab/src/git/push.rs:3294-3304 | crab/src/git/push.rs:3306-3316 | crab/src/storage/retry.rs:407-417 | crates/crab-remote/src/publication.rs:257-268 | crates/crab-storage/src/cas.rs:151-161 | crates/crab-storage/src/retry.rs:171-180 | crates/crab-write/src/journal.rs:373-384 — These 8 members are one piece of code written 8 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 8 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 11+ corresponding lines) · ×1
Edited copies of one member (4 members, 11+ corresponding lines) crab/src/lfs/migrate.rs:342— crab/src/lfs/migrate.rs:342-355 | crab/src/lfs/migrate.rs:357-372 | crab/src/lfs/migrate.rs:1703-1713 | crab/src/lfs/migrate.rs:1812-1826 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 11 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 13+ corresponding lines) · ×1
Edited copies of one member (7 members, 13+ corresponding lines) crab/src/cmd/replica.rs:4388— crab/src/cmd/replica.rs:4388-4400 | crab/src/cmd/replica.rs:4402-4414 | crab/src/cmd/replica.rs:4416-4428 | crab/src/cmd/replica.rs:4430-4445 | crab/src/cmd/replica.rs:4447-4462 | crab/src/cmd/replica.rs:4464-4479 | crab/src/cmd/replica.rs:4481-4493 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 15+ corresponding lines) · ×1
Edited copies of one member (4 members, 15+ corresponding lines) crab/src/cmd/artifacts.rs:667— crab/src/cmd/artifacts.rs:667-683 | crab/src/cmd/migrate.rs:236-250 | crates/crab-workflow/src/artifact.rs:1617-1634 | crates/crab-workflow/src/artifact.rs:1863-1877 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 15 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×1
Edited copies of one member (4 members, 8+ corresponding lines) crates/crab-http-server/src/cells/repository.rs:605— crates/crab-http-server/src/cells/repository.rs:605-619 | crates/crab-http-server/src/cells/repository/pulls.rs:1515-1522 | crates/crab-http-server/src/cells/repository/pulls.rs:1526-1535 | crates/crab-http-server/src/cells/repository/pulls.rs:1561-1570 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 9+ corresponding lines) · ×1
Edited copies of one member (5 members, 9+ corresponding lines) crates/crab-cache/src/xet_chunk_cache.rs:305— crates/crab-cache/src/xet_chunk_cache.rs:305-313 | crates/crab-http-server/src/cells.rs:1252-1260 | crates/crab-http-server/src/cells/router.rs:1340-1348 | crates/crab-http-server/src/peer.rs:1785-1793 | crates/crab-vfs/src/nfs.rs:1863-1871 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 7+ corresponding lines) · ×1
Edited copies of one member (5 members, 7+ corresponding lines) crates/crab-auth/src/token_cache.rs:201— crates/crab-auth/src/token_cache.rs:201-209 | crates/crab-staging/src/lib.rs:435-441 | crates/crab-staging/src/lib.rs:1010-1017 | crates/crab-staging/src/recovery.rs:161-171 | crates/crab-workflow/src/exp_queue.rs:191-198 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (7 members, 10+ corresponding lines) · ×1
Edited copies of one member (7 members, 10+ corresponding lines) crates/crab-http-server/src/pulls/review_thread_storage.rs:88— crates/crab-http-server/src/pulls/review_thread_storage.rs:88-101 | crates/crab-http-server/src/pulls/review_thread_storage.rs:125-141 | crates/crab-http-server/src/pulls/review_thread_storage.rs:225-242 | crates/crab-http-server/src/pulls/storage.rs:176-192 | crates/crab-http-server/src/pulls/storage.rs:347-356 | crates/crab-http-server/src/pulls/storage.rs:452-461 | crates/crab-http-server/src/pulls/storage.rs:469-485 — These 7 members are one piece of code written 7 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 7 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 18+ corresponding lines) · ×1
Edited copies of one member (5 members, 18+ corresponding lines) crates/crab-vfs/src/ipc_server.rs:154— crates/crab-vfs/src/ipc_server.rs:154-171 | crates/crab-vfs/src/ipc_server.rs:174-191 | crates/crab-vfs/src/ipc_server.rs:194-211 | crates/crab-vfs/src/ipc_server.rs:214-231 | crates/crab-vfs/src/ipc_server.rs:234-251 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 10+ corresponding lines) · ×1
Edited copies of one member (5 members, 10+ corresponding lines) crates/crab-workflow/src/template/foreach.rs:261— crates/crab-workflow/src/template/foreach.rs:261-272 | crates/crab-workflow/src/template/foreach.rs:279-289 | crates/crab-workflow/src/template/matrix.rs:279-289 | crates/crab-workflow/src/template/matrix.rs:296-306 | crates/crab-workflow/src/yaml.rs:1003-1012 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 5+ corresponding lines) · ×1
Edited copies of one member (4 members, 5+ corresponding lines) crab/src/cmd/fetch.rs:54— crab/src/cmd/fetch.rs:54-58 | crab/src/cmd/lfs/store_setup.rs:237-242 | crab/src/cmd/optimize.rs:267-271 | crab/src/cmd/workflow.rs:64-69 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 3+ corresponding lines) · ×1
Edited copies of one member (3 members, 3+ corresponding lines) crab/src/cmd/lfs/dedup.rs:1077— crab/src/cmd/lfs/dedup.rs:1077-1079 | crab/src/lfs/discovery.rs:80-82 | crates/crab-git/src/pre_push.rs:95-97 — 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.
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/crab-http-server/src/cells/repository/pull_review_threads_codec.rs:14— crates/crab-http-server/src/cells/repository/pull_review_threads_codec.rs:14-18 | crates/crab-http-server/src/cells/repository/pulls_codec.rs:15-19 | crates/crab-http-server/src/cells/repository/releases_codec.rs:14-18 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 5 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) crab/deploy/auth-service/src/receive_helper.py:376— crab/deploy/auth-service/src/receive_helper.py:376-379 | crab/deploy/auth-service/src/view_helper.py:156-159 | crab/scripts/verify-provider-qualification-report.py:38-41 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 4 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 (59 lines × 2) crates/crab-coordination/src/write_coordinator.rs:774— crates/crab-coordination/src/write_coordinator.rs:774-832 | crates/crab-coordination/src/write_coordinator.rs:1272-1330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-coordination/src/write_coordinator.rs:774` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (43–47 lines × 2) crates/crab-staging/src/lib.rs:2323— crates/crab-staging/src/lib.rs:2323-2369 | crates/crab-staging/src/lib.rs:3748-3790 — both copies are in the same file, so extract the 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 (39 lines × 2) crates/crab-workflow/src/exp_worktree.rs:1295— crates/crab-workflow/src/exp_worktree.rs:1295-1333 | crates/crab-workflow/src/params.rs:420-458 — before extracting anything, compare `crates/crab-workflow/src/exp_worktree.rs` and `crates/crab-workflow/src/params.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 94 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 (38 lines × 2) crates/crab-remote-git/src/snapshot.rs:312— crates/crab-remote-git/src/snapshot.rs:312-349 | crates/crab-remote-git/src/snapshot.rs:382-419 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-remote-git/src/snapshot.rs:312` 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 (30–37 lines × 2) crab/src/lfs/migrate.rs:1974— crab/src/lfs/migrate.rs:1974-2010 | crab/src/lfs/migrate.rs:2349-2378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/migrate.rs:1974` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (27–36 lines × 2) crates/crab-workflow/src/signals.rs:398— crates/crab-workflow/src/signals.rs:398-433 | crates/crab-workflow/src/signals.rs:509-535 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-workflow/src/signals.rs:398` it does not close everything it opens, so those 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/crab-workflow/src/signals.rs:508` calls `ctrl_c` and `crates/crab-workflow/src/signals.rs:396` 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 (29–35 lines × 2) crab/src/cmd/run.rs:1896— crab/src/cmd/run.rs:1896-1930 | crab/src/cmd/run.rs:1999-2027 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/run.rs:1896` it does not close everything it opens, so those exact lines 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–34 lines × 2) crab/src/lfs/migrate.rs:2041— crab/src/lfs/migrate.rs:2041-2074 | crab/src/lfs/migrate.rs:2403-2432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/migrate.rs:2041` it begins part-way through the construct above it, so those exact lines 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) crab/src/cmd/add.rs:2359— crab/src/cmd/add.rs:2359-2390 | crab/src/cmd/add.rs:2439-2470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:2359` it begins part-way through the construct above it, so those exact lines 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–32 lines × 2) crates/crab-workflow/src/template/foreach.rs:203— crates/crab-workflow/src/template/foreach.rs:203-234 | crates/crab-workflow/src/template/matrix.rs:227-256 — before extracting anything, compare `crates/crab-workflow/src/template/foreach.rs` and `crates/crab-workflow/src/template/matrix.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 106 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 (31 lines × 2) crates/crab-metadata/src/segmented_store.rs:170— crates/crab-metadata/src/segmented_store.rs:170-200 | crates/crab-metadata/src/segmented_store.rs:231-261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-metadata/src/segmented_store.rs:170` it does not close everything it opens, so those exact lines 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) crab/src/cmd/metrics.rs:4091— crab/src/cmd/metrics.rs:4091-4119 | crab/src/cmd/params.rs:748-777 — before extracting anything, compare `crab/src/cmd/metrics.rs` and `crab/src/cmd/params.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 89 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 `crab/src/cmd/metrics.rs:4091` 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 (27–29 lines × 3) crab/src/cmd/adopt.rs:307— crab/src/cmd/adopt.rs:307-333 | crab/src/cmd/init.rs:776-804 | crab/src/cmd/setup.rs:588-616 — before extracting anything, compare `crab/src/cmd/adopt.rs` and `crab/src/cmd/init.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 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 `crab/src/cmd/adopt.rs:307` 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 `new_exts` to `&mut BTreeSet<String>` in one and `&mut std::collections::BTreeSet<String>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (25–28 lines × 2) crab/src/cmd/run.rs:2476— crab/src/cmd/run.rs:2476-2500 | crab/src/cmd/run.rs:3058-3085 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/run.rs:2476` 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 (24–26 lines × 2) crab/src/cmd/gc/mod.rs:908— crab/src/cmd/gc/mod.rs:908-931 | crab/src/cmd/gc/mod.rs:1205-1230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/mod.rs:908` 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 (23–25 lines × 2) crab/src/cmd/run.rs:2286— crab/src/cmd/run.rs:2286-2308 | crab/src/cmd/run.rs:2932-2956 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/run.rs:2286` 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 (25 lines × 2) crab/src/lfs/transfer_agent.rs:401— crab/src/lfs/transfer_agent.rs:401-425 | crab/src/lfs/transfer_agent.rs:482-506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/transfer_agent.rs:401` it begins part-way through the construct above it, so those exact lines 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–25 lines × 2) crates/crab-workflow/src/template/foreach.rs:321— crates/crab-workflow/src/template/foreach.rs:321-345 | crates/crab-workflow/src/template/matrix.rs:310-331 — before extracting anything, compare `crates/crab-workflow/src/template/foreach.rs` and `crates/crab-workflow/src/template/matrix.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 106 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 (22–24 lines × 2) crab/src/cmd/add.rs:1200— crab/src/cmd/add.rs:1200-1223 | crab/src/cmd/add.rs:1235-1256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:1200` it does not close everything it opens, so those exact lines 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–24 lines × 2) crab/src/cmd/gc/mod.rs:2620— crab/src/cmd/gc/mod.rs:2620-2642 | crab/src/cmd/gc/mod.rs:2939-2962 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/gc/mod.rs:2620` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–22 lines × 4) crab/src/cmd/add.rs:3265— crab/src/cmd/add.rs:3265-3286 | crab/src/cmd/dehydrate.rs:513-534 | crab/src/cmd/hydrate.rs:3599-3620 | crab/src/cmd/reset.rs:322-340 — before extracting anything, compare `crab/src/cmd/add.rs` and `crab/src/cmd/dehydrate.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:3265` it begins part-way through the construct above it, so those 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 (20–21 lines × 4) crab/src/cmd/adopt.rs:279— crab/src/cmd/adopt.rs:279-298 | crab/src/cmd/adopt.rs:359-378 | crab/src/cmd/init.rs:747-767 | crab/src/cmd/unadopt.rs:211-230 — before extracting anything, compare `crab/src/cmd/adopt.rs` and `crab/src/cmd/init.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 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 `crab/src/cmd/adopt.rs:279` 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 (20–21 lines × 2) crates/crab-s3-gateway/src/gateway.rs:1379— crates/crab-s3-gateway/src/gateway.rs:1379-1398 | crates/crab-s3-gateway/src/gateway.rs:1484-1504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-s3-gateway/src/gateway.rs:1484` it begins part-way through the construct above it, so those 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 `req` to `S3Request<GetObjectInput>` in one and `S3Request<HeadObjectInput>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15–20 lines × 3) crab/src/cmd/run.rs:3465— crab/src/cmd/run.rs:3465-3484 | REDACTED:2327-2341 | REDACTED:2472-2489 — before extracting anything, compare `crab/src/cmd/run.rs` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 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. 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–20 lines × 2) crab/src/git/progress.rs:1673— crab/src/git/progress.rs:1673-1692 | crab/src/git/progress.rs:1722-1738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/progress.rs:1673` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–19 lines × 6) crab/src/cmd/add.rs:3422— crab/src/cmd/add.rs:3422-3438 | crab/src/cmd/dehydrate.rs:461-477 | crab/src/cmd/du.rs:241-256 | crab/src/cmd/hydrate.rs:3544-3560 | crab/src/cmd/reset.rs:498-514 | crab/src/cmd/status.rs:785-803 — before extracting anything, compare `crab/src/cmd/add.rs` and `crab/src/cmd/dehydrate.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 5) crates/crab-workflow/src/artifact.rs:347— crates/crab-workflow/src/artifact.rs:347-365 | crates/crab-workflow/src/checkpoint.rs:122-140 | crates/crab-workflow/src/dvc_inventory.rs:409-427 | crates/crab-workflow/src/external_hash.rs:115-133 | crates/crab-workflow/src/source.rs:78-96 — before extracting anything, compare `crates/crab-workflow/src/artifact.rs` and `crates/crab-workflow/src/checkpoint.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-workflow/src/artifact.rs:347` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–19 lines × 2) crab/src/cmd/gc/mod.rs:890— crab/src/cmd/gc/mod.rs:890-906 | crab/src/cmd/gc/mod.rs:1181-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 (16–19 lines × 2) crab/src/cmd/metadb.rs:2743— crab/src/cmd/metadb.rs:2743-2758 | crates/crab-auth-server/src/receive.rs:1533-1551 — before extracting anything, compare `crab/src/cmd/metadb.rs` and `crates/crab-auth-server/src/receive.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 `crab/src/cmd/metadb.rs:2743` it does not close everything it opens, so those exact lines 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–17 lines × 2) crab/src/cmd/dehydrate.rs:800— crab/src/cmd/dehydrate.rs:800-811 | crab/src/lfs/status.rs:420-436 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14–17 lines × 2) crab/src/lfs/migrate.rs:1574— crab/src/lfs/migrate.rs:1574-1587 | crab/src/lfs/migrate.rs:2251-2267 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/migrate.rs:2251` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–17 lines × 2) crates/crab-sdk/src/local.rs:538— crates/crab-sdk/src/local.rs:538-554 | crates/crab-sdk/src/local.rs:692-706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-sdk/src/local.rs:538` it begins part-way through the construct above it, so those 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/crab-sdk/src/local.rs:691` calls `verify_repository`, `exists` and `crates/crab-sdk/src/local.rs:538` 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–16 lines × 3) crab/src/cmd/run.rs:3506— crab/src/cmd/run.rs:3506-3521 | REDACTED:2377-2386 | REDACTED:2556-2565 — before extracting anything, compare `crab/src/cmd/run.rs` and `REDACTED` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 3) crates/crab-s3-gateway/src/gateway.rs:3320— crates/crab-s3-gateway/src/gateway.rs:3320-3335 | crates/crab-s3-gateway/src/gateway.rs:4053-4068 | crates/crab-s3-gateway/src/gateway.rs:4094-4109 — 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 first that the copies are not typed on the same thing: the declarations holding them bind `input` to `&PutObjectInput` in one and `&CopyObjectInput` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/crab-s3-gateway/src/gateway.rs:3336` calls `is_some` and `crates/crab-s3-gateway/src/gateway.rs:4069` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (15–16 lines × 2) crab/src/cmd/replica.rs:2941— crab/src/cmd/replica.rs:2941-2955 | crab/src/replication/mod.rs:7601-7616 — before extracting anything, compare `crab/src/cmd/replica.rs` and `crab/src/replication/mod.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 47 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 `crab/src/cmd/replica.rs:2941` it begins part-way through the construct above it, so those exact lines 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–16 lines × 2) crates/crab-workflow/src/params.rs:877— crates/crab-workflow/src/params.rs:877-892 | crates/crab-workflow/src/params.rs:935-945 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-workflow/src/params.rs:877` 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 `value` to `&serde_yaml::Value` in one and `&serde_json::Value` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (16 lines × 5) crab/src/cmd/add.rs:3149— crab/src/cmd/add.rs:3149-3164 | crab/src/cmd/add.rs:3243-3258 | crab/src/cmd/dehydrate.rs:491-506 | crab/src/cmd/hydrate.rs:3577-3592 | crab/src/cmd/status.rs:816-831 — before extracting anything, compare `crab/src/cmd/add.rs` and `crab/src/cmd/dehydrate.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:3149` it does not close everything it opens, so those 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, `crab/src/cmd/dehydrate.rs:489` calls `check_cancelled` and `crab/src/cmd/status.rs:815` 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–15 lines × 3) crab/src/cmd/add.rs:1127— crab/src/cmd/add.rs:1127-1139 | crab/src/cmd/add.rs:1201-1215 | crab/src/cmd/add.rs:1236-1248 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–15 lines × 2) crab/src/cmd/exp.rs:6268— crab/src/cmd/exp.rs:6268-6282 | crab/src/cmd/metrics.rs:4167-4177 — before extracting anything, compare `crab/src/cmd/exp.rs` and `crab/src/cmd/metrics.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/metrics.rs:4167` 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–15 lines × 2) crab/src/cmd/lfs/fsck.rs:364— crab/src/cmd/lfs/fsck.rs:364-378 | crab/src/lfs/migrate.rs:2800-2811 — before extracting anything, compare `crab/src/cmd/lfs/fsck.rs` and `crab/src/lfs/migrate.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/lfs/fsck.rs:364` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–27 lines × 2) crates/crab-workflow/src/signals.rs:471— crates/crab-workflow/src/signals.rs:471-497 | crates/crab-workflow/src/signals.rs:566-588 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/crab-workflow/src/signals.rs:471` 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–14 lines × 8) crab/src/cmd/add.rs:3156— crab/src/cmd/add.rs:3156-3169 | crab/src/cmd/add.rs:3250-3263 | crab/src/cmd/dehydrate.rs:498-511 | crab/src/cmd/hydrate.rs:3584-3597 | crab/src/cmd/ls_files.rs:109-122 | crab/src/cmd/reset.rs:308-320 | crab/src/cmd/status.rs:393-405 | crab/src/cmd/status.rs:823-836 — before extracting anything, compare `crab/src/cmd/add.rs` and `crab/src/cmd/dehydrate.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:3156` it begins part-way through the construct above it, so those 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 × 5) crab/src/cmd/add.rs:3265— crab/src/cmd/add.rs:3265-3279 | crab/src/cmd/dehydrate.rs:513-527 | crab/src/cmd/hydrate.rs:3599-3613 | crab/src/cmd/reset.rs:322-335 | crab/src/cmd/status.rs:407-420 — before extracting anything, compare `crab/src/cmd/add.rs` and `crab/src/cmd/dehydrate.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:3265` it begins part-way through the construct above it, so those 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–14 lines × 3) crab/src/cmd/run.rs:843— crab/src/cmd/run.rs:843-855 | crab/src/cmd/run.rs:2272-2285 | crab/src/cmd/run.rs:2911-2923 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12–14 lines × 2) crab/src/cmd/lfs/dedup.rs:782— crab/src/cmd/lfs/dedup.rs:782-793 | crab/src/cmd/lfs/dedup.rs:794-807 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/lfs/dedup.rs:782` it does not close everything it opens, so those 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–14 lines × 2) crab/src/lfs/migrate.rs:969— crab/src/lfs/migrate.rs:969-982 | crab/src/lfs/migrate.rs:1100-1110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/lfs/migrate.rs:969` it does not close everything it opens, so those 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 × 5) crates/crab-staging/src/index.rs:1132— crates/crab-staging/src/index.rs:1132-1143 | crates/crab-staging/src/index.rs:4117-4129 | crates/crab-staging/src/index.rs:4180-4191 | crates/crab-staging/src/index.rs:4583-4594 | crates/crab-staging/src/index.rs:5115-5126 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-staging/src/index.rs:1132` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/crab-staging/src/index.rs:4192` calls `optional` and `crates/crab-staging/src/index.rs:5127` 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 (9–13 lines × 3) crab/src/cmd/lfs/fsck.rs:362— crab/src/cmd/lfs/fsck.rs:362-372 | crab/src/cmd/lfs/ls_files.rs:362-374 | crab/src/lfs/migrate.rs:2798-2806 — before extracting anything, compare `crab/src/cmd/lfs/fsck.rs` and `crab/src/cmd/lfs/ls_files.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/lfs/fsck.rs:362` it does not close everything it opens, so those exact lines 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 × 7) crates/crab-http-server/src/checks.rs:880— crates/crab-http-server/src/checks.rs:880-891 | crates/crab-http-server/src/issues.rs:716-727 | crates/crab-http-server/src/labels.rs:350-361 | crates/crab-http-server/src/pulls/storage.rs:855-866 | crates/crab-http-server/src/releases/storage.rs:454-465 | crates/crab-http-server/src/repository_settings.rs:269-280 | crates/crab-http-server/src/statuses.rs:439-450 — before extracting anything, compare `crates/crab-http-server/src/checks.rs` and `crates/crab-http-server/src/issues.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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–12 lines × 7) crates/crab-vfs/src/publish.rs:1007— crates/crab-vfs/src/publish.rs:1007-1017 | crates/crab-vfs/src/publish.rs:1057-1067 | crates/crab-vfs/src/publish.rs:1244-1255 | crates/crab-vfs/src/publish.rs:1346-1357 | crates/crab-vfs/src/publish.rs:1384-1394 | crates/crab-vfs/src/publish.rs:1597-1608 | crates/crab-vfs/src/publish.rs:1629-1640 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-vfs/src/publish.rs:1007` it begins part-way through the construct above it, so those 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/crab-vfs/src/publish.rs:1360` calls `write_all` and `crates/crab-vfs/src/publish.rs:1020` 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–12 lines × 2) crab/src/cmd/clone.rs:456— crab/src/cmd/clone.rs:456-467 | crab/src/cmd/clone.rs:507-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/clone.rs:456` 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 (8–12 lines × 2) crab/src/cmd/workflow_checkpoint.rs:387— crab/src/cmd/workflow_checkpoint.rs:387-398 | crab/src/cmd/workflow_checkpoint.rs:430-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/workflow_checkpoint.rs:387` 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 (10–11 lines × 9) crab/src/cmd/add.rs:3155— crab/src/cmd/add.rs:3155-3165 | crab/src/cmd/add.rs:3249-3259 | crab/src/cmd/dehydrate.rs:497-507 | crab/src/cmd/du.rs:169-178 | crab/src/cmd/hydrate.rs:3583-3593 | crab/src/cmd/ls_files.rs:108-118 | crab/src/cmd/reset.rs:307-316 | crab/src/cmd/status.rs:392-401 | crab/src/cmd/status.rs:822-832 — before extracting anything, compare `crab/src/cmd/add.rs` and `crab/src/cmd/dehydrate.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:3155` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crab/src/cmd/du.rs:167` calls `Err`, `kind`, `Ok` and `crab/src/cmd/ls_files.rs:106` 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 × 8) crab/src/git/progress.rs:827— crab/src/git/progress.rs:827-837 | crab/src/git/progress.rs:842-852 | crab/src/git/progress.rs:876-886 | crab/src/git/progress.rs:891-901 | crab/src/git/progress.rs:1222-1232 | crab/src/git/progress.rs:1237-1247 | crab/src/git/progress.rs:1271-1281 | crab/src/git/progress.rs:1286-1296 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/progress.rs:827` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 6) crab/src/git/progress.rs:319— crab/src/git/progress.rs:319-329 | crab/src/git/progress.rs:335-345 | crab/src/git/progress.rs:375-385 | crab/src/git/progress.rs:391-401 | crab/src/git/progress.rs:424-434 | crab/src/git/progress.rs:440-450 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/git/progress.rs:319` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 4) crab/src/cmd/lfs/fsck.rs:359— crab/src/cmd/lfs/fsck.rs:359-368 | crab/src/cmd/lfs/fsck.rs:385-394 | crab/src/cmd/lfs/ls_files.rs:359-369 | crab/src/cmd/lfs/ls_files.rs:395-404 — before extracting anything, compare `crab/src/cmd/lfs/fsck.rs` and `crab/src/cmd/lfs/ls_files.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/lfs/fsck.rs:359` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (26 lines × 4) crates/crab-auth/src/aws_oidc.rs:297— crates/crab-auth/src/aws_oidc.rs:297-322 | crates/crab-auth/src/azure_entra.rs:342-367 | crates/crab-auth/src/crab_auth_client.rs:583-608 | crates/crab-auth/src/gcp_federation.rs:335-360 — before extracting anything, compare `crates/crab-auth/src/aws_oidc.rs` and `crates/crab-auth/src/azure_entra.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 88 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 (9–10 lines × 11) crab/src/cmd/cache.rs:260— crab/src/cmd/cache.rs:260-269 | crab/src/cmd/doctor.rs:2526-2535 | crab/src/cmd/du.rs:401-409 | crab/src/cmd/lfs/convert.rs:619-628 | crab/src/cmd/lfs/dedup.rs:1337-1346 | crab/src/cmd/lfs/ls_files.rs:538-547 | crab/src/cmd/ls_files.rs:307-316 | crab/src/cmd/migrate.rs:2981-2990 | crab/src/cmd/mount.rs:4491-4500 | crab/src/lfs/migrate.rs:2900-2909 | crab/src/lfs/prune.rs:998-1007 — before extracting anything, compare `crab/src/cmd/du.rs` and `crab/src/cmd/ls_files.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/cache.rs:260` 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 (3–10 lines × 7) crab/src/cmd/adopt.rs:277— crab/src/cmd/adopt.rs:277-286 | crab/src/cmd/adopt.rs:357-366 | crab/src/cmd/init.rs:745-754 | crab/src/cmd/reset.rs:304-306 | crab/src/cmd/setup.rs:541-550 | crab/src/cmd/status.rs:389-391 | crab/src/cmd/unadopt.rs:209-218 — before extracting anything, compare `crab/src/cmd/adopt.rs` and `crab/src/cmd/init.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 75 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 `crab/src/cmd/adopt.rs:277` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crab/src/cmd/adopt.rs:288` calls `is_dir` and `crab/src/cmd/setup.rs:552` 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–10 lines × 4) crab/src/cmd/lfs/env.rs:96— crab/src/cmd/lfs/env.rs:96-102 | crab/src/cmd/push.rs:1571-1580 | crab/src/cmd/push.rs:1602-1611 | crab/src/git/protected_push.rs:329-338 — 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 `crab/src/cmd/lfs/env.rs:96` 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–9 lines × 4) crab/src/cmd/fsck_store.rs:342— crab/src/cmd/fsck_store.rs:342-348 | crab/src/lfs/lock.rs:290-298 | crab/src/lfs/lock.rs:340-348 | crab/src/metadata/refs.rs:87-93 — 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 `crab/src/cmd/fsck_store.rs:342` it does not close everything it opens, so those 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 (4–9 lines × 4) crab/src/cmd/exp.rs:4258— crab/src/cmd/exp.rs:4258-4266 | crab/src/cmd/exp.rs:4499-4502 | crab/src/cmd/exp.rs:4758-4766 | crab/src/cmd/exp.rs:4851-4859 — 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 `crab/src/cmd/exp.rs:4499` it does not close everything it opens, so those 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, `crab/src/cmd/exp.rs:4267` calls `should_skip_workspace_snapshot_path` and `crab/src/cmd/exp.rs:4860` 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 × 9) crates/crab-sdk/src/local.rs:363— crates/crab-sdk/src/local.rs:363-370 | crates/crab-sdk/src/local/edit.rs:390-397 | crates/crab-sdk/src/local/edit.rs:447-454 | crates/crab-sdk/src/local/edit.rs:510-517 | crates/crab-sdk/src/local/edit.rs:550-557 | crates/crab-sdk/src/local/edit.rs:682-689 | crates/crab-sdk/src/local/edit.rs:753-760 | crates/crab-sdk/src/local/edit.rs:835-842 | crates/crab-sdk/src/local/push.rs:346-353 — there are 9 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 9 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/crab-sdk/src/local.rs:363` it does not close everything it opens, so those 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/crab-sdk/src/local/edit.rs:549` calls `is_trusted` and `crates/crab-sdk/src/local.rs:362` 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–8 lines × 3) crates/crab-staging/src/index.rs:3167— crates/crab-staging/src/index.rs:3167-3171 | crates/crab-staging/src/index.rs:3256-3263 | crates/crab-staging/src/index.rs:6564-6571 — 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/crab-staging/src/index.rs:3167` it begins part-way through the construct above it, so those 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/crab-staging/src/index.rs:3253` calls `push` and `crates/crab-staging/src/index.rs:3165` 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 × 8) crates/crab-staging/src/index.rs:2357— crates/crab-staging/src/index.rs:2357-2363 | crates/crab-staging/src/index.rs:2453-2459 | crates/crab-staging/src/index.rs:2630-2636 | crates/crab-staging/src/index.rs:4021-4027 | crates/crab-staging/src/index.rs:7082-7088 | crates/crab-staging/src/index.rs:7283-7289 | crates/crab-staging/src/index.rs:7358-7364 | crates/crab-staging/src/index.rs:7865-7871 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-staging/src/index.rs:2357` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–7 lines × 9) crab/src/cmd/add.rs:3447— crab/src/cmd/add.rs:3447-3453 | crab/src/cmd/dehydrate.rs:441-447 | crab/src/cmd/du.rs:224-230 | crab/src/cmd/hydrate.rs:3523-3529 | crab/src/cmd/ls_files.rs:83-89 | crab/src/cmd/reset.rs:478-484 | crab/src/cmd/status.rs:757-763 | crab/src/lfs/track.rs:340-343 | crates/crab-workflow/src/hasher.rs:550-552 — before extracting anything, compare `crab/src/cmd/add.rs` and `crab/src/cmd/dehydrate.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:3447` 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crab/src/cmd/add.rs:3447` calls `Ok` and `crates/crab-workflow/src/hasher.rs:550` 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 × 6) crab/src/git/push.rs:18296— crab/src/git/push.rs:18296-18303 | crab/src/read/mod.rs:942-949 | crates/crab-auth-server/src/receive.rs:1177-1184 | crates/crab-cache-server/src/onboarding.rs:1019-1026 | crates/crab-metadata/src/shallow_closure.rs:579-586 | crates/crab-metadata/src/split_commit_graph.rs:1032-1039 — before extracting anything, compare `crab/src/git/push.rs` and `crates/crab-auth-server/src/receive.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (5–6 lines × 2) crab/src/cmd/metrics.rs:3513— crab/src/cmd/metrics.rs:3513-3518 | crab/src/cmd/params.rs:359-363 — before extracting anything, compare `crab/src/cmd/metrics.rs` and `crab/src/cmd/params.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 89 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 `crab/src/cmd/metrics.rs:3513` it begins part-way through the construct above it, so those 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 × 12) crab/src/cmd/add.rs:3453— crab/src/cmd/add.rs:3453-3457 | crab/src/cmd/adopt.rs:210-214 | crab/src/cmd/adopt.rs:671-675 | crab/src/cmd/dehydrate.rs:447-451 | crab/src/cmd/hydrate.rs:3529-3533 | crab/src/cmd/init.rs:683-687 | crab/src/cmd/init.rs:717-721 | crab/src/cmd/reset.rs:484-488 | crab/src/cmd/setup.rs:316-320 | crab/src/cmd/setup.rs:386-390 | crab/src/cmd/setup.rs:441-445 | crab/src/main.rs:2575-2579 — before extracting anything, compare `crab/src/cmd/add.rs` and `crab/src/cmd/dehydrate.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 131 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/add.rs:3453` it begins part-way through the construct above it, so those exact lines 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 × 11) crab/src/cmd/compact.rs:116— crab/src/cmd/compact.rs:116-120 | crab/src/cmd/gc/bucket.rs:283-287 | crab/src/cmd/gc/bucket.rs:320-324 | crab/src/cmd/gc/bucket.rs:2499-2503 | crab/src/cmd/history_recovery.rs:430-434 | crab/src/cmd/history_recovery.rs:456-460 | crab/src/cmd/metadb.rs:2260-2264 | crab/src/cmd/recover.rs:2517-2521 | crates/crab-auth-server/src/receive/workflow.rs:247-251 | crates/crab-workflow/src/artifact.rs:935-939 | crates/crab-workflow/src/cache.rs:765-769 — there are 11 copies across 8 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 11 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/compact.rs:116` 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 (4–5 lines × 6) crab/src/cmd/metadb.rs:1788— crab/src/cmd/metadb.rs:1788-1792 | crab/src/cmd/repack.rs:1347-1352 | crab/src/git/push.rs:18812-18816 | crab/src/optimize/xorbs/reconcile.rs:780-785 | crates/crab-coordination/src/cosmosdb_coordinator.rs:1495-1498 | crates/crab-types/src/time.rs:74-77 — before extracting anything, compare `crab/src/cmd/repack.rs` and `crab/src/git/push.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 36 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. 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 (3–5 lines × 4) crab/src/cmd/exp_queue.rs:904— crab/src/cmd/exp_queue.rs:904-908 | crab/src/cmd/exp_queue.rs:1022-1026 | crab/src/cmd/lfs/convert.rs:516-518 | crab/src/git/pack.rs:1914-1918 — 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 `crab/src/cmd/exp_queue.rs:904` 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 (2–5 lines × 3) crates/crab-staging/src/index.rs:3286— crates/crab-staging/src/index.rs:3286-3290 | crates/crab-staging/src/index.rs:6485-6486 | crates/crab-staging/src/index.rs:6591-6595 — 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/crab-staging/src/index.rs:3286` it does not close everything it opens, so those 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 (4–5 lines × 3) crates/crab-staging/src/index.rs:3292— crates/crab-staging/src/index.rs:3292-3296 | crates/crab-staging/src/index.rs:6597-6601 | crates/crab-staging/src/index.rs:6991-6994 — 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/crab-staging/src/index.rs:3292` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 6) crab/src/cmd/dehydrate.rs:410— crab/src/cmd/dehydrate.rs:410-419 | crab/src/cmd/hydrate.rs:3492-3501 | crab/src/cmd/lfs/checkout.rs:507-516 | crab/src/cmd/reset.rs:447-456 | crab/src/cmd/status.rs:669-684 | crab/src/lfs/status.rs:101-110 — before extracting anything, compare `crab/src/cmd/dehydrate.rs` and `crab/src/cmd/hydrate.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 223 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (42–43 lines × 3) crab/src/cmd/doctor.rs:1317— crab/src/cmd/doctor.rs:1317-1358 | crab/src/cmd/doctor.rs:1396-1438 | crab/src/cmd/doctor.rs:1471-1512 — 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 `crab/src/cmd/doctor.rs:1396` it begins part-way through the construct above it, so those exact lines 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) crates/crab-staging/src/lib.rs:656— crates/crab-staging/src/lib.rs:656-677 | crates/crab-staging/src/lib.rs:776-797 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/crab-staging/src/lib.rs:656` 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–17 lines × 3) crates/crab-staging/src/index.rs:2344— crates/crab-staging/src/index.rs:2344-2360 | crates/crab-staging/src/index.rs:2410-2423 | crates/crab-staging/src/index.rs:2445-2456 — 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/crab-staging/src/index.rs:2344` it does not close everything it opens, so those 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/crab-staging/src/index.rs:2340` calls `keys`, `copied` and `crates/crab-staging/src/index.rs:2407` 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 × 7) crab/src/cmd/replica.rs:4390— crab/src/cmd/replica.rs:4390-4398 | crab/src/cmd/replica.rs:4404-4412 | crab/src/cmd/replica.rs:4418-4426 | crab/src/cmd/replica.rs:4435-4443 | crab/src/cmd/replica.rs:4452-4460 | crab/src/cmd/replica.rs:4469-4477 | crab/src/cmd/replica.rs:4483-4491 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/replica.rs:4390` it begins part-way through the construct above it, so those exact lines 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–6 lines × 3) crab/src/cmd/run.rs:3493— crab/src/cmd/run.rs:3493-3499 | crab/src/cmd/status_workflow.rs:930-935 | crates/crab-workflow/src/stage_runtime.rs:451-455 — before extracting anything, compare `crab/src/cmd/run.rs` and `crab/src/cmd/status_workflow.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 66 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 `crab/src/cmd/run.rs:3493` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (6 lines × 6) crab/src/import/assemble.rs:407— crab/src/import/assemble.rs:407-412 | crab/src/import/assemble.rs:444-449 | crab/src/import/assemble.rs:830-835 | crab/src/import/assemble.rs:846-851 | crab/src/import/assemble.rs:1064-1069 | crab/src/import/assemble.rs:1080-1085 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/import/assemble.rs:407` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crab/src/import/assemble.rs:405` calls `arg` and `crab/src/import/assemble.rs:828` 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 × 5) crab/src/cmd/exp_queue.rs:1378— crab/src/cmd/exp_queue.rs:1378-1383 | crates/crab-workflow/src/exp_worktree.rs:433-438 | crates/crab-workflow/src/exp_worktree.rs:498-503 | crates/crab-workflow/src/exp_worktree.rs:525-530 | crates/crab-workflow/src/params_runtime.rs:347-351 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart. Read the line range as the matched WINDOW rather than a finished unit: at `crab/src/cmd/exp_queue.rs:1378` it begins part-way through the construct above it, so those exact lines 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) crates/crab-http-server/src/checks.rs:870— crates/crab-http-server/src/checks.rs:870-877 | crates/crab-http-server/src/issues.rs:706-713 | crates/crab-http-server/src/labels.rs:340-347 | crates/crab-http-server/src/pulls/storage.rs:844-851 | crates/crab-http-server/src/releases/storage.rs:444-451 | crates/crab-http-server/src/repository_settings.rs:259-266 | crates/crab-http-server/src/statuses.rs:429-436 — before extracting anything, compare `crates/crab-http-server/src/checks.rs` and `crates/crab-http-server/src/issues.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. 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 (52 lines × 2) crab/deploy/auth-service/src/app.py:1070— crab/deploy/auth-service/src/app.py:1070-1121 | crab/deploy/auth-service/src/app.py:1180-1231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/deploy/auth-service/src/app.py:1070` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (33–39 lines × 2) crab/scripts/nfs-evidence-summary.py:2095— crab/scripts/nfs-evidence-summary.py:2095-2133 | crab/scripts/nfs-evidence-summary.py:2147-2179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/nfs-evidence-summary.py:2095` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–35 lines × 3) crab/scripts/nfs-evidence-summary.py:2185— crab/scripts/nfs-evidence-summary.py:2185-2208 | crab/scripts/nfs-evidence-summary.py:2210-2244 | crab/scripts/nfs-evidence-summary.py:2275-2285 — 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 `crab/scripts/nfs-evidence-summary.py:2185` it begins part-way through the construct above it, so those 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 (27–32 lines × 3) crab/scripts/verify-nfs-smoke-report.py:1293— crab/scripts/verify-nfs-smoke-report.py:1293-1324 | crab/scripts/verify-nfs-smoke-report.py:1633-1664 | crab/scripts/verify-nfs-smoke-report.py:1731-1757 — 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, `crab/scripts/verify-nfs-smoke-report.py:1630` calls `get` and `crab/scripts/verify-nfs-smoke-report.py:1290` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (28–29 lines × 2) crab/scripts/verify-nfs-smoke-report.py:4499— crab/scripts/verify-nfs-smoke-report.py:4499-4527 | crab/scripts/verify-nfs-smoke-report.py:4609-4636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-nfs-smoke-report.py:4609` it begins part-way through the construct above it, so those 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 (29 lines × 2) crab/scripts/verify-cache-service-smoke-report.py:1071— crab/scripts/verify-cache-service-smoke-report.py:1071-1099 | crab/scripts/verify-cache-service-smoke-report.py:1102-1130 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-cache-service-smoke-report.py:1071` it begins part-way through the construct above it, so those exact lines 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–23 lines × 2) crab/scripts/verify-cache-service-smoke-report.py:596— crab/scripts/verify-cache-service-smoke-report.py:596-618 | crab/scripts/verify-cache-service-smoke-report.py:633-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-cache-service-smoke-report.py:633` it begins part-way through the construct above it, so those 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, `crab/scripts/verify-cache-service-smoke-report.py:647` calls `verify_transparent_mutable_auth_controls` and `crab/scripts/verify-cache-service-smoke-report.py:620` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21 lines × 10) crab/scripts/verify-nfs-smoke-report.py:3314— crab/scripts/verify-nfs-smoke-report.py:3314-3334 | crab/scripts/verify-nfs-smoke-report.py:3380-3400 | crab/scripts/verify-nfs-smoke-report.py:3404-3424 | crab/scripts/verify-nfs-smoke-report.py:3428-3448 | crab/scripts/verify-nfs-smoke-report.py:3732-3752 | crab/scripts/verify-nfs-smoke-report.py:3774-3794 | crab/scripts/verify-nfs-smoke-report.py:3798-3818 | crab/scripts/verify-nfs-smoke-report.py:3858-3878 | crab/scripts/verify-nfs-smoke-report.py:4045-4065 | crab/scripts/verify-nfs-smoke-report.py:4071-4091 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crab/scripts/verify-nfs-smoke-report.py:3753` calls `Path` and `crab/scripts/verify-nfs-smoke-report.py:4066` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20 lines × 6) crab/scripts/verify-nfs-smoke-report.py:413— crab/scripts/verify-nfs-smoke-report.py:413-432 | crab/scripts/verify-nfs-smoke-report.py:965-984 | crab/scripts/verify-nfs-smoke-report.py:1270-1289 | crab/scripts/verify-nfs-smoke-report.py:1608-1627 | crab/scripts/verify-nfs-smoke-report.py:1704-1723 | crab/scripts/verify-nfs-smoke-report.py:1871-1890 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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, `crab/scripts/verify-nfs-smoke-report.py:1290` calls `check_retained_control_endpoints_redacted` and `crab/scripts/verify-nfs-smoke-report.py:434` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16–19 lines × 5) crab/scripts/verify-nfs-smoke-report.py:3748— crab/scripts/verify-nfs-smoke-report.py:3748-3764 | crab/scripts/verify-nfs-smoke-report.py:3767-3784 | crab/scripts/verify-nfs-smoke-report.py:3790-3808 | crab/scripts/verify-nfs-smoke-report.py:3833-3848 | crab/scripts/verify-nfs-smoke-report.py:3851-3868 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-nfs-smoke-report.py:3748` it begins part-way through the construct above it, so those 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 (19 lines × 3) crab/scripts/verify-cache-service-smoke-report.py:690— crab/scripts/verify-cache-service-smoke-report.py:690-708 | crab/scripts/verify-cache-service-smoke-report.py:717-735 | crab/scripts/verify-cache-service-smoke-report.py:744-762 — 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 `crab/scripts/verify-cache-service-smoke-report.py:690` it begins part-way through the construct above it, so those 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, `crab/scripts/verify-cache-service-smoke-report.py:764` calls `verify_capabilities` and `crab/scripts/verify-cache-service-smoke-report.py:710` 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 (18 lines × 6) crab/scripts/verify-nfs-smoke-report.py:3338— crab/scripts/verify-nfs-smoke-report.py:3338-3355 | crab/scripts/verify-nfs-smoke-report.py:3359-3376 | crab/scripts/verify-nfs-smoke-report.py:3470-3487 | crab/scripts/verify-nfs-smoke-report.py:3918-3935 | crab/scripts/verify-nfs-smoke-report.py:3951-3968 | crab/scripts/verify-nfs-smoke-report.py:4022-4039 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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–18 lines × 3) crab/scripts/nfs-evidence-summary.py:1900— crab/scripts/nfs-evidence-summary.py:1900-1917 | crab/scripts/nfs-evidence-summary.py:1936-1953 | crab/scripts/nfs-evidence-summary.py:2010-2014 — 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 `crab/scripts/nfs-evidence-summary.py:1900` it begins part-way through the construct above it, so those 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 (17 lines × 16) crab/scripts/check-architecture-gates.py:2946— crab/scripts/check-architecture-gates.py:2946-2962 | crab/scripts/check-architecture-gates.py:3141-3157 | crab/scripts/check-architecture-gates.py:3192-3208 | crab/scripts/check-architecture-gates.py:3418-3434 | crab/scripts/check-architecture-gates.py:3631-3647 | crab/scripts/check-architecture-gates.py:3792-3808 | crab/scripts/check-architecture-gates.py:3860-3876 | crab/scripts/check-architecture-gates.py:3921-3937 | crab/scripts/check-architecture-gates.py:3986-4002 | crab/scripts/check-architecture-gates.py:4140-4156 | crab/scripts/check-architecture-gates.py:4291-4307 | crab/scripts/check-architecture-gates.py:4425-4441 | crab/scripts/check-architecture-gates.py:4496-4512 | crab/scripts/check-architecture-gates.py:4555-4571 | crab/scripts/check-architecture-gates.py:4630-4646 | crab/scripts/check-architecture-gates.py:4727-4743 — all 16 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crab/scripts/check-architecture-gates.py:3210` calls `strip`, `get`, `rel` and `crab/scripts/check-architecture-gates.py:2964` 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 × 10) crab/scripts/verify-nfs-smoke-report.py:3287— crab/scripts/verify-nfs-smoke-report.py:3287-3302 | crab/scripts/verify-nfs-smoke-report.py:3330-3346 | crab/scripts/verify-nfs-smoke-report.py:3351-3367 | crab/scripts/verify-nfs-smoke-report.py:3372-3388 | crab/scripts/verify-nfs-smoke-report.py:3396-3412 | crab/scripts/verify-nfs-smoke-report.py:3420-3436 | crab/scripts/verify-nfs-smoke-report.py:3444-3460 | crab/scripts/verify-nfs-smoke-report.py:3638-3653 | crab/scripts/verify-nfs-smoke-report.py:3671-3686 | crab/scripts/verify-nfs-smoke-report.py:3689-3704 — all 10 copies are in the same file, so extract the block into one function there and call 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 `crab/scripts/verify-nfs-smoke-report.py:3330` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 5) crab/scripts/verify-nfs-smoke-report.py:4261— crab/scripts/verify-nfs-smoke-report.py:4261-4277 | crab/scripts/verify-nfs-smoke-report.py:4291-4307 | crab/scripts/verify-nfs-smoke-report.py:4316-4332 | crab/scripts/verify-nfs-smoke-report.py:4341-4357 | crab/scripts/verify-nfs-smoke-report.py:4366-4382 — 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 (13–16 lines × 3) crab/scripts/verify-cache-service-smoke-report.py:921— crab/scripts/verify-cache-service-smoke-report.py:921-933 | crab/scripts/verify-cache-service-smoke-report.py:991-1006 | crab/scripts/verify-cache-service-smoke-report.py:1008-1020 — 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 `crab/scripts/verify-cache-service-smoke-report.py:921` it begins part-way through the construct above it, so those exact lines 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 × 4) crab/scripts/verify-nfs-smoke-report.py:4507— crab/scripts/verify-nfs-smoke-report.py:4507-4519 | crab/scripts/verify-nfs-smoke-report.py:4537-4551 | crab/scripts/verify-nfs-smoke-report.py:4570-4584 | crab/scripts/verify-nfs-smoke-report.py:4603-4615 — 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 `crab/scripts/verify-nfs-smoke-report.py:4537` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 24) crab/scripts/verify-nfs-smoke-report.py:3277— crab/scripts/verify-nfs-smoke-report.py:3277-3290 | crab/scripts/verify-nfs-smoke-report.py:3295-3308 | crab/scripts/verify-nfs-smoke-report.py:3453-3466 | crab/scripts/verify-nfs-smoke-report.py:3519-3532 | crab/scripts/verify-nfs-smoke-report.py:3547-3560 | crab/scripts/verify-nfs-smoke-report.py:3570-3583 | crab/scripts/verify-nfs-smoke-report.py:3591-3604 | crab/scripts/verify-nfs-smoke-report.py:3609-3622 | crab/scripts/verify-nfs-smoke-report.py:3628-3641 | crab/scripts/verify-nfs-smoke-report.py:3646-3659 | crab/scripts/verify-nfs-smoke-report.py:3661-3674 | crab/scripts/verify-nfs-smoke-report.py:3679-3692 | crab/scripts/verify-nfs-smoke-report.py:3697-3710 | crab/scripts/verify-nfs-smoke-report.py:3715-3728 | crab/scripts/verify-nfs-smoke-report.py:3757-3770 | crab/scripts/verify-nfs-smoke-report.py:3823-3836 | crab/scripts/verify-nfs-smoke-report.py:3841-3854 | crab/scripts/verify-nfs-smoke-report.py:3883-3896 | crab/scripts/verify-nfs-smoke-report.py:3901-3914 | crab/scripts/verify-nfs-smoke-report.py:3972-3985 | crab/scripts/verify-nfs-smoke-report.py:3989-4002 | crab/scripts/verify-nfs-smoke-report.py:4006-4019 | crab/scripts/verify-nfs-smoke-report.py:4095-4108 | crab/scripts/verify-nfs-smoke-report.py:4112-4125 — all 24 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crab/scripts/verify-nfs-smoke-report.py:3291` calls `Path` and `crab/scripts/verify-nfs-smoke-report.py:3986` 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 × 6) crab/scripts/verify-nfs-smoke-report.py:4267— crab/scripts/verify-nfs-smoke-report.py:4267-4280 | crab/scripts/verify-nfs-smoke-report.py:4297-4310 | crab/scripts/verify-nfs-smoke-report.py:4322-4335 | crab/scripts/verify-nfs-smoke-report.py:4347-4360 | crab/scripts/verify-nfs-smoke-report.py:4372-4385 | crab/scripts/verify-nfs-smoke-report.py:4407-4420 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-nfs-smoke-report.py:4267` it begins part-way through the construct above it, so those 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–14 lines × 4) crab/scripts/verify-nfs-smoke-report.py:4476— crab/scripts/verify-nfs-smoke-report.py:4476-4489 | crab/scripts/verify-nfs-smoke-report.py:4536-4548 | crab/scripts/verify-nfs-smoke-report.py:4569-4581 | crab/scripts/verify-nfs-smoke-report.py:4602-4614 — 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 `crab/scripts/verify-nfs-smoke-report.py:4476` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–13 lines × 11) crab/scripts/verify-nfs-smoke-report.py:3292— crab/scripts/verify-nfs-smoke-report.py:3292-3302 | crab/scripts/verify-nfs-smoke-report.py:3336-3346 | crab/scripts/verify-nfs-smoke-report.py:3357-3367 | crab/scripts/verify-nfs-smoke-report.py:3378-3390 | crab/scripts/verify-nfs-smoke-report.py:3402-3414 | crab/scripts/verify-nfs-smoke-report.py:3426-3438 | crab/scripts/verify-nfs-smoke-report.py:3450-3460 | crab/scripts/verify-nfs-smoke-report.py:3643-3653 | crab/scripts/verify-nfs-smoke-report.py:3676-3686 | crab/scripts/verify-nfs-smoke-report.py:3694-3704 | crab/scripts/verify-nfs-smoke-report.py:3986-3996 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-nfs-smoke-report.py:3378` it does not close everything it opens, so those 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, `crab/scripts/verify-nfs-smoke-report.py:3291` calls `Path` and `crab/scripts/verify-nfs-smoke-report.py:3985` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–13 lines × 2) crab/scripts/verify-cache-service-smoke-report.py:631— crab/scripts/verify-cache-service-smoke-report.py:631-638 | crab/scripts/verify-cache-service-smoke-report.py:678-690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-cache-service-smoke-report.py:678` it begins part-way through the construct above it, so those 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 × 6) crab/scripts/verify-nfs-smoke-report.py:4463— crab/scripts/verify-nfs-smoke-report.py:4463-4473 | crab/scripts/verify-nfs-smoke-report.py:4494-4505 | crab/scripts/verify-nfs-smoke-report.py:4521-4531 | crab/scripts/verify-nfs-smoke-report.py:4553-4564 | crab/scripts/verify-nfs-smoke-report.py:4586-4597 | crab/scripts/verify-nfs-smoke-report.py:4617-4627 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-nfs-smoke-report.py:4494` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 3) crab/deploy/auth-service/src/app.py:884— crab/deploy/auth-service/src/app.py:884-895 | crab/deploy/auth-service/src/app.py:897-908 | crab/deploy/auth-service/src/app.py:910-920 — 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 `crab/deploy/auth-service/src/app.py:910` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10–11 lines × 17) crab/scripts/check-architecture-gates.py:2970— crab/scripts/check-architecture-gates.py:2970-2980 | crab/scripts/check-architecture-gates.py:3160-3169 | crab/scripts/check-architecture-gates.py:3216-3226 | crab/scripts/check-architecture-gates.py:3438-3447 | crab/scripts/check-architecture-gates.py:3650-3659 | crab/scripts/check-architecture-gates.py:3811-3820 | crab/scripts/check-architecture-gates.py:3879-3888 | crab/scripts/check-architecture-gates.py:4005-4014 | crab/scripts/check-architecture-gates.py:4159-4168 | crab/scripts/check-architecture-gates.py:4310-4319 | crab/scripts/check-architecture-gates.py:4515-4524 | crab/scripts/check-architecture-gates.py:4578-4588 | crab/scripts/check-architecture-gates.py:4649-4658 | crab/scripts/check-architecture-gates.py:4695-4705 | crab/scripts/check-architecture-gates.py:4746-4755 | crab/scripts/check-architecture-gates.py:4804-4814 | crab/scripts/check-architecture-gates.py:4845-4855 — all 17 copies are in the same file, so extract the block into one function there and call 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 `crab/scripts/check-architecture-gates.py:2970` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crab/scripts/check-architecture-gates.py:3214` calls `any` and `crab/scripts/check-architecture-gates.py:3160` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 11) crab/scripts/verify-nfs-smoke-report.py:3326— crab/scripts/verify-nfs-smoke-report.py:3326-3336 | crab/scripts/verify-nfs-smoke-report.py:3348-3357 | crab/scripts/verify-nfs-smoke-report.py:3369-3378 | crab/scripts/verify-nfs-smoke-report.py:3392-3402 | crab/scripts/verify-nfs-smoke-report.py:3416-3426 | crab/scripts/verify-nfs-smoke-report.py:3440-3450 | crab/scripts/verify-nfs-smoke-report.py:3744-3754 | crab/scripts/verify-nfs-smoke-report.py:3786-3796 | crab/scripts/verify-nfs-smoke-report.py:3810-3820 | crab/scripts/verify-nfs-smoke-report.py:3870-3880 | crab/scripts/verify-nfs-smoke-report.py:3928-3937 — all 11 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-nfs-smoke-report.py:3326` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–11 lines × 7) crab/scripts/verify-cache-service-smoke-report.py:929— crab/scripts/verify-cache-service-smoke-report.py:929-939 | crab/scripts/verify-cache-service-smoke-report.py:1002-1012 | crab/scripts/verify-cache-service-smoke-report.py:1016-1024 | crab/scripts/verify-cache-service-smoke-report.py:1034-1042 | crab/scripts/verify-cache-service-smoke-report.py:1045-1054 | crab/scripts/verify-cache-service-smoke-report.py:1544-1554 | crab/scripts/verify-cache-service-smoke-report.py:1560-1570 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-cache-service-smoke-report.py:929` it begins part-way through the construct above it, so those 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, `crab/scripts/verify-cache-service-smoke-report.py:1043` calls `check`, `int_value`, `get` and `crab/scripts/verify-cache-service-smoke-report.py:929` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 7) crab/scripts/verify-nfs-smoke-report.py:4201— crab/scripts/verify-nfs-smoke-report.py:4201-4211 | crab/scripts/verify-nfs-smoke-report.py:4273-4283 | crab/scripts/verify-nfs-smoke-report.py:4303-4313 | crab/scripts/verify-nfs-smoke-report.py:4328-4338 | crab/scripts/verify-nfs-smoke-report.py:4353-4363 | crab/scripts/verify-nfs-smoke-report.py:4378-4388 | crab/scripts/verify-nfs-smoke-report.py:4413-4423 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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 × 4) crab/scripts/verify-nfs-smoke-report.py:4436— crab/scripts/verify-nfs-smoke-report.py:4436-4446 | crab/scripts/verify-nfs-smoke-report.py:4462-4472 | crab/scripts/verify-nfs-smoke-report.py:4520-4530 | crab/scripts/verify-nfs-smoke-report.py:4616-4626 — 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 (10 lines × 7) crab/scripts/verify-cache-service-smoke-report.py:928— crab/scripts/verify-cache-service-smoke-report.py:928-937 | crab/scripts/verify-cache-service-smoke-report.py:1001-1010 | crab/scripts/verify-cache-service-smoke-report.py:1015-1024 | crab/scripts/verify-cache-service-smoke-report.py:1033-1042 | crab/scripts/verify-cache-service-smoke-report.py:1543-1552 | crab/scripts/verify-cache-service-smoke-report.py:1559-1568 | crab/scripts/verify-cache-service-smoke-report.py:1572-1581 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-cache-service-smoke-report.py:928` it begins part-way through the construct above it, so those 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, `crab/scripts/verify-cache-service-smoke-report.py:1025` calls `check`, `int_value`, `get` and `crab/scripts/verify-cache-service-smoke-report.py:938` 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 (2–10 lines × 6) crab/scripts/verify-cache-service-smoke-report.py:858— crab/scripts/verify-cache-service-smoke-report.py:858-864 | crab/scripts/verify-cache-service-smoke-report.py:865-867 | crab/scripts/verify-cache-service-smoke-report.py:904-905 | crab/scripts/verify-cache-service-smoke-report.py:990-999 | crab/scripts/verify-cache-service-smoke-report.py:1525-1526 | crab/scripts/verify-cache-service-smoke-report.py:1527-1529 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-cache-service-smoke-report.py:865` it does not close everything it opens, so those 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, `crab/scripts/verify-cache-service-smoke-report.py:865` calls `check`, `int_value`, `get` and `crab/scripts/verify-cache-service-smoke-report.py:867` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6–9 lines × 8) crab/scripts/verify-cache-service-smoke-report.py:919— crab/scripts/verify-cache-service-smoke-report.py:919-926 | crab/scripts/verify-cache-service-smoke-report.py:932-940 | crab/scripts/verify-cache-service-smoke-report.py:1005-1013 | crab/scripts/verify-cache-service-smoke-report.py:1019-1024 | crab/scripts/verify-cache-service-smoke-report.py:1037-1042 | crab/scripts/verify-cache-service-smoke-report.py:1534-1539 | crab/scripts/verify-cache-service-smoke-report.py:1547-1555 | crab/scripts/verify-cache-service-smoke-report.py:1563-1570 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crab/scripts/verify-cache-service-smoke-report.py:919` it begins part-way through the construct above it, so those 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, `crab/scripts/verify-cache-service-smoke-report.py:1556` calls `int_value` and `crab/scripts/verify-cache-service-smoke-report.py:927` 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 × 6) crab/scripts/check-architecture-gates.py:3177— crab/scripts/check-architecture-gates.py:3177-3183 | crab/scripts/check-architecture-gates.py:3614-3620 | crab/scripts/check-architecture-gates.py:4410-4416 | crab/scripts/check-architecture-gates.py:4470-4476 | crab/scripts/check-architecture-gates.py:4532-4538 | crab/scripts/check-architecture-gates.py:4596-4602 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 11) crates/crab-http-server/src/auth_tests/assignees.rs:20— crates/crab-http-server/src/auth_tests/assignees.rs:20-28 | crates/crab-http-server/src/auth_tests/branches.rs:15-23 | crates/crab-http-server/src/auth_tests/branches.rs:32-40 | crates/crab-http-server/src/auth_tests/branches.rs:54-62 | crates/crab-http-server/src/auth_tests/branches.rs:76-84 | crates/crab-http-server/src/auth_tests/branches.rs:93-101 | crates/crab-http-server/src/auth_tests/pulls.rs:19-27 | crates/crab-http-server/src/auth_tests/pulls.rs:37-45 | crates/crab-http-server/src/auth_tests/pulls.rs:58-66 | crates/crab-http-server/src/auth_tests/releases.rs:17-25 | crates/crab-http-server/src/auth_tests/releases.rs:40-48 — there are 11 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 11 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/crab-http-server/src/auth_tests/assignees.rs:20` it begins part-way through the construct above it, so those exact lines 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–19 lines × 2) crab/deploy/auth-service/scripts/e2e-path-acl-local.py:169— crab/deploy/auth-service/scripts/e2e-path-acl-local.py:169-187 | crab/deploy/auth-service/scripts/e2e-path-acl-rustfs.py:229-243 — 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 `crab/deploy/auth-service/scripts/e2e-path-acl-local.py:169` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Coverage not measured — JavaScript/TypeScript suite — Coverage NOT MEASURED: the JavaScript/TypeScript half could not be measured — packages/ui/ runs vitest but declares no coverage provider, so the suite can run and still produce no lcov — add `@vitest/coverage-v8` (or `@vitest/coverage-istanbul`) as a devDependency. Coverage is excluded from the score rather than counted as a near-zero. The named suite step is one the repository's maintainers can perform; once it passes, the real number is measured on the next scan.
Duplication concentrated across 7 sibling directories (14 clone groups) packages/web/app/auth/page.tsx:277— 14 duplicated blocks under packages/web/app/ have copies in at least two of the sibling directories auth, blog, cache, cli, library, pricing (+1 more sibling(s) not listed) — 8 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 14 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 14 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 14 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 2 sibling directories (13 clone groups) packages/web/app/blog/[slug]/page.tsx:218— 13 duplicated blocks under packages/web/ have copies in at least two of the sibling directories app, components — 2 of them are reported below, and 11 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 13 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 13 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 13 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 4 sibling directories (6 clone groups) packages/web/components/blog/lfs-compatibility-visuals.tsx:188— 6 duplicated blocks under packages/web/components/ have copies in at least two of the sibling directories blog, library, marketing, navigation — 0 of them are reported below, and 6 are counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 6 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 6 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 6 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
R10 · Code Duplication· Duplicated block with local edits (282 matched lines × 2 locations) · ×1
Duplicated block with local edits (282 matched lines × 2 locations) packages/ui/src/issues.tsx:41— packages/ui/src/issues.tsx:41 · packages/ui/src/pulls.tsx:212 — the two spans are one implementation copied and then locally edited — 1542 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (54 matched lines × 2 locations) · ×1
Duplicated block with local edits (54 matched lines × 2 locations) packages/web/app/auth/page.tsx:277— packages/web/app/auth/page.tsx:277 · packages/web/app/remote-services/page.tsx:110 — the two spans are one implementation copied and then locally edited — 234 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (51 matched lines × 2 locations) · ×1
Duplicated block with local edits (51 matched lines × 2 locations) packages/ui/src/discussion-labels.tsx:115— packages/ui/src/discussion-labels.tsx:115 · packages/ui/src/discussion-metadata.tsx:101 — the two spans are one implementation copied and then locally edited — 272 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (44 matched lines × 2 locations) · ×1
Duplicated block with local edits (44 matched lines × 2 locations) packages/ui/src/issues.tsx:386— packages/ui/src/issues.tsx:386 · packages/ui/src/issues.tsx:709 — the two spans are one implementation copied and then locally edited — 264 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (42 matched lines × 2 locations) · ×1
Duplicated block with local edits (42 matched lines × 2 locations) packages/ui/src/refs.tsx:124— packages/ui/src/refs.tsx:124 · packages/ui/src/releases.tsx:225 — the two spans are one implementation copied and then locally edited — 157 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
R10 · Code Duplication· Duplicated block with local edits (38 matched lines × 2 locations) · ×1
Duplicated block with local edits (38 matched lines × 2 locations) packages/web/app/blog/[slug]/page.tsx:26— packages/web/app/blog/[slug]/page.tsx:26 · packages/web/app/library/[slug]/page.tsx:58 — the two spans are one implementation copied and then locally edited — 223 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (32 lines × 2 locations) packages/web/components/blog/push-pipeline-visuals.tsx:540— packages/web/components/blog/push-pipeline-visuals.tsx:540 · packages/web/components/blog/push-pipeline-visuals.tsx:584 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31 lines × 2 locations) packages/ui/src/pulls.tsx:1224— packages/ui/src/pulls.tsx:1224 · packages/ui/src/pulls.tsx:1521 — all 2 copies are in the same file, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (31 lines × 3 locations) packages/web/app/diagrams/cost-breakdown-svg.tsx:86— packages/web/app/diagrams/cost-breakdown-svg.tsx:86 · packages/web/app/diagrams/cost-breakdown-svg.tsx:127 · packages/web/app/diagrams/cost-breakdown-svg.tsx:169 — 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 (30 lines × 2 locations) packages/web/components/marketing/counter.tsx:35— packages/web/components/marketing/counter.tsx:35 · packages/web/components/marketing/typing-code.tsx:77 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (29 lines × 3 locations) packages/web/app/diagrams/cache-hierarchy-svg.tsx:1— packages/web/app/diagrams/cache-hierarchy-svg.tsx:1 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:1 · packages/web/app/diagrams/cli-push-pipeline-svg.tsx:1 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (25 lines × 2 locations) packages/ui/src/content-editor.tsx:272— packages/ui/src/content-editor.tsx:272 · packages/ui/src/content-editor.tsx:552 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (25 lines × 3 locations) packages/web/app/diagrams/cache-hierarchy-svg.tsx:76— packages/web/app/diagrams/cache-hierarchy-svg.tsx:76 · packages/web/app/diagrams/cache-hierarchy-svg.tsx:158 · packages/web/app/diagrams/remote-helper-flow-svg.tsx:104 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (23 lines × 2 locations) packages/web/app/diagrams/cache-hierarchy-svg.tsx:191— packages/web/app/diagrams/cache-hierarchy-svg.tsx:191 · packages/web/app/diagrams/cache-hierarchy-svg.tsx:272 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 7 locations) packages/web/app/diagrams/cache-hierarchy-svg.tsx:127— packages/web/app/diagrams/cache-hierarchy-svg.tsx:127 · packages/web/app/diagrams/cache-hierarchy-svg.tsx:209 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:86 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:287 · +3 more site(s) not listed — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (19 lines × 2 locations) packages/ui/src/content-editor.tsx:487— packages/ui/src/content-editor.tsx:487 · packages/ui/src/content-editor.tsx:600 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (16 lines × 6 locations) packages/web/components/ui/alert.tsx:34— packages/web/components/ui/alert.tsx:34 · packages/web/components/ui/card.tsx:33 · packages/web/components/ui/card.tsx:53 · packages/web/components/ui/table.tsx:19 · +2 more site(s) not listed — the 6 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (15 lines × 9 locations) packages/web/app/diagrams/cache-hierarchy-svg.tsx:237— packages/web/app/diagrams/cache-hierarchy-svg.tsx:237 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:60 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:154 · packages/web/app/diagrams/cache-service-architecture-svg.tsx:217 · +5 more site(s) not listed — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Complex function (anonymous) (cyclomatic 60, cognitive 57) packages/ui/src/App.tsx:865— (anonymous) has cyclomatic complexity 60 and cognitive complexity 57; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 50, cognitive 76) packages/ui/tests/browser/repository.e2e.ts:195— (anonymous) has cyclomatic complexity 50 and cognitive complexity 76; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function RepositoryPage (cyclomatic 47, cognitive 41) packages/ui/src/App.tsx:511— RepositoryPage has cyclomatic complexity 47 and cognitive complexity 41; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 35, cognitive 46) packages/ui/tests/browser/pulls.e2e.ts:127— (anonymous) has cyclomatic complexity 35 and cognitive complexity 46; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 35, cognitive 29) packages/ui/src/content.tsx:269— (anonymous) has cyclomatic complexity 35 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function DataWorkbench (cyclomatic 31, cognitive 30) packages/ui/src/data-workbench.tsx:301— DataWorkbench has cyclomatic complexity 31 and cognitive complexity 30; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ReviewThreadCard (cyclomatic 28, cognitive 17) packages/ui/src/pulls.tsx:1139— ReviewThreadCard has cyclomatic complexity 28 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function MergePanel (cyclomatic 25, cognitive 25) packages/ui/src/pulls.tsx:1761— MergePanel has cyclomatic complexity 25 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 22, cognitive 19) packages/ui/src/pulls.tsx:651— (anonymous) has cyclomatic complexity 22 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 21, cognitive 35) packages/ui/tests/browser/releases.e2e.ts:33— (anonymous) has cyclomatic complexity 21 and cognitive complexity 35; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function statementBoundary (cyclomatic 21, cognitive 33) packages/ui/src/data-query.ts:64— statementBoundary has cyclomatic complexity 21 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function HeroSection (cyclomatic 21, cognitive 20) packages/web/components/marketing/hero-section.tsx:107— HeroSection has cyclomatic complexity 21 and cognitive complexity 20; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function pull (cyclomatic 20, cognitive 18) packages/ui/tests/browser/pulls.e2e.ts:57— pull has cyclomatic complexity 20 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 20, cognitive 12) packages/web/components/library/knowledge-check.tsx:95— (anonymous) has cyclomatic complexity 20 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function App (cyclomatic 17, cognitive 16) packages/ui/src/App.tsx:124— App has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function GitImport (cyclomatic 17, cognitive 16) packages/ui/src/git-import.tsx:19— GitImport has cyclomatic complexity 17 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function NewRelease (cyclomatic 17, cognitive 14) packages/ui/src/release-form.tsx:375— NewRelease has cyclomatic complexity 17 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function RefsPage (cyclomatic 16, cognitive 15) packages/ui/src/refs.tsx:171— RefsPage has cyclomatic complexity 16 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function MemberSettings (cyclomatic 16, cognitive 14) packages/ui/src/settings.tsx:148— MemberSettings has cyclomatic complexity 16 and cognitive complexity 14; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function IssueDetail (cyclomatic 16, cognitive 13) packages/ui/src/issues.tsx:304— IssueDetail has cyclomatic complexity 16 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function RevisionPicker (cyclomatic 16, cognitive 12) packages/ui/src/revision-picker.tsx:23— RevisionPicker has cyclomatic complexity 16 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function run (cyclomatic 15, cognitive 17) · ×1
Complex function run (cyclomatic 15, cognitive 17) packages/ui/src/discussion-mutations.tsx:22— run has cyclomatic complexity 15 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function repositoryTarget (cyclomatic 15, cognitive 17) packages/ui/src/repository-markdown.tsx:28— repositoryTarget has cyclomatic complexity 15 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function NewPull (cyclomatic 15, cognitive 10) packages/ui/src/pulls.tsx:462— NewPull has cyclomatic complexity 15 and cognitive complexity 10; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function compareCells (cyclomatic 14, cognitive 17) packages/ui/src/data-explorer.tsx:10— compareCells has cyclomatic complexity 14 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function codeSymbolLanguage (cyclomatic 14, cognitive 13) packages/ui/src/code-symbols.ts:35— codeSymbolLanguage has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 14, cognitive 13) packages/ui/src/content.tsx:974— (anonymous) has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function DefaultBranchSettings (cyclomatic 14, cognitive 9) packages/ui/src/settings.tsx:587— DefaultBranchSettings has cyclomatic complexity 14 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 13, cognitive 19) packages/ui/tests/browser/labels.e2e.ts:14— (anonymous) has cyclomatic complexity 13 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function clonePath (cyclomatic 13, cognitive 12) packages/ui/src/git-import-source.ts:21— clonePath has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function RefRow (cyclomatic 13, cognitive 12) packages/ui/src/refs.tsx:29— RefRow has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function RepositoryTree (cyclomatic 13, cognitive 12) packages/ui/src/tree.tsx:25— RepositoryTree has cyclomatic complexity 13 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function Releases (cyclomatic 13, cognitive 11) packages/ui/src/releases.tsx:432— Releases has cyclomatic complexity 13 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function replaceSelectedLines (cyclomatic 13, cognitive 9) packages/ui/src/pull-review-model.ts:10— replaceSelectedLines has cyclomatic complexity 13 and cognitive complexity 9; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function containingName (cyclomatic 12, cognitive 33) packages/ui/src/code-symbols.worker.ts:102— containingName has cyclomatic complexity 12 and cognitive complexity 33; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function formatMarkdown (cyclomatic 12, cognitive 12) packages/ui/src/discussion.tsx:108— formatMarkdown has cyclomatic complexity 12 and cognitive complexity 12; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function ArchiveSettings (cyclomatic 12, cognitive 11) packages/ui/src/settings.tsx:776— ArchiveSettings has cyclomatic complexity 12 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 12, cognitive 11) packages/web/app/pricing/page.tsx:372— (anonymous) has cyclomatic complexity 12 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
packages/ui/src/pulls.tsx: 2190 lines of code packages/ui/src/pulls.tsx:1— packages/ui/src/pulls.tsx has 2190 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
packages/ui/src/App.tsx: 1350 lines of code packages/ui/src/App.tsx:1— packages/ui/src/App.tsx has 1350 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/settings.tsx · ×1
packages/ui/src/settings.tsx: 1188 lines of code packages/ui/src/settings.tsx:1— packages/ui/src/settings.tsx has 1188 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/content.tsx · ×1
packages/ui/src/content.tsx: 1066 lines of code packages/ui/src/content.tsx:1— packages/ui/src/content.tsx has 1066 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/push-pipeline-visuals.tsx · ×1
packages/web/components/blog/push-pipeline-visuals.tsx: 847 lines of code packages/web/components/blog/push-pipeline-visuals.tsx:1— packages/web/components/blog/push-pipeline-visuals.tsx has 847 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/library/first-workflow-learning-labs.tsx · ×1
packages/web/components/library/first-workflow-learning-labs.tsx: 810 lines of code packages/web/components/library/first-workflow-learning-labs.tsx:1— packages/web/components/library/first-workflow-learning-labs.tsx has 810 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
packages/ui/src/issues.tsx: 785 lines of code packages/ui/src/issues.tsx:1— packages/ui/src/issues.tsx has 785 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/app/cache/page.tsx · ×1
packages/web/app/cache/page.tsx: 730 lines of code packages/web/app/cache/page.tsx:1— packages/web/app/cache/page.tsx has 730 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/content-editor.tsx · ×1
packages/ui/src/content-editor.tsx: 725 lines of code packages/ui/src/content-editor.tsx:1— packages/ui/src/content-editor.tsx has 725 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/data-workbench.tsx · ×1
packages/ui/src/data-workbench.tsx: 719 lines of code packages/ui/src/data-workbench.tsx:1— packages/ui/src/data-workbench.tsx has 719 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/app/cli/page.tsx · ×1
packages/web/app/cli/page.tsx: 698 lines of code packages/web/app/cli/page.tsx:1— packages/web/app/cli/page.tsx has 698 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/app/auth/page.tsx · ×1
packages/web/app/auth/page.tsx: 691 lines of code packages/web/app/auth/page.tsx:1— packages/web/app/auth/page.tsx has 691 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/blog-diagrams.tsx · ×1
packages/web/components/blog/blog-diagrams.tsx: 661 lines of code packages/web/components/blog/blog-diagrams.tsx:1— packages/web/components/blog/blog-diagrams.tsx has 661 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/app/pricing/page.tsx · ×1
packages/web/app/pricing/page.tsx: 625 lines of code packages/web/app/pricing/page.tsx:1— packages/web/app/pricing/page.tsx has 625 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/app/diagrams/use-case-visuals.tsx · ×1
packages/web/app/diagrams/use-case-visuals.tsx: 622 lines of code packages/web/app/diagrams/use-case-visuals.tsx:1— packages/web/app/diagrams/use-case-visuals.tsx has 622 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/lazy-checkout-visuals.tsx · ×1
packages/web/components/blog/lazy-checkout-visuals.tsx: 613 lines of code packages/web/components/blog/lazy-checkout-visuals.tsx:1— packages/web/components/blog/lazy-checkout-visuals.tsx has 613 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/git-architecture-player.tsx · ×1
packages/web/components/blog/git-architecture-player.tsx: 591 lines of code packages/web/components/blog/git-architecture-player.tsx:1— packages/web/components/blog/git-architecture-player.tsx has 591 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/library/ml-workflow-visuals.tsx · ×1
packages/web/components/library/ml-workflow-visuals.tsx: 590 lines of code packages/web/components/library/ml-workflow-visuals.tsx:1— packages/web/components/library/ml-workflow-visuals.tsx has 590 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/cache-visuals.tsx · ×1
packages/web/components/blog/cache-visuals.tsx: 553 lines of code packages/web/components/blog/cache-visuals.tsx:1— packages/web/components/blog/cache-visuals.tsx has 553 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/file-preview.tsx · ×1
packages/ui/src/file-preview.tsx: 551 lines of code packages/ui/src/file-preview.tsx:1— packages/ui/src/file-preview.tsx has 551 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/consistency-visuals.tsx · ×1
packages/web/components/blog/consistency-visuals.tsx: 548 lines of code packages/web/components/blog/consistency-visuals.tsx:1— packages/web/components/blog/consistency-visuals.tsx has 548 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/release-form.tsx · ×1
packages/ui/src/release-form.tsx: 546 lines of code packages/ui/src/release-form.tsx:1— packages/ui/src/release-form.tsx has 546 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/reconstruction-visuals.tsx · ×1
packages/web/components/blog/reconstruction-visuals.tsx: 543 lines of code packages/web/components/blog/reconstruction-visuals.tsx:1— packages/web/components/blog/reconstruction-visuals.tsx has 543 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/deduplication-visuals.tsx · ×1
packages/web/components/blog/deduplication-visuals.tsx: 533 lines of code packages/web/components/blog/deduplication-visuals.tsx:1— packages/web/components/blog/deduplication-visuals.tsx has 533 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/gc-visuals.tsx · ×1
packages/web/components/blog/gc-visuals.tsx: 531 lines of code packages/web/components/blog/gc-visuals.tsx:1— packages/web/components/blog/gc-visuals.tsx has 531 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/releases.tsx · ×1
packages/ui/src/releases.tsx: 496 lines of code packages/ui/src/releases.tsx:1— packages/ui/src/releases.tsx has 496 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/lfs-compatibility-visuals.tsx · ×1
packages/web/components/blog/lfs-compatibility-visuals.tsx: 491 lines of code packages/web/components/blog/lfs-compatibility-visuals.tsx:1— packages/web/components/blog/lfs-compatibility-visuals.tsx has 491 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/large-file-scale-explorer.tsx · ×1
packages/web/components/blog/large-file-scale-explorer.tsx: 479 lines of code packages/web/components/blog/large-file-scale-explorer.tsx:1— packages/web/components/blog/large-file-scale-explorer.tsx has 479 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/app/use-cases/page.tsx · ×1
packages/web/app/use-cases/page.tsx: 478 lines of code packages/web/app/use-cases/page.tsx:1— packages/web/app/use-cases/page.tsx has 478 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/blog-process-player.tsx · ×1
packages/web/components/blog/blog-process-player.tsx: 475 lines of code packages/web/components/blog/blog-process-player.tsx:1— packages/web/components/blog/blog-process-player.tsx has 475 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/app/library/page.tsx · ×1
packages/web/app/library/page.tsx: 463 lines of code packages/web/app/library/page.tsx:1— packages/web/app/library/page.tsx has 463 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
packages/web/app/page.tsx: 445 lines of code packages/web/app/page.tsx:1— packages/web/app/page.tsx has 445 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/mount-visuals.tsx · ×1
packages/web/components/blog/mount-visuals.tsx: 436 lines of code packages/web/components/blog/mount-visuals.tsx:1— packages/web/components/blog/mount-visuals.tsx has 436 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
packages/ui/src/api.ts: 421 lines of code packages/ui/src/api.ts:1— packages/ui/src/api.ts has 421 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/components/blog/blog-detail-diagrams.tsx · ×1
packages/web/components/blog/blog-detail-diagrams.tsx: 419 lines of code packages/web/components/blog/blog-detail-diagrams.tsx:1— packages/web/components/blog/blog-detail-diagrams.tsx has 419 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/web/app/library/[slug]/page.tsx · ×1
packages/web/app/library/[slug]/page.tsx: 409 lines of code packages/web/app/library/[slug]/page.tsx:1— packages/web/app/library/[slug]/page.tsx has 409 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· packages/ui/src/discussion-labels.tsx · ×1
packages/ui/src/discussion-labels.tsx: 403 lines of code packages/ui/src/discussion-labels.tsx:1— packages/ui/src/discussion-labels.tsx has 403 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
packages/ui/src/tree.tsx: 401 lines of code packages/ui/src/tree.tsx:1— packages/ui/src/tree.tsx has 401 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Dead file (~367 LoC) packages/web/app/landing-page-client.tsx— no import path from any entry point (54 application, 8 tooling, 21 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~267 LoC) packages/web/components/ui/dropdown-menu.tsx— no import path from any entry point (54 application, 8 tooling, 21 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~139 LoC) packages/web/components/marketing/community-section.tsx— no import path from any entry point (54 application, 8 tooling, 21 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~109 LoC) packages/web/components/marketing/logo-marquee.tsx— no import path from any entry point (54 application, 8 tooling, 21 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~53 LoC) packages/web/components/blog/blog-card.tsx— no import path from any entry point (54 application, 8 tooling, 21 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~51 LoC) packages/web/components/blog/related-posts.tsx— no import path from any entry point (54 application, 8 tooling, 21 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~31 LoC) packages/web/lib/blog-category-icons.ts— no import path from any entry point (54 application, 8 tooling, 21 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Dead file (~25 LoC) packages/web/components/navigation/mega-menu-resources.tsx— no import path from any entry point (54 application, 8 tooling, 21 test roots considered), and no other file in the scanned tree imports it — nothing in-repo names this module at all, which is the strongest form of this claim the import graph can make
Unused dependency '@eslint/eslintrc' REDACTED:40— Declared in REDACTED but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
X15 · Unvalidated length from an untrusted reader· Length read from the parsed input is spent without ever being bounded · ×1
Length read from the parsed input is spent without ever being bounded crab/src/git/push.rs:557— `num_chunks` is read from the bytes being parsed at line 522 (`u32::from_le_bytes`), then used to size a `Vec::with_capacity` at line 557 — and nowhere in its scope is `num_chunks` compared to anything, clamped, or bounded against the input that remains. Whoever wrote those bytes therefore chooses the allocation directly: it reserves the whole length before a single byte of the payload is known to exist, so a 32-bit length asks for up to 4 GiB, and an allocation the allocator refuses aborts the process with `memory allocation of … bytes failed` — an abort, not a panic, so no `catch_unwind` intercepts it and the whole process dies; a 64-bit length past `isize::MAX` panics with `capacity overflow` instead, out of a parser whose failure path was written for malformed input, not for hostile input. Bound `num_chunks` against the bytes actually remaining and a maximum the format allows before allocating.
X18 · Disposal-pattern correctness· Raw handle taken from an owned value and never reclaimed · ×1
Raw handle taken from an owned value and never reclaimed crates/crab-cache/src/private_fs.rs:761— `file.into_raw_fd()` (line 761) gives up ownership in exchange for a raw handle — the value's `Drop` will no longer run — and the pointer it returns is thrown away on the spot, so nothing can ever hand it back. The memory or descriptor stays allocated until the process ends, once per call. Pair the hand-out with its reclaim (a `free` function that rebuilds the owner with `from_raw` and drops it), or keep the owning value.
X18 · Disposal-pattern correctness· Owned value's release suppressed and never restored · ×1
Owned value's release suppressed and never restored crates/crab-cache/src/private_fs/platform/database.rs:70— `std::mem::forget(connection)` (line 70) takes `connection` out of Rust's ownership: its `Drop` never runs, so whatever it holds — a descriptor, a socket, a buffer, a lock — is never given back, and nothing can give it back later because the value is gone. Let it drop (or call its explicit close) where its work ends; if the handle must outlive this function, turn it into a raw handle with `into_raw`/`into_raw_fd` and reclaim it with the matching `from_raw` when the owner is done.
Duplicated predicate packages/ui/src/issues.tsx:85— `!Number.isSafeInteger(number) || number <= 0` appears character-identically in 2 files — packages/ui/src/issues.tsx, packages/ui/src/pulls.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/ui/src/App.tsx:529— `repo.access === "write" && !repo.archived` appears character-identically in 2 files — packages/ui/src/App.tsx, packages/ui/src/releases.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate packages/web/components/marketing/counter.tsx:40— `typeof window === "undefined" || !window.matchMedia` appears character-identically in 3 files — packages/web/components/marketing/counter.tsx, packages/web/components/marketing/hero-decorations.tsx, packages/web/components/marketing/typing-code.tsx. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crab/deploy/auth-service/src/providers/aws.py:189— `"immutable-write" in permissions and "read" in permissions` appears character-identically in 2 files — crab/deploy/auth-service/src/providers/aws.py, crab/deploy/auth-service/src/providers/gcp.py. 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 crab/deploy/auth-service/src/providers/aws.py:221— `"immutable-write" in permissions and not upload_prefix` appears character-identically in 3 files — crab/deploy/auth-service/src/providers/aws.py, crab/deploy/auth-service/src/providers/azure.py, crab/deploy/auth-service/src/providers/gcp.py. 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 crab/deploy/auth-service/scripts/e2e-path-acl-local.py:181— `"non-fast-forward" in denied_output or "invalid_bundle" in denied_output` appears character-identically in 2 files — crab/deploy/auth-service/scripts/e2e-path-acl-local.py, crab/deploy/auth-service/scripts/e2e-path-acl-rustfs.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:412— `after_write["owner"] != after["owner"] or after_write["epoch"] != after["epoch"] or after_write["root"]["commit_sequence"] <= after["root"][…` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/crab-http-server/deploy/cell-issue-fleet/qualify_mode_rollout.py:104— `args.skip_build and not args.runtime_source` appears character-identically in 2 files — crates/crab-http-server/deploy/cell-issue-fleet/qualify_mode_rollout.py, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crab/scripts/nfs-evidence-summary.py:919— `expected_platform is not None and platform != expected_platform` appears character-identically in 2 files — crab/scripts/nfs-evidence-summary.py, crab/scripts/verify-nfs-smoke-report.py. 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 crab/scripts/nfs-evidence-summary.py:100— `isinstance(value, bool) or not isinstance(value, (int, float))` appears character-identically in 4 files — crab/scripts/nfs-evidence-summary.py, crab/scripts/nfs-read-path-bench-report.py, crab/scripts/verify-cache-service-smoke-report.py, crab/scripts/verify-nfs-smoke-report.py. 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 crab/scripts/verify-cache-service-smoke-report.py:139— `isinstance(value, bool) or not isinstance(value, int)` appears character-identically in 2 files — crab/scripts/verify-cache-service-smoke-report.py, crab/scripts/verify-nfs-smoke-report.py. 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 crab/scripts/nfs-evidence-summary.py:613— `not isinstance(run_id, str) or not run_id` appears character-identically in 3 files — crab/scripts/nfs-evidence-summary.py, crab/scripts/nfs-read-path-bench-report.py, crab/scripts/verify-nfs-smoke-report.py. 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 crab/deploy/auth-service/src/app.py:1411— `not normalized or normalized == "0" * 40` appears character-identically in 2 files — crab/deploy/auth-service/src/app.py, crab/deploy/auth-service/src/receive_helper.py. 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/crab-http-server/deploy/cell-issue-fleet/qualify_reader_first_loss.py:40— `not previous.get("finished_at") or config["name"] != previous["project"]` appears character-identically in 2 files — crates/crab-http-server/deploy/cell-issue-fleet/qualify_reader_first_loss.py, crates/crab-http-server/deploy/cell-issue-fleet/qualify_reader_perf.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:550— `root.get("commit_sequence", -1) < before["root"]["commit_sequence"] or root.get("txid", -1) < before["root"]["txid"]` appears character-identically in 2 files — REDACTED, REDACTED. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/crab-http-server/deploy/cell-issue-fleet/qualify_mode_rollout.py:57— `state["Running"] or state["ExitCode"] != 0 or state["OOMKilled"]` appears character-identically in 2 files — crates/crab-http-server/deploy/cell-issue-fleet/qualify_mode_rollout.py, crates/crab-http-server/deploy/cell-issue-fleet/qualify_reader_retention.py. 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 crab/src/cmd/adopt.rs:694— `!content.is_empty() && !content.ends_with('\n')` appears character-identically in 5 files — crab/src/cmd/adopt.rs, crab/src/cmd/clone.rs, crab/src/cmd/setup.rs, crab/src/cmd/track.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 crab/src/cmd/exp_queue.rs:1314— `!contents.is_empty() && !contents.ends_with('\n')` appears character-identically in 2 files — crab/src/cmd/exp_queue.rs, crab/src/import/assemble.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 crab/src/cmd/init.rs:613— `!existing.is_empty() && !existing.ends_with('\n')` appears character-identically in 3 files — crab/src/cmd/init.rs, crab/src/import/assemble.rs, crates/crab-workflow/src/gitignore.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 crab/src/import/assemble.rs:476— `!output.status.success() || value.is_empty()` appears character-identically in 2 files — crab/src/import/assemble.rs, crab/src/import/coordinator.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 crab/src/git/upload_pack_wire.rs:1522— `!plan.shallow.is_empty() || !plan.unshallow.is_empty()` appears character-identically in 2 files — crab/src/git/upload_pack_wire.rs, crates/crab-http-server/src/git.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 crab/src/cmd/replica.rs:11436— `!status.backend_available || !status.checked_drift` appears character-identically in 3 files — crab/src/cmd/replica.rs, crab/src/replication/mod.rs, crates/crab-coordination/src/write_coordinator.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 crab/src/cmd/adopt.rs:213— `!t.is_empty() && !t.starts_with('#') && t.contains("filter=crab")` appears character-identically in 5 files — crab/src/cmd/adopt.rs, crab/src/cmd/clone.rs, crab/src/cmd/init.rs, crab/src/cmd/setup.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 crab/src/cmd/add.rs:3456— `!trimmed.is_empty() && !trimmed.starts_with('#') && trimmed.contains("filter=crab")` appears character-identically in 5 files — crab/src/cmd/add.rs, crab/src/cmd/dehydrate.rs, crab/src/cmd/hydrate.rs, crab/src/cmd/reset.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 crab/src/cmd/data.rs:1669— `actual_hash != expected_hash || actual_size != expected_size` appears character-identically in 2 files — crab/src/cmd/data.rs, crates/crab-workflow/src/artifact.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.
README/code drift packages/web/README.md:353— packages/web/README.md links to `../README.md`, but `packages/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/architecture/README.md:24— crab/docs/architecture/README.md links to `decisions/README.md`, but `crab/docs/architecture/decisions/README.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:10— crab/docs/guides/README.md links to `crab-init.md`, but `crab/docs/guides/crab-init.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:11— crab/docs/guides/README.md links to `crab-clone.md`, but `crab/docs/guides/crab-clone.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:13— crab/docs/guides/README.md links to `crab-import.md`, but `crab/docs/guides/crab-import.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:15— crab/docs/guides/README.md links to `crab-install.md`, but `crab/docs/guides/crab-install.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:16— crab/docs/guides/README.md links to `crab-track.md`, but `crab/docs/guides/crab-track.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:22— crab/docs/guides/README.md links to `crab-add.md`, but `crab/docs/guides/crab-add.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:23— crab/docs/guides/README.md links to `crab-reset.md`, but `crab/docs/guides/crab-reset.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:24— crab/docs/guides/README.md links to `crab-hydrate.md`, but `crab/docs/guides/crab-hydrate.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:25— crab/docs/guides/README.md links to `crab-dehydrate.md`, but `crab/docs/guides/crab-dehydrate.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:26— crab/docs/guides/README.md links to `crab-status.md`, but `crab/docs/guides/crab-status.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:27— crab/docs/guides/README.md links to `crab-diff.md`, but `crab/docs/guides/crab-diff.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:28— crab/docs/guides/README.md links to `crab-fetch.md`, but `crab/docs/guides/crab-fetch.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:29— crab/docs/guides/README.md links to `crab-worktree.md`, but `crab/docs/guides/crab-worktree.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:35— crab/docs/guides/README.md links to `crab-ls-files.md`, but `crab/docs/guides/crab-ls-files.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:36— crab/docs/guides/README.md links to `crab-du.md`, but `crab/docs/guides/crab-du.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:37— crab/docs/guides/README.md links to `crab-stat.md`, but `crab/docs/guides/crab-stat.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:43— crab/docs/guides/README.md links to `crab-lock.md`, but `crab/docs/guides/crab-lock.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:49— crab/docs/guides/README.md links to `crab-gc.md`, but `crab/docs/guides/crab-gc.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:50— crab/docs/guides/README.md links to `crab-fsck.md`, but `crab/docs/guides/crab-fsck.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:51— crab/docs/guides/README.md links to `crab-repack.md`, but `crab/docs/guides/crab-repack.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:57— crab/docs/guides/README.md links to `crab-prune.md`, but `crab/docs/guides/crab-prune.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:58— crab/docs/guides/README.md links to `crab-staging.md`, but `crab/docs/guides/crab-staging.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift crab/docs/guides/README.md:59— crab/docs/guides/README.md links to `crab-cache.md`, but `crab/docs/guides/crab-cache.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every REDACTED, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Silent fallback default on Err crab/src/optimize/xorbs/profile.rs:186— `to_json` turns every `Err` into `"{}".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crab/src/cmd/init.rs:869— `crab_binary_path` turns every `Err` into `"crab".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crab/src/cmd/lfs/logs.rs:102— `sorted_error_logs` turns every `Err` into `Ok(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 crab/src/cmd/mount.rs:3426— `walkdir_size` 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 crab/src/git/push.rs:1997— `manifest_connectivity_frontier` 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 crab/src/lfs/publication.rs:191— `locally_available_remote_tips` 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 crab/src/lfs/status.rs:307— `diff_index_head_via_gix` turns every `Err` into `Ok(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 crab/src/lfs/status.rs:480— `diff_files_via_gix` turns every `Err` into `Ok(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 crab/src/replication/mod.rs:9410— `read_replica_event_summary_from_path` turns every `Err` into `ReplicaEventSummary::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/crab-cache-server/src/onboarding.rs:904— `redact_url_value` turns every `Err` into `"configured-redacted".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/crab-cache-server/src/preflight.rs:679— `redact_url` turns every `Err` into `"<invalid-url>".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/crab-storage/src/store.rs:455— `staged_writes` 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/crab-storage/src/transport_read_admission.rs:134— `contexts` 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/crab-vfs/src/overlay.rs:802— `list_by_prefix` 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/crab-vfs/src/overlay.rs:814— `list_children_page` 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/crab-vfs/src/executable.rs:10— `crab_binary_path` turns every `Err` into `"crab".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err REDACTED:1997— `cache_checked_payload` turns every `Err` into `"{}".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err REDACTED:2011— `running_payload` turns every `Err` into `"{}".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err REDACTED:2037— `hashed_payload` turns every `Err` into `"{}".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err REDACTED:2048— `entry_written_payload` turns every `Err` into `"{}".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err REDACTED:2057— `committed_payload` turns every `Err` into `"{}".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/crab-workflow/src/stage_runtime.rs:288— `redacted_url_subject` turns every `Err` into `"<redacted-url>".to_owned()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err crates/crab-write/src/generation.rs:1008— `uncovered_locator_object_rows` turns every `Err` into `true` — 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.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×7
Projects may be oversized for their cohesion crab/Cargo.toml:1— `crab` (355183 LoC, 1267 module-visible types across 40 directories) overshoots its size bounds. 7 of 28 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 5.1/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion crates/crab-http-server/Cargo.toml:1— `crates/crab-http-server` (64945 LoC, 114 module-visible types across 12 directories) overshoots its size bounds. 7 of 28 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 5.1/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion crates/crab-workflow/Cargo.toml:1— `crates/crab-workflow` (43637 LoC, 165 module-visible types across 2 directories) overshoots its size bounds. 7 of 28 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 5.1/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion crates/crab-vfs/Cargo.toml:1— `crates/crab-vfs` (34934 LoC, 162 module-visible types across 1 directories) overshoots its size bounds. 7 of 28 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 5.1/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion crates/crab-metadata/Cargo.toml:1— `crates/crab-metadata` (30740 LoC, 134 module-visible types across 3 directories) overshoots its size bounds. 7 of 28 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 5.1/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion REDACTED:1— `packages/web` (30098 LoC, 207 module-visible types across 39 directories) overshoots its size bounds. 7 of 28 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 5.1/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Projects may be oversized for their cohesion crates/crab-auth/Cargo.toml:1— `crates/crab-auth` (10224 LoC, 129 module-visible types across 2 directories) overshoots its size bounds. 7 of 28 build unit(s) (Cargo, Python, npm) overshoot their size bounds, lowering Project Cohesion to 5.1/10. Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
Interpolated log message defeats structured logging crates/crab-write/src/lib.rs:79— `warn!` at line 79 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 crab/src/speculation/access_db.rs:304— `warn!` at line 304 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 crab/src/speculation/access_db.rs:311— `warn!` at line 311 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 crab/src/speculation/access_db.rs:312— `warn!` at line 312 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 crab/src/lfs/lock.rs:152— `debug!` at line 152 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`.
Unused export 'default' packages/web/components/marketing/loading-fallback.tsx:41— Nothing imports this binding — it is safe to review for removal.
Unused export 'default' REDACTED:183— Nothing imports this binding — it is safe to review for removal.
Unused export 'default' packages/web/lib/remark-mermaid.mjs:37— Nothing imports this binding — it is safe to review for removal.
M2 · Architecture documentation· Architecture diagram out of date · ×2
Architecture diagram out of date diagram/crab-internal-architecture/crab-internal-architecture.svg:2— `diagram/crab-internal-architecture/crab-internal-architecture.svg` draws the system's parts, and the drawing no longer matches the code: it leaves out `crab-auth-server`, `crab-auth-store`, `crab-cache-store`, `crab-coordination`, `crab-diff`, `crab-http-server`, `crab-remote-git`, `crab-s3-gateway`, `crab-sdk`, `crab-types`, `crab-write`, `crab-xet`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Architecture diagram out of date crab/docs/architecture/multi-crate-transition.md:1836— `crab/docs/architecture/multi-crate-transition.md` draws the system's parts, and the drawing no longer matches the code: it leaves out `crab-auth-store`, `crab-http-server`, `crab-s3-gateway`, `crab-staging`, `crab-vfs`, `crab-write`, which the repository has beside the units it does draw. A diagram of a system that no longer exists misleads the reader it was drawn for, so it is not credited as documenting the shape.
Silent fallback default on parse failure crab/scripts/e2e/run_lfs_qualification.py:52— `redact_url` returns `'<redacted-url>'` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure crab/scripts/e2e/run_protocol_v2_partial_clone_rustfs_smoke.py:366— `process_tree_rss_bytes` returns `0` when `(OSError, StopIteration, ValueError, IndexError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/ui/src/data-workbench.tsx:74— `readHistory` swallows every exception into `return []` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch packages/web/lib/mdx-reading-time.ts:21— `countWordsFromMdxFile` swallows every exception into `return 200` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
C2 · Access Controls· No named authorization policies · ×1
No named authorization policies — Authorization IS enforced here (by route guards, auth middleware or checks that refuse a caller) — this is NOT a claim that endpoints are unprotected. What's missing is a NAMED rule set: who may do what is encoded inline where it is checked, so the rules can't be listed, reviewed or tested apart from the code that applies them. Recommendation, not a defect.
Partial audit-trail evidence — An audit mechanism is present, but the trail is not yet complete — missing: a write-side hook every change flows through (a SeaORM ActiveModelBehavior hook or a database trigger recording each change, or an event-sourced store), per-entity coverage (an event-sourced aggregate, or a hook on each entity that needs a who-changed-what trail).
C4 · Data Retention· Partial data-retention evidence · ×1
Partial data-retention evidence — A retention mechanism is present, but the data-lifecycle is not yet complete — missing: an expiry limit — a declared maximum age / TTL after which the data is no longer kept.
ADR declares no status plans/018-product-readiness-roadmap.md:1— `plans/018-product-readiness-roadmap.md` declares no status, while 12 of the 12 other records in `plans` do, so a reader cannot tell whether this decision is in force. Add a `Status:` line.
No seccomp profile REDACTED:12— 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.
P10 · Library API & versioning· Implementation type on the public API · ×1
Implementation type on the public API crab/src/import/versions.rs:161— 1 public type in `crab.import.versions` is marked as implementation by its own namespace, folder or name: `VersionedListImpl` (crab/src/import/versions.rs:161, name ends in `Impl`). While it is public, every consumer of the library can bind to it, so changing it is a breaking change for those consumers.
Logging is not universal — Only 24/26 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `packages/web`.
No dependency-update automation REDACTED:15— `REDACTED` declares packages, and nothing in the repository keeps them current: no Dependabot or Renovate configuration that schedules updates, and no dependency-review gate on pull requests. A pinned dependency stays at the version it was added at until someone notices — including after an advisory is published against it. Add a `.github/dependabot.yml` with one `package-ecosystem` entry per ecosystem the tree uses (or an enabled `renovate.json`), and gate pull requests with `actions/dependency-review-action`.
R7 · Dead Code· Unused export 'tableFromValues' · ×1
Unused export 'tableFromValues' packages/ui/src/file-preview-model.ts:100— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'getStorageClass' · ×1
Unused export 'getStorageClass' packages/web/lib/pricing-data.ts:220— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused module-local declaration 'PRIMARY_FG' · ×1
Unused module-local declaration 'PRIMARY_FG' packages/web/app/diagrams/auth-flow-svg.tsx:15— This top-level declaration is not exported and its name occurs nowhere else in its module — not called, read, typed against, re-exported or named by a string. Nothing outside the module can reach a non-exported binding, so this is the whole search: remove it, or use it.
No security response headers detected packages/web/vercel.json:1— None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is configured — defense in depth, even when a reverse proxy could set them. This is reported because `vercel.json` configures this repository's static hosting, including its response headers, so the configuration that would carry these headers is in this repository and was read in full. (−2.0 on this card.)
X2 · Cancellation propagation· Not all async functions that make a request accept an AbortSignal · ×1
Not all async functions that make a request accept an AbortSignal — Only 5/9 async functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http) accept an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, an unmounted component, a timed-out job. Take a `signal` (or an options object that carries one) and hand it to the request; where nothing could ever cancel the call, omitting it is a deliberate choice — judge against how the function is used.
Subsumed condition operand crab/src/cost/report.rs:347— `json.contains("2300.00")` can never decide this `||` — every value satisfying `json.contains("2300.00")` also satisfies `json.contains("2300")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 8 file(s) — `packages/ui/src/api.ts`, `packages/ui/src/content.tsx`, `packages/ui/src/duckdb-query.ts`, `packages/ui/src/sqlite-query.worker.ts`, `packages/web/.source/browser.ts`, … (+3 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
Run 01a1e64f-da29-786d-adb7-c65a7842be8b · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 181 · Warnings: 4478 · Recommendations: 154 · Info: 44 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 16-11-2026 @ 21:42 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.