Public report of HelixDB/helix-db, published 14 November 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.11.4). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 14 November 2026, 18:56 UTC · Survey ID cd_244fabe024074608b4761e12f9079238
HelixDB/helix-db
Measured 14 November 2026, 18:48 UTC, at code version 4b0982f
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
No change since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 452,321 lines of product code in 22 projects, tests not counted · Estimated rebuild effort: about 6.5 person-years · Weakest lens: Security and Compliance, 40
Findings by how serious they are
167 critical1815 serious67 minor
16 dimensions are left out of the score. For each one, we either couldn't measure it in this code, or found no evidence of the safeguard we look for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Canine Code Analyzer
Producer
Canine Development
Analyzer
Canine Code Analyzer engine 1.0.0
Measured
14 November 2026, 18:48 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds the Canine Code Analyzer. It is open to any tool that
implements it, and today the Canine Code Analyzer is the only one that does.
The score is deterministic, which means the same code always gets the same score. We work it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
70of 70 dimensions measured by tools.
2024of 2049 findings point to an exact file and line, so you can open each one in the code. The other 25 concern the repository as a whole, such as missing documentation.
70dimensions across 7 lenses, read from 452,321 lines of product code in 22 projects.
HelixDB/helix-db falls short of our standard for production, in part because six of the dependencies have a known vulnerability. It scores 55 out of 100 and is rated Adequate, and all 167 of its critical findings are security problems.
Security and Compliance, at 40, is the weakest lens and counts most in the score. The best first step is checking access in every handler, worth about 9 points. Replacing the six passwords or keys found in the code's history comes next, worth about 3 points. Raising Security and Compliance to 70 would lift the score to about 66.
143 pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Six known security holes in the packages the code depends on can be used by attackers, and six passwords or keys are open to anyone who can read the repository. Pinning each tool to an exact version, updating the vulnerable packages and replacing each exposed password or key would close these risks. The five unsafe settings in infrastructure or container files need changing to safe values. The three pipeline steps that install packages without pinning their versions need the packages they install pinned to exact versions.
The product code is 452,321 lines, about €940,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Security and Compliance rose from 40 to 70, the lowest score rated Strong, the score would rise from 55 to about 66.
Code composition: what the lines of code are
Product code 65%Tests 35%
New since the last survey: 583 findings
These 583 critical or serious findings weren't in the previous survey, on 27 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · MethodTooLong: Translator.select crates/cypher/src/sql/select.rs
God Classes · MethodTooLong: Translator.expr_at_depth crates/cypher/src/sql/expr.rs
God Classes · FileTooLong: sql/expr.rs crates/cypher/src/sql/expr.rs
God Classes · MethodTooLong: Translator.function crates/cypher/src/sql/expr.rs
God Classes · TooManyMethods: Translator crates/cypher/src/sql.rs
God Classes · FileTooLong: sql/select.rs crates/cypher/src/sql/select.rs
God Classes · MethodTooLong: Expr.fmt crates/cypher/src/print.rs
God Classes · FunctionTooLong: db::index_lifecycle_testing::text_generation_rows::damage_text_build crates/db/src/index_lifecycle_testing/text_generation_rows.rs
God Classes · FunctionTooLong: db::index_lifecycle::secondary::release_validated_rows crates/db/src/index_lifecycle/secondary.rs
God Classes · FunctionTooLong: db::index_lifecycle::secondary::claim_while_building crates/db/src/index_lifecycle/secondary.rs
God Classes · MethodTooLong: Translator.relationship_insert crates/cypher/src/sql/dml.rs
God Classes · FileTooLong: sql/dml.rs crates/cypher/src/sql/dml.rs
God Classes · FileTooLong: sql/tables.rs crates/cypher/src/sql/tables.rs
God Classes · FileTooLong: src/lib.rs sdks/rust/src/lib.rs
God Classes · MethodTooLong: SecondaryIndexDriver.prepare_step crates/db/src/index_lifecycle/secondary.rs
God Classes · MethodTooLong: SecondaryMutationRuntime.flush crates/db/src/index_lifecycle/secondary.rs
God Classes · MethodTooLong: PreparedSecondaryOperationStep.stage crates/db/src/index_lifecycle/secondary.rs
God Classes · FunctionTooLong: db::index_lifecycle::secondary::reconciliation_plan_from_observations crates/db/src/index_lifecycle/secondary.rs
God Classes · FileTooLong: src/config.rs crates/server/src/config.rs
God Classes · FileTooLong: mutation/presearch.rs crates/db/src/search/vector/hnsw/mutation/presearch.rs
Code Duplication · Near-duplicate member family (6 members, 28 shared lines) crates/db/src/migrations/vector_properties.rs
Code Duplication · Near-duplicate member family (4 members, 36 shared lines) crates/db/src/migrations/vector_retirement.rs
Code Duplication · Near-duplicate member family (4 members, 34 shared lines) crates/db/src/migrations/vector_retirement.rs
Code Duplication · Near-duplicate member family (3 members, 33 shared lines) crates/db/src/index_lifecycle/text/validation.rs
Code Duplication · Near-duplicate member pair (67 shared lines) crates/ast/src/testing/variants.rs
Code Duplication · Near-duplicate member pair (62 shared lines) crates/db/src/index_lifecycle/queue/publication.rs
Code Duplication · Near-duplicate member pair (60 shared lines) crates/db/src/index_lifecycle_testing.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/db/src/execution/interpreter/mutation/edge.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/db/src/index_lifecycle/scope_gate.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) crates/db/src/search/mod.rs
Code Duplication · Members sharing a duplicated core (4 members, 50+ identical tokens) sdks/python/scripts/run_embedded_parity.py
Code Duplication · Edited copy of a member (132 corresponding lines) crates/db/src/execution/interpreter/access/secondary_set.rs
Code Duplication · Edited copy of a member (111 corresponding lines) crates/planner/src/rules/cardinality.rs
Code Duplication · Edited copy of a member (68 corresponding lines) crates/planner/src/relational/expression.rs
Code Duplication · Edited copy of a member (70 corresponding lines) crates/planner/src/rules/physical_contracts/access/source/edge.rs
Code Duplication · Edited copy of a member (77 corresponding lines) crates/db/src/encoding/v2/keys/indexes/range/edge.rs
Code Duplication · Edited copies of one member (3 members, 81+ corresponding lines) crates/db/src/search/mod.rs
Code Duplication · Edited copy of a member (61 corresponding lines) crates/planner/src/diagnostics/analyze.rs
Code Duplication · Edited copy of a member (53 corresponding lines) crates/planner/src/exec/lowering/costing.rs
Code Duplication · Edited copy of a member (73 corresponding lines) crates/db/src/migrations/vector_simhash_directory.rs
Code Duplication · Edited copy of a member (50 corresponding lines) crates/db/src/search/vector/hnsw/mutation/mod.rs
Code Duplication · Edited copy of a member (56 corresponding lines) crates/planner/src/rules/access/pipeline/mod.rs
Code Duplication · Edited copy of a member (54 corresponding lines) crates/db/src/execution/interpreter/count.rs
Code Duplication · Edited copy of a member (58 corresponding lines) crates/db/src/index_lifecycle/secondary.rs
Code Duplication · Edited copy of a member (59 corresponding lines) crates/planner/src/exec/lowering/secondary_set.rs
Code Duplication · Edited copy of a member (45 corresponding lines) crates/db/src/execution/interpreter/count.rs
Code Duplication · Edited copy of a member (54 corresponding lines) crates/db/src/execution/interpreter/storage.rs
Code Duplication · Edited copy of a member (26 corresponding lines) crates/db/src/encoding/v2/values/property/property_value.rs
Code Duplication · Edited copy of a member (95 corresponding lines) crates/server/src/diagnostics/mod.rs
Code Duplication · Edited copy of a member (44 corresponding lines) crates/planner/src/exec/lowering/secondary_set.rs
Code Duplication · Edited copy of a member (52 corresponding lines) crates/planner/src/exec/count.rs
Code Duplication · Edited copy of a member (62 corresponding lines) crates/planner/src/exec/selected/lowering/access/leaf.rs
Code Duplication · Edited copy of a member (44 corresponding lines) crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs
Code Duplication · Edited copy of a member (38 corresponding lines) crates/planner/src/rules/cardinality.rs
Code Duplication · Edited copy of a member (36 corresponding lines) crates/planner/src/rules/access/order/satisfaction.rs
Code Duplication · Edited copy of a member (42 corresponding lines) crates/graph-algorithms/src/algorithms/centrality.rs
Code Duplication · Edited copy of a member (43 corresponding lines) crates/db/src/search/vector/cache/store.rs
Code Duplication · Edited copy of a member (65 corresponding lines) crates/db/src/index_lifecycle_testing/contracts.rs
Code Duplication · Edited copy of a member (35 corresponding lines) sdks/python/src/helixdb/dsl.py
Code Duplication · Edited copy of a member (45 corresponding lines) crates/planner/src/planning/selected/native/pipeline/ops/bounds.rs
Code Duplication · Edited copy of a member (48 corresponding lines) crates/db/src/index_lifecycle/repository.rs
Code Duplication · Edited copy of a member (29 corresponding lines) crates/planner/src/rules/cardinality.rs
Code Duplication · Edited copy of a member (55 corresponding lines) crates/db/src/execution/interpreter/access/restricted_text.rs
Code Duplication · Edited copy of a member (50 corresponding lines) crates/db/src/search/vector/hnsw/mutation/mod.rs
Code Duplication · Edited copy of a member (32 corresponding lines) crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs
Code Duplication · Edited copy of a member (46 corresponding lines) crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs
Code Duplication · Edited copy of a member (51 corresponding lines) crates/db/src/index_lifecycle_testing/contracts/all_index_validation.rs
Code Duplication · Edited copy of a member (32 corresponding lines) crates/db/src/search/mod.rs
Code Duplication · Edited copy of a member (37 corresponding lines) crates/planner/src/exec/lowering/contracts/access/cardinality.rs
Code Duplication · Edited copy of a member (24 corresponding lines) crates/planner/src/diagnostics/analyze.rs
Code Duplication · Edited copies of one member (4 members, 31+ corresponding lines) crates/db/src/search/vector/spaces/simple_avx.rs
Code Duplication · Edited copy of a member (32 corresponding lines) crates/db/src/execution/interpreter/control/foreach.rs
Code Duplication · Edited copy of a member (35 corresponding lines) crates/db/src/execution/interpreter/access/membership.rs
Code Duplication · Edited copy of a member (27 corresponding lines) crates/db/src/execution/interpreter/storage.rs
Code Duplication · Edited copy of a member (28 corresponding lines) sdks/rust/src/lib.rs
We compare every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 294 findings
These 294 critical or serious findings were in the previous survey, on 27 October 2026, and are gone from this one. The first 100 are listed here.
€310,000 to €1,600,000, for 5,206 to 16,515 hours of work, about 6.5 person-years for 3 to 13 engineers
Difficulty of the problem
High, 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 55. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 452,321 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
Enforce authorization at every handler — a guard on each route, or a global authentication guard/middleware with explicit public opt-outs, so protected-by-default is demonstrable.
Raises the score by about 9 points · Medium effort · Access Controls
2
Resolve the 6 REDACTED finding(s) in Secrets (history) — start with REDACTED (6).
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 €940,000 to build again, about 6.5 person-years of work. Its weakest lens is Security and Compliance, at 40 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Enforce authorization at every handler — a guard on each route, or a global authentication guard/middleware with explicit public opt-outs, so protected-by-default is demonstrable. Of all the actions in this report, it raises the score most for the work it takes: about 9 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.2 out of 10. Code at that level is slower to change than clean code, and we estimate the extra work at 2% to 5% on every change. The history of the code shows how much it changes: about 577,974 lines over the last 90 days, which is about 2,344,006 lines a year. At that pace, the extra work comes to an estimated 117.2 to 781.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.
1101 modules, with 3459 dependencies between them. 14 loops run through 182 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1061 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.
db.cypher uses db.encoding.v2.keys.scope, so a change to db.encoding.v2.keys.scope can break db.cypher, while a change to db.cypher can't break db.encoding.v2.keys.scope.
Position
Below the diagonal: db.cypher uses a module listed above it, which is the healthy direction.
db.cypher uses helix_planner.relational.query, so a change to helix_planner.relational.query can break db.cypher, while a change to db.cypher can't break helix_planner.relational.query.
Position
Below the diagonal: db.cypher uses a module listed above it, which is the healthy direction.
db.execution.interpreter.types uses helix_planner.ir.contracts.non_empty_string, so a change to helix_planner.ir.contracts.non_empty_string can break db.execution.interpreter.types, while a change to db.execution.interpreter.types can't break helix_planner.ir.contracts.non_empty_string.
Position
Below the diagonal: db.execution.interpreter.types uses a module listed above it, which is the healthy direction.
db.execution.interpreter.types uses helix_planner.relational.query, so a change to helix_planner.relational.query can break db.execution.interpreter.types, while a change to db.execution.interpreter.types can't break helix_planner.relational.query.
Position
Below the diagonal: db.execution.interpreter.types uses a module listed above it, which is the healthy direction.
12→22 db.index_lifecycle.model uses db.config.indexespart of a loop✕
Connections
8 pairs of types, where a type in db.index_lifecycle.model uses a type in db.config.indexes.
db.index_lifecycle.model uses db.config.indexes, so a change to db.config.indexes can break db.index_lifecycle.model, while a change to db.index_lifecycle.model can't break db.config.indexes.
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.
helix_ast.traversal uses helix_ast.expr, so a change to helix_ast.expr can break helix_ast.traversal, while a change to helix_ast.traversal can't break helix_ast.expr.
Position
Below the diagonal: helix_ast.traversal uses a module listed above it, which is the healthy direction.
helix_planner.catalog.property uses helix_planner.ir.contracts.non_empty_string, so a change to helix_planner.ir.contracts.non_empty_string can break helix_planner.catalog.property, while a change to helix_planner.catalog.property can't break helix_planner.ir.contracts.non_empty_string.
Position
Below the diagonal: helix_planner.catalog.property uses a module listed above it, which is the healthy direction.
helix_planner.cost.profile uses helix_ast.expr, so a change to helix_ast.expr can break helix_planner.cost.profile, while a change to helix_planner.cost.profile can't break helix_ast.expr.
Position
Below the diagonal: helix_planner.cost.profile uses a module listed above it, which is the healthy direction.
helix_planner.cost.profile uses helix_planner.cost.vector, so a change to helix_planner.cost.vector can break helix_planner.cost.profile, while a change to helix_planner.cost.profile can't break helix_planner.cost.vector.
Position
Below the diagonal: helix_planner.cost.profile uses a module listed above it, which is the healthy direction.
helix_planner.ir.access.edge uses helix_planner.ir.contracts.non_empty_string, so a change to helix_planner.ir.contracts.non_empty_string can break helix_planner.ir.access.edge, while a change to helix_planner.ir.access.edge can't break helix_planner.ir.contracts.non_empty_string.
Position
Below the diagonal: helix_planner.ir.access.edge uses a module listed above it, which is the healthy direction.
helix_planner.ir.access.node uses helix_planner.ir.contracts.non_empty_string, so a change to helix_planner.ir.contracts.non_empty_string can break helix_planner.ir.access.node, while a change to helix_planner.ir.access.node can't break helix_planner.ir.contracts.non_empty_string.
Position
Below the diagonal: helix_planner.ir.access.node uses a module listed above it, which is the healthy direction.
helix_planner.relational.value uses helix_planner.relational.query, so a change to helix_planner.relational.query can break helix_planner.relational.value, while a change to helix_planner.relational.value can't break helix_planner.relational.query.
Position
Below the diagonal: helix_planner.relational.value uses a module listed above it, which is the healthy direction.
34 pairs of types, where a type in db.index_lifecycle.work uses a type in db.index_lifecycle.model. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
db.index_lifecycle.work uses db.index_lifecycle.model, so a change to db.index_lifecycle.model can break db.index_lifecycle.work, while a change to db.index_lifecycle.work can't break db.index_lifecycle.model.
Position
Below the diagonal: db.index_lifecycle.work uses a module listed above it, which is the healthy direction.
helix_planner.catalog.snapshot uses helix_planner.catalog.property, so a change to helix_planner.catalog.property can break helix_planner.catalog.snapshot, while a change to helix_planner.catalog.snapshot can't break helix_planner.catalog.property.
Position
Below the diagonal: helix_planner.catalog.snapshot uses a module listed above it, which is the healthy direction.
db.config.indexes uses db.index_lifecycle.model, so a change to db.index_lifecycle.model can break db.config.indexes, while a change to db.config.indexes can't break db.index_lifecycle.model.
Position
Below the diagonal: db.config.indexes uses a module listed above it, which is the healthy direction.
db.config.indexes uses helix_planner.catalog.snapshot, so a change to helix_planner.catalog.snapshot can break db.config.indexes, while a change to db.config.indexes can't break helix_planner.catalog.snapshot.
Position
Below the diagonal: db.config.indexes uses a module listed above it, which is the healthy direction.
db.index_lifecycle.secondary uses db.encoding.v2.keys.scope, so a change to db.encoding.v2.keys.scope can break db.index_lifecycle.secondary, while a change to db.index_lifecycle.secondary can't break db.encoding.v2.keys.scope.
Position
Below the diagonal: db.index_lifecycle.secondary uses a module listed above it, which is the healthy direction.
db.index_lifecycle.secondary uses db.query_resources, so a change to db.query_resources can break db.index_lifecycle.secondary, while a change to db.index_lifecycle.secondary can't break db.query_resources.
Position
Below the diagonal: db.index_lifecycle.secondary uses a module listed above it, which is the healthy direction.
db.index_lifecycle.secondary uses db.index_lifecycle.model, so a change to db.index_lifecycle.model can break db.index_lifecycle.secondary, while a change to db.index_lifecycle.secondary can't break db.index_lifecycle.model.
Position
Below the diagonal: db.index_lifecycle.secondary uses a module listed above it, which is the healthy direction.
db.index_lifecycle.secondary uses db.error, so a change to db.error can break db.index_lifecycle.secondary, while a change to db.index_lifecycle.secondary can't break db.error.
Position
Below the diagonal: db.index_lifecycle.secondary uses a module listed above it, which is the healthy direction.
db.index_lifecycle.secondary uses db.index_lifecycle.work, so a change to db.index_lifecycle.work can break db.index_lifecycle.secondary, while a change to db.index_lifecycle.secondary can't break db.index_lifecycle.work.
Position
Below the diagonal: db.index_lifecycle.secondary uses a module listed above it, which is the healthy direction.
db.search.vector.hnsw.index uses db.encoding.v2.keys.scope, so a change to db.encoding.v2.keys.scope can break db.search.vector.hnsw.index, while a change to db.search.vector.hnsw.index can't break db.encoding.v2.keys.scope.
Position
Below the diagonal: db.search.vector.hnsw.index uses a module listed above it, which is the healthy direction.
db.search.vector.hnsw.index uses db.index_lifecycle.model, so a change to db.index_lifecycle.model can break db.search.vector.hnsw.index, while a change to db.search.vector.hnsw.index can't break db.index_lifecycle.model.
Position
Below the diagonal: db.search.vector.hnsw.index uses a module listed above it, which is the healthy direction.
db.search.vector.hnsw.index uses db.error, so a change to db.error can break db.search.vector.hnsw.index, while a change to db.search.vector.hnsw.index can't break db.error.
Position
Below the diagonal: db.search.vector.hnsw.index uses a module listed above it, which is the healthy direction.
helix_planner.context.planner uses helix_planner.cost.profile, so a change to helix_planner.cost.profile can break helix_planner.context.planner, while a change to helix_planner.context.planner can't break helix_planner.cost.profile.
Position
Below the diagonal: helix_planner.context.planner uses a module listed above it, which is the healthy direction.
helix_planner.context.planner uses helix_planner.catalog.snapshot, so a change to helix_planner.catalog.snapshot can break helix_planner.context.planner, while a change to helix_planner.context.planner can't break helix_planner.catalog.snapshot.
Position
Below the diagonal: helix_planner.context.planner uses a module listed above it, which is the healthy direction.
db uses helix_planner.catalog.snapshot, so a change to helix_planner.catalog.snapshot can break db, while a change to db can't break helix_planner.catalog.snapshot.
Position
Below the diagonal: db uses a module listed above it, which is the healthy direction.
db uses helix_planner.context.planner, so a change to helix_planner.context.planner can break db, while a change to db can't break helix_planner.context.planner.
Position
Below the diagonal: db uses a module listed above it, which is the healthy direction.
db.index_lifecycle.vector.driver uses db.encoding.v2.keys.scope, so a change to db.encoding.v2.keys.scope can break db.index_lifecycle.vector.driver, while a change to db.index_lifecycle.vector.driver can't break db.encoding.v2.keys.scope.
Position
Below the diagonal: db.index_lifecycle.vector.driver uses a module listed above it, which is the healthy direction.
db.index_lifecycle.vector.driver uses db.index_lifecycle.model, so a change to db.index_lifecycle.model can break db.index_lifecycle.vector.driver, while a change to db.index_lifecycle.vector.driver can't break db.index_lifecycle.model.
Position
Below the diagonal: db.index_lifecycle.vector.driver uses a module listed above it, which is the healthy direction.
db.index_lifecycle.vector.driver uses db.error, so a change to db.error can break db.index_lifecycle.vector.driver, while a change to db.index_lifecycle.vector.driver can't break db.error.
Position
Below the diagonal: db.index_lifecycle.vector.driver uses a module listed above it, which is the healthy direction.
db.index_lifecycle.vector.driver uses db.index_lifecycle.work, so a change to db.index_lifecycle.work can break db.index_lifecycle.vector.driver, while a change to db.index_lifecycle.vector.driver can't break db.index_lifecycle.work.
Position
Below the diagonal: db.index_lifecycle.vector.driver uses a module listed above it, which is the healthy direction.
db.index_lifecycle.vector.driver uses db.search.vector.hnsw.index, so a change to db.search.vector.hnsw.index can break db.index_lifecycle.vector.driver, while a change to db.index_lifecycle.vector.driver can't break db.search.vector.hnsw.index.
Position
Below the diagonal: db.index_lifecycle.vector.driver uses a module listed above it, which is the healthy direction.
db.search.text uses db.encoding.v2.keys.scope, so a change to db.encoding.v2.keys.scope can break db.search.text, while a change to db.search.text can't break db.encoding.v2.keys.scope.
Position
Below the diagonal: db.search.text uses a module listed above it, which is the healthy direction.
db.search.text uses helix_planner.relational.value, so a change to helix_planner.relational.value can break db.search.text, while a change to db.search.text can't break helix_planner.relational.value.
Position
Below the diagonal: db.search.text uses a module listed above it, which is the healthy direction.
db.search.text uses db.index_lifecycle.work, so a change to db.index_lifecycle.work can break db.search.text, while a change to db.search.text can't break db.index_lifecycle.work.
Position
Below the diagonal: db.search.text uses a module listed above it, which is the healthy direction.
db.search.text uses db.config.indexes, so a change to db.config.indexes can break db.search.text, while a change to db.search.text can't break db.config.indexes.
Position
Below the diagonal: db.search.text uses a module listed above it, which is the healthy direction.
helix_planner.diagnostics.analyze uses helix_ast.expr, so a change to helix_ast.expr can break helix_planner.diagnostics.analyze, while a change to helix_planner.diagnostics.analyze can't break helix_ast.expr.
Position
Below the diagonal: helix_planner.diagnostics.analyze uses a module listed above it, which is the healthy direction.
helix_planner.diagnostics.analyze uses helix_planner.ir.contracts.non_empty_string, so a change to helix_planner.ir.contracts.non_empty_string can break helix_planner.diagnostics.analyze, while a change to helix_planner.diagnostics.analyze can't break helix_planner.ir.contracts.non_empty_string.
Position
Below the diagonal: helix_planner.diagnostics.analyze uses a module listed above it, which is the healthy direction.
helix_planner.diagnostics.analyze uses helix_planner.context.planner, so a change to helix_planner.context.planner can break helix_planner.diagnostics.analyze, while a change to helix_planner.diagnostics.analyze can't break helix_planner.context.planner.
Position
Below the diagonal: helix_planner.diagnostics.analyze uses a module listed above it, which is the healthy direction.
29→33 helix_planner.diagnostics.analyze uses helix_planner.catalog.elementpart of a loop✕
Connections
3 pairs of types, where a type in helix_planner.diagnostics.analyze uses a type in helix_planner.catalog.element.
helix_planner.diagnostics.analyze uses helix_planner.catalog.element, so a change to helix_planner.catalog.element can break helix_planner.diagnostics.analyze, while a change to helix_planner.diagnostics.analyze can't break helix_planner.catalog.element.
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.
helix_planner.planning.selected.session uses helix_planner.logical.core.expr, so a change to helix_planner.logical.core.expr can break helix_planner.planning.selected.session, while a change to helix_planner.planning.selected.session can't break helix_planner.logical.core.expr.
Position
Below the diagonal: helix_planner.planning.selected.session uses a module listed above it, which is the healthy direction.
helix_planner.planning.selected.session uses helix_planner.context.planner, so a change to helix_planner.context.planner can break helix_planner.planning.selected.session, while a change to helix_planner.planning.selected.session can't break helix_planner.context.planner.
Position
Below the diagonal: helix_planner.planning.selected.session uses a module listed above it, which is the healthy direction.
helix_planner.relational.planning uses helix_planner.logical.core.expr, so a change to helix_planner.logical.core.expr can break helix_planner.relational.planning, while a change to helix_planner.relational.planning can't break helix_planner.logical.core.expr.
Position
Below the diagonal: helix_planner.relational.planning uses a module listed above it, which is the healthy direction.
helix_planner.relational.planning uses helix_planner.relational.query, so a change to helix_planner.relational.query can break helix_planner.relational.planning, while a change to helix_planner.relational.planning can't break helix_planner.relational.query.
Position
Below the diagonal: helix_planner.relational.planning uses a module listed above it, which is the healthy direction.
helix_planner.relational.planning uses helix_planner.ir.access.node, so a change to helix_planner.ir.access.node can break helix_planner.relational.planning, while a change to helix_planner.relational.planning can't break helix_planner.ir.access.node.
Position
Below the diagonal: helix_planner.relational.planning uses a module listed above it, which is the healthy direction.
helix_planner.relational.planning uses helix_planner.relational.value, so a change to helix_planner.relational.value can break helix_planner.relational.planning, while a change to helix_planner.relational.planning can't break helix_planner.relational.value.
Position
Below the diagonal: helix_planner.relational.planning uses a module listed above it, which is the healthy direction.
helix_planner.relational.planning uses helix_planner.context.planner, so a change to helix_planner.context.planner can break helix_planner.relational.planning, while a change to helix_planner.relational.planning can't break helix_planner.context.planner.
Position
Below the diagonal: helix_planner.relational.planning uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses db.encoding.v2.keys.scope, so a change to db.encoding.v2.keys.scope can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break db.encoding.v2.keys.scope.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses db.query_resources, so a change to db.query_resources can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break db.query_resources.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses helix_ast.query, so a change to helix_ast.query can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break helix_ast.query.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses helix_planner.ir.contracts.at_least, so a change to helix_planner.ir.contracts.at_least can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break helix_planner.ir.contracts.at_least.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses helix_planner.ir.contracts.non_empty_string, so a change to helix_planner.ir.contracts.non_empty_string can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break helix_planner.ir.contracts.non_empty_string.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses helix_planner.relational.query, so a change to helix_planner.relational.query can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break helix_planner.relational.query.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses db.cypher, so a change to db.cypher can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break db.cypher.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses db.execution.interpreter.types, so a change to db.execution.interpreter.types can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break db.execution.interpreter.types.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses db.index_lifecycle.model, so a change to db.index_lifecycle.model can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break db.index_lifecycle.model.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses helix_ast.traversal, so a change to helix_ast.traversal can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break helix_ast.traversal.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses helix_planner.catalog.property, so a change to helix_planner.catalog.property can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break helix_planner.catalog.property.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses db.config.indexes, so a change to db.config.indexes can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break db.config.indexes.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses db, so a change to db can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break db.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses db.search.text, so a change to db.search.text can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break db.search.text.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
db.execution.interpreter.runtime_context uses helix_planner.relational.planning, so a change to helix_planner.relational.planning can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break helix_planner.relational.planning.
Position
Below the diagonal: db.execution.interpreter.runtime_context uses a module listed above it, which is the healthy direction.
helix_planner.catalog.element uses helix_planner.diagnostics.analyze, so a change to helix_planner.diagnostics.analyze can break helix_planner.catalog.element, while a change to helix_planner.catalog.element can't break helix_planner.diagnostics.analyze.
Position
Below the diagonal: helix_planner.catalog.element uses a module listed above it, which is the healthy direction.
helix_planner.logical.access.path uses helix_planner.ir.contracts.non_empty_string, so a change to helix_planner.ir.contracts.non_empty_string can break helix_planner.logical.access.path, while a change to helix_planner.logical.access.path can't break helix_planner.ir.contracts.non_empty_string.
Position
Below the diagonal: helix_planner.logical.access.path uses a module listed above it, which is the healthy direction.
helix_planner.logical.access.path uses helix_planner.catalog.element, so a change to helix_planner.catalog.element can break helix_planner.logical.access.path, while a change to helix_planner.logical.access.path can't break helix_planner.catalog.element.
Position
Below the diagonal: helix_planner.logical.access.path uses a module listed above it, which is the healthy direction.
helix_planner.properties.delivered uses helix_planner.catalog.element, so a change to helix_planner.catalog.element can break helix_planner.properties.delivered, while a change to helix_planner.properties.delivered can't break helix_planner.catalog.element.
Position
Below the diagonal: helix_planner.properties.delivered uses a module listed above it, which is the healthy direction.
helix_planner.exec.lowering uses helix_planner.cost.vector, so a change to helix_planner.cost.vector can break helix_planner.exec.lowering, while a change to helix_planner.exec.lowering can't break helix_planner.cost.vector.
Position
Below the diagonal: helix_planner.exec.lowering uses a module listed above it, which is the healthy direction.
helix_planner.exec.lowering uses helix_planner.ir.contracts.at_least, so a change to helix_planner.ir.contracts.at_least can break helix_planner.exec.lowering, while a change to helix_planner.exec.lowering can't break helix_planner.ir.contracts.at_least.
Position
Below the diagonal: helix_planner.exec.lowering uses a module listed above it, which is the healthy direction.
helix_planner.exec.lowering uses helix_planner.ir.contracts.non_empty_string, so a change to helix_planner.ir.contracts.non_empty_string can break helix_planner.exec.lowering, while a change to helix_planner.exec.lowering can't break helix_planner.ir.contracts.non_empty_string.
Position
Below the diagonal: helix_planner.exec.lowering uses a module listed above it, which is the healthy direction.
helix_planner.exec.lowering uses helix_planner.logical.core.expr, so a change to helix_planner.logical.core.expr can break helix_planner.exec.lowering, while a change to helix_planner.exec.lowering can't break helix_planner.logical.core.expr.
Position
Below the diagonal: helix_planner.exec.lowering uses a module listed above it, which is the healthy direction.
helix_planner.exec.lowering uses helix_planner.cost.profile, so a change to helix_planner.cost.profile can break helix_planner.exec.lowering, while a change to helix_planner.exec.lowering can't break helix_planner.cost.profile.
Position
Below the diagonal: helix_planner.exec.lowering uses a module listed above it, which is the healthy direction.
helix_planner.exec.lowering uses helix_planner.ir.access.edge, so a change to helix_planner.ir.access.edge can break helix_planner.exec.lowering, while a change to helix_planner.exec.lowering can't break helix_planner.ir.access.edge.
Position
Below the diagonal: helix_planner.exec.lowering uses a module listed above it, which is the healthy direction.
helix_planner.exec.lowering uses helix_planner.ir.access.node, so a change to helix_planner.ir.access.node can break helix_planner.exec.lowering, while a change to helix_planner.exec.lowering can't break helix_planner.ir.access.node.
Position
Below the diagonal: helix_planner.exec.lowering uses a module listed above it, which is the healthy direction.
helix_planner.exec.lowering uses helix_planner.logical.access.path, so a change to helix_planner.logical.access.path can break helix_planner.exec.lowering, while a change to helix_planner.exec.lowering can't break helix_planner.logical.access.path.
Position
Below the diagonal: helix_planner.exec.lowering uses a module listed above it, which is the healthy direction.
helix_planner.exec.lowering uses helix_planner.properties.delivered, so a change to helix_planner.properties.delivered can break helix_planner.exec.lowering, while a change to helix_planner.exec.lowering can't break helix_planner.properties.delivered.
Position
Below the diagonal: helix_planner.exec.lowering uses a module listed above it, which is the healthy direction.
helix_planner.rules.contracts.metadata uses helix_planner.properties.delivered, so a change to helix_planner.properties.delivered can break helix_planner.rules.contracts.metadata, while a change to helix_planner.rules.contracts.metadata can't break helix_planner.properties.delivered.
Position
Below the diagonal: helix_planner.rules.contracts.metadata uses a module listed above it, which is the healthy direction.
helix_planner.optimizer.rule uses helix_planner.logical.core.expr, so a change to helix_planner.logical.core.expr can break helix_planner.optimizer.rule, while a change to helix_planner.optimizer.rule can't break helix_planner.logical.core.expr.
Position
Below the diagonal: helix_planner.optimizer.rule uses a module listed above it, which is the healthy direction.
helix_planner.optimizer.rule uses helix_planner.cost.profile, so a change to helix_planner.cost.profile can break helix_planner.optimizer.rule, while a change to helix_planner.optimizer.rule can't break helix_planner.cost.profile.
Position
Below the diagonal: helix_planner.optimizer.rule uses a module listed above it, which is the healthy direction.
helix_planner.optimizer.rule uses helix_planner.catalog.snapshot, so a change to helix_planner.catalog.snapshot can break helix_planner.optimizer.rule, while a change to helix_planner.optimizer.rule can't break helix_planner.catalog.snapshot.
Position
Below the diagonal: helix_planner.optimizer.rule uses a module listed above it, which is the healthy direction.
helix_planner.optimizer.rule uses helix_planner.rules.contracts.metadata, so a change to helix_planner.rules.contracts.metadata can break helix_planner.optimizer.rule, while a change to helix_planner.optimizer.rule can't break helix_planner.rules.contracts.metadata.
Position
Below the diagonal: helix_planner.optimizer.rule uses a module listed above it, which is the healthy direction.
helix_planner.rules.cardinality uses helix_ast.query, so a change to helix_ast.query can break helix_planner.rules.cardinality, while a change to helix_planner.rules.cardinality can't break helix_ast.query.
Position
Below the diagonal: helix_planner.rules.cardinality uses a module listed above it, which is the healthy direction.
helix_planner.rules.cardinality uses helix_planner.cost.vector, so a change to helix_planner.cost.vector can break helix_planner.rules.cardinality, while a change to helix_planner.rules.cardinality can't break helix_planner.cost.vector.
Position
Below the diagonal: helix_planner.rules.cardinality uses a module listed above it, which is the healthy direction.
helix_planner.rules.cardinality uses helix_planner.ir.contracts.at_least, so a change to helix_planner.ir.contracts.at_least can break helix_planner.rules.cardinality, while a change to helix_planner.rules.cardinality can't break helix_planner.ir.contracts.at_least.
Position
Below the diagonal: helix_planner.rules.cardinality uses a module listed above it, which is the healthy direction.
helix_planner.rules.cardinality uses helix_planner.catalog.property, so a change to helix_planner.catalog.property can break helix_planner.rules.cardinality, while a change to helix_planner.rules.cardinality can't break helix_planner.catalog.property.
Position
Below the diagonal: helix_planner.rules.cardinality uses a module listed above it, which is the healthy direction.
helix_planner.rules.cardinality uses helix_planner.cost.profile, so a change to helix_planner.cost.profile can break helix_planner.rules.cardinality, while a change to helix_planner.rules.cardinality can't break helix_planner.cost.profile.
Position
Below the diagonal: helix_planner.rules.cardinality uses a module listed above it, which is the healthy direction.
helix_planner.rules.cardinality uses helix_planner.ir.access.edge, so a change to helix_planner.ir.access.edge can break helix_planner.rules.cardinality, while a change to helix_planner.rules.cardinality can't break helix_planner.ir.access.edge.
Position
Below the diagonal: helix_planner.rules.cardinality uses a module listed above it, which is the healthy direction.
helix_planner.rules.cardinality uses helix_planner.ir.access.node, so a change to helix_planner.ir.access.node can break helix_planner.rules.cardinality, while a change to helix_planner.rules.cardinality can't break helix_planner.ir.access.node.
Position
Below the diagonal: helix_planner.rules.cardinality uses a module listed above it, which is the healthy direction.
helix_planner.rules.cardinality uses helix_planner.logical.access.path, so a change to helix_planner.logical.access.path can break helix_planner.rules.cardinality, while a change to helix_planner.rules.cardinality can't break helix_planner.logical.access.path.
Position
Below the diagonal: helix_planner.rules.cardinality uses a module listed above it, which is the healthy direction.
helix_planner.rules.cardinality uses helix_planner.rules.contracts.metadata, so a change to helix_planner.rules.contracts.metadata can break helix_planner.rules.cardinality, while a change to helix_planner.rules.cardinality can't break helix_planner.rules.contracts.metadata.
Position
Below the diagonal: helix_planner.rules.cardinality uses a module listed above it, which is the healthy direction.
helix_planner.rules.cardinality uses helix_planner.optimizer.rule, so a change to helix_planner.optimizer.rule can break helix_planner.rules.cardinality, while a change to helix_planner.rules.cardinality can't break helix_planner.optimizer.rule.
Position
Below the diagonal: helix_planner.rules.cardinality uses a module listed above it, which is the healthy direction.
helix_planner.rules.registry uses helix_planner.rules.cardinality, so a change to helix_planner.rules.cardinality can break helix_planner.rules.registry, while a change to helix_planner.rules.registry can't break helix_planner.rules.cardinality.
Position
Below the diagonal: helix_planner.rules.registry uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 63% · Adequate · gated by 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
181
High / Critical
A03:2025 — Software Supply Chain Failures
84
High / Critical
A02:2025 — Security Misconfiguration
12
High / Critical
A07:2025 — Authentication Failures
7
High / Critical
Roadmap
Top priorities: Enforce authorization at every handler — a guard on each route, or a global authentication guard/middleware with explicit public opt-outs, so protected-by-default is demonstrable; Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only; Resolve the 6 REDACTED finding(s) in Secrets (history) — start with REDACTED (6).
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Enforce authorization at every handler — a guard on each route, or a global authentication guard/middleware with explicit public opt-outs, so protected-by-default is demonstrable.
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
Per-file score 0–10 — a quality signature. Of 436 files carrying findings, judged against the Production bar: 1% slop · 63% mixed · 36% near-clean.
File
Score
Band
Worst signal
REDACTED
0.4
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.7
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
0.9
Slop
Dependency Vulnerabilities: High CVE: REDACTED
REDACTED
1.6
Slop
Dependency Vulnerabilities: High CVE: REDACTED
REDACTED
2.4
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
3.0
Slop
Dependency Vulnerabilities: High CVE: REDACTED
REDACTED
4.0
Mixed
Static Analysis (SAST): Medium: REDACTED
REDACTED
4.4
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
4.4
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
4.4
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
4.4
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
4.4
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
4.4
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
4.5
Mixed
Secrets (history): REDACTED: REDACTED
REDACTED
4.5
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
4.5
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
4.6
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
5.1
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
5.1
Mixed
Static Analysis (SAST): High: REDACTED
REDACTED
5.1
Mixed
Static Analysis (SAST): High: REDACTED
How the grades work
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 167
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 — 1815
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 — 67
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 16
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 70 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 — 70 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, 2024 of 2049 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.
D8 Code Coverage — 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. Coverage NOT MEASURED: the Rust half could not be measured — the Cargo suite in repository root did not build, so it was never run. Coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo — a coverage step in CI (`coverage run`) shows coverage is measured in your own CI.
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 6 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 620 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 source is present (.rs, .py, .ts) and this repository declares a Cargo test suite (repository root, 1115 test files), but it was not re-run: its build outgrew the 12 GB scratch ceiling (12.019 GB measured) and was stopped; its suite was not run. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — 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. Not scored — 1 Maven/Gradle manifest(s) were read, stating a version for 0 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
D14 License Compliance — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — measured, with a gap in what it reached — We measured this, but not all of it. What we did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. PREREGISTRATION version 20's fallback (adjudication D21-sample3-v3): this rule kind was adjudicated below the 95 % precision gate, so its candidates are counted here and not published, and the score covers only the acronym-spelling and awaitable-suffix rules. The kind returns as rows only after it shows a measured precision; this says nothing about whether these names are consistent.
D22 Internal API Consistency — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — 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. `REDACTED`, `sdks/typescript/src/dsl.ts` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AX1 Captive dependencies — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and this repository defines its own container in sdks/typescript/src/dsl.ts, whose lifetimes are not modelled yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
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 REDACTED (REDACTED). docker build failed (exit 1) — ------ REDACTED:42 -------------------- 40 | /tmp/runtime-root/var/cache/helix 41 | 42 | >>> FROM ${RUNTIME_IMAGE} 43 | 44 | COPY --from=builder /tmp/runtime-root/ / -------------------- ERROR: failed to solve: gcr.io/distroless/cc-debian12:nonroot: failed to do request: Head "https://gcr.io/v2/distroless/cc-debian12/manifests/nonroot": Forbidden; runtime evidence skipped.
GD1 Unfinished & placeholder code — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Go, Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Go, Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — 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.
P5 DR & Backup — 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. No backup/snapshot/replication config, RTO/RPO or restore-procedure documentation was found — and no production persistence was detected either (no data-access packages, no data-store services, no database resources), so there is nothing in this repository whose loss a DR control would recover. If this system's data lives in a platform or ops repo we can't see, that's where the DR evidence belongs.
X12 Unreachable branch — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X13 Undrained process stream — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover most of the languages this repository's product is written in. What it read is kept, but it is too small a share to grade the product by. That is a gap in this analyzer's language reach — not a finding about this repository.
X16 Unfloored truncation loop — not measured this run — We could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check'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.
X17 Uncapped recursion over a caller-supplied document — 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: 6 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
We assess the repository exactly as committed, and only the repository. By design we do not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality checks the structure of the decision records present: it cannot know about decisions made and never recorded, and it does not judge how well a record argues its case. Records in a language the section lexicon does not cover are not evaluated.
D21 Naming Consistency: Naming consistency compares each name with the convention its structural peers follow in this repository: it cannot tell whether a consistently used name is a good one, and languages other than C# and TypeScript are not measured.
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 requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
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.
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".
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.
178 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was db::execution::interpreter::pull::poll::step at 104. A further 66 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 QueryErrorCode::as_str at 89 — they are counted neither in the figure above nor in this dimension's score. 36 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: crates/ast/src/error_code.rs (QueryErrorCode::as_str at 89), crates/planner/src/planning/envelope/root_kind.rs (helix_planner::planning::envelope::root_kind::ast_root_kind at 83), crates/ast/src/testing/variants.rs (helix_ast::testing::variants::ast_variant at 80), crates/ast/src/traversal.rs (Operation::apply at 65), crates/db/src/error.rs (HelixDbError::error_code at 54), and 31 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.
+ 72 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 7 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with db::execution::interpreter::pull::poll::step (cyclomatic 104), VectorIndex::search_layer0_with_simhash (cyclomatic 100), helix_planner::relational::planning::plan_accesses (cyclomatic 84). — 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 7 together lifts Cyclomatic Complexity from 6.0 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 101 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 VectorIndex::search_layer0_with_simhash (cognitive 241), helix_planner::relational::planning::plan_accesses (cognitive 229), db::execution::interpreter::pull::poll::step (cognitive 195). — 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 5.1 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.5 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 75 FileTooLong finding(s) in God Classes — start with mod.rs (8), driver.rs (2), lib.rs (2). — One of this dimension's main actionable groups (75 warning-level).
Resolve the 72 FunctionTooLong finding(s) in God Classes — start with contracts.rs (10), mod.rs (6), secondary.rs (6). — One of this dimension's main actionable groups (72 warning-level).
Resolve the 65 MethodTooLong finding(s) in God Classes — start with count.rs (6), mod.rs (5), secondary.rs (3). — One of this dimension's main actionable groups (65 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.
508 duplicated block group(s) detected. 5.2 % of the production lines (23,622 of 452,321) are in a reported copy. A further 357 rows report members as variants of one another; the share counts each copied line once, however many rows cite it. 7 of the 865 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.
+ 216 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 41 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with secondary.rs (4), driver.rs (2), mod.rs (2). — One of this dimension's main actionable groups (41 warning-level).
Resolve the 39 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with edge.rs (5), count.rs (4), driver.rs (3). — One of this dimension's main actionable groups (39 warning-level).
Resolve the 33 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with mod.rs (7), count.rs (4), edge.rs (3). — One of this dimension's main actionable groups (33 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.1 / 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.
21 production modules (Cargo+npm+Go+Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 5 module(s) off the main sequence, with abstractness counted on 16 of the 21 (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: helix-graph-algorithms · ×5
What to do
Resolve the 5 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (5 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 db.rs, json.rs, indexes.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.
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 6 tests. Measured on the JavaScript/TypeScript suite only — at least 620 test source file(s) (.rs, .py) went unread, so its test quality is unmeasured and is not in these counts.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 571 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 3 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. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
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: crates/planner/src/relational/planning.rs (28×84=2352); crates/db/src/index_lifecycle/secondary.rs (60×28=1680); crates/db/src/lib.rs (91×16=1456) Repeated repair below the complexity floor: crates/cli/src/local_runtime.rs (29 of 48 changes were fixes); crates/db/src/search/text/cache.rs (13 of 14 changes were fixes); crates/planner/src/rules/access/filter/index/membership.rs (4 of 7 changes were fixes)
Resolve the 65 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (6), driver.rs (2), pipeline.rs (2). — One of this dimension's main actionable groups (65 warning-level).
Resolve the 11 Repeated repair finding(s) in Churn × Complexity Hotspots — start with local_runtime.rs, cache.rs, membership.rs. — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor7.0 / 10Adequate✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
295 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/db/src/search/vector/hnsw/mutation/mod.rs. Counted over 966 of the 1495 production source files in this repository: 528 are under the ~2,400-byte size floor this dimension measures over, and the remaining 1 have no attributable history left to measure.
Off-boarding risk: anonymized user #1 · ×2
Further sole-owners (lower concentration)
What to do
Resolve the 2 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (2 recommendation-level).
Resolve the 1 Further sole-owners (lower concentration) finding(s) in Bus Factor. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
0 deducted task-comment markers across 452321 LoC (0.0/KLoC) → score 10.0. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 153 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 Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Every ADR read by its section structure: nine located rules (a missing Decision, Context or Consequences section, a stale status, two records deciding the same question, a dangling supersede link, a number-only title, a single option, no named cost, no status where the log uses one, no enforcement field where the log adopted one), each a fixed deduction from 10; the score is the mean over evaluated records. Deterministic, no model. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Seven vocabulary-free rules (N1-N7) mine each naming convention from the repository and flag a name that breaks a convention its structural peers in the same unit follow; production C# and TypeScript, each its own population. Deterministic, no model, no sample. Advisory.
3 naming inconsistencies among 67 declarations measured against a convention their peers follow.
`externalID` spells `ID` where 26 names in the project spell it `Id` · ×2sdks/typescript/scripts/parity/generate-fixtures.ts:98
`QueryJson` spells `Json` where 38 names in the project spell it `JSON`sdks/go/client.go:111
What to do
Resolve the 2 `externalID` spells `ID` where 26 names in the project spell it `Id` finding(s) in Naming Consistency — start with generate-fixtures.ts (2). — One of this dimension's main actionable groups (2 recommendation-level).
Resolve the 1 `QueryJson` spells `Json` where 38 names in the project spell it `JSON` finding(s) in Naming Consistency — start with client.go. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d21_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.
3 of 22 build units (Cargo, Go, Python, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
6 finding(s): 0 critical, 6 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 6 REDACTED finding(s) in Secrets (history) — start with REDACTED (6). — One of this dimension's main actionable groups (6 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
181 finding(s): 0 critical, 150 high, 29 medium, 2 low. 143 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 12 file(s) — `crates/cli/src/commands/doctor.rs` (line 681, line 682, line 683), `crates/db/fuzz/corpus/current_search_records/text-live-state.json`, `crates/db/fuzz/corpus/current_search_records/text-manifest.json`, `crates/db/src/index_lifecycle/queue/overlay_tests.rs` (line 818, line 1188, line 1610, …), `crates/db/src/index_lifecycle/queue/publication_tests.rs` (line 2696, line 2760, line 2890, …), … (+7 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 5 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 3 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
No action in Static Analysis (SAST) — all 143 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 (143 issue-level, 0 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05. Advisory since rubric-2026.11.2 (CAI decision 0006): every row is a match against a vulnerability database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
Resolve the 27 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (27). — One of this dimension's main actionable groups (27 warning-level).
Resolve the 21 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (21). — One of this dimension's main actionable groups (21 warning-level).
Resolve the 6 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (6). — One of this dimension's main actionable groups (6 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 5 High IaC finding(s) in IaC & Container Security — start with REDACTED (5). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 4 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 warning-level).
Resolve the 3 Low IaC finding(s) in IaC & Container Security — start with REDACTED (2), REDACTED. — One of this dimension's main actionable groups (3 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
1 of 967 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is crates/db/src/search/vector/access/read_view.rs. Counted over 967 of the 1495 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.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Reported apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. Advisory since rubric-2026.11.2 (CAI decision 0006): the malicious-package feed is a database that changes daily, so the reading is shown and never moves a scored dimension, lens or the headline.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 2 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Do you agree with this assessment?
C2 · Access Controls3.0 / 10Weak✓ 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 rules exist but no route guard, auth middleware or handler that refuses a caller was found.
What to do
Enforce authorization at every handler — a guard on each route, or a global authentication guard/middleware with explicit public opt-outs, so protected-by-default is demonstrable.
Other · Domain Modelling — Whether an aggregate references another aggregate by identity rather than embedding it by object reference.
Method: Roslyn (DDD-gated): aggregate roots identified by convention; each aggregate field checked for direct references to other aggregates versus id-only. Deterministic, DDD-native.
Coverage: Population: aggregate roots identified by AggregateRoot/IAggregateRoot base/interface NAME convention; reference-by-identity then checked exhaustively within that set — a root not using those names is invisible.
Other · Domain Modelling — Whether domain identifiers are strongly typed (a newtype wrapper) rather than raw primitives — consistency once an idiom exists.
Method: Roslyn (DDD-gated): strongly-typed id adoption on domain entities/events; raw Guid/int/string ids counted versus wrapped types. An id wrapper is recognised by VALUE SEMANTICS, not by being a struct — a record struct, a record class (`record ApartmentId(Guid Value)`) or a class declared by a typed-id base (`class MemberId : TypedIdValueBase`) all count, while a plain mutable class (reference equality) and a verb-phrase query record (`GetCustomerById`) do not. Deterministic, adoption percentage.
Coverage: Population: id-like members by *Id/*Key NAME suffix; strongly-typed-ID shape then checked semantically — non-suffixed identifiers are not seen.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ 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.
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.
Maturity · Maturity — Whether the repository and its projects have a README, and whether it is substantive.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repository is organised deliberately: production code and tests are set apart in a way its ecosystem or the repository itself declares.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Maturity · Maturity — Whether the project's current-state documentation describes the code that exists.
Method: Every current-state document's checkable claims looked up in the tree (links, versions, and artefact counts an order of magnitude off), plus two README checks: an advertised infrastructure product with no footprint, and a module the CHANGELOG records as removed. Deterministic, no model. Advisory.
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.
Readiness · Readiness — Whether behaviour is captured as executable Gherkin specifications (a plus for shared understanding) — only assessed when a BDD framework is present.
Method: Filesystem scan: BDD framework presence (SpecFlow, Gherkin files) when a project references a BDD tool. Exhaustive, deterministic.
Do you agree with this assessment?
P2 · Observability6.0 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 3/9 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `bindings/uniffi`, `bindings/uniffi-bindgen`, `crates/cli`, `sdks/go` and 1 more.
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.
`docs/package.json` 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`. — docs/package.json:10
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.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. (×2) — crates/cli/src/commands/cypher.rs:59, crates/cli/src/commands/query.rs:136
`urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — REDACTED:408
What to do
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
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.
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 Safety8.4 / 10Strong✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
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.
sdks/typescript/src/dsl.ts:2601 · sdks/typescript/src/dsl.ts:2670 — 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. — sdks/typescript/src/dsl.ts:2601
sdks/typescript/scripts/parity/compare-json.ts:33 · sdks/typescript/scripts/parity/run-helix.ts:339 — the two spans are one implementation copied and then locally edited — 414 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. — sdks/typescript/scripts/parity/compare-json.ts:33
sdks/typescript/scripts/parity/run-embedded-client.ts:93 · sdks/typescript/scripts/parity/run-helix.ts:260 — the two spans are one implementation copied and then locally edited — 456 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. — sdks/typescript/scripts/parity/run-embedded-client.ts:93
sdks/typescript/src/dsl.ts:2099 · sdks/typescript/src/dsl.ts:2137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — sdks/typescript/src/dsl.ts:2099
sdks/typescript/src/dsl.ts:495 · sdks/typescript/src/dsl.ts:526 — 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. — sdks/typescript/src/dsl.ts:495
sdks/typescript/src/dsl.ts:2000 · sdks/typescript/src/dsl.ts:2028 — 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. — sdks/typescript/src/dsl.ts:2000
sdks/typescript/src/dsl.ts:2579 · sdks/typescript/src/dsl.ts:2646 — 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. — sdks/typescript/src/dsl.ts:2579
sdks/typescript/src/index.ts:376 · sdks/typescript/src/index.ts:392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — sdks/typescript/src/index.ts:376
sdks/typescript/src/dsl.ts:2062 · sdks/typescript/src/dsl.ts:2172 — 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. — sdks/typescript/src/dsl.ts:2062
sdks/typescript/src/dsl.ts:1106 · sdks/typescript/src/dsl.ts:1121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — sdks/typescript/src/dsl.ts:1106
sdks/typescript/src/dsl.ts:2923 · sdks/typescript/src/dsl.ts:2988 — 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. — sdks/typescript/src/dsl.ts:2923
bindings/uniffi/smoke-node.mjs:154 · bindings/uniffi/smoke-node.mjs:174 — 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. — bindings/uniffi/smoke-node.mjs:154
sdks/typescript/scripts/parity/run-embedded-parity.ts:317 · sdks/typescript/scripts/parity/run-helix.ts:391 — 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. — sdks/typescript/scripts/parity/run-embedded-parity.ts:317
sdks/typescript/src/dsl.ts:521 · sdks/typescript/src/dsl.ts:551 — 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. — sdks/typescript/src/dsl.ts:521
sdks/typescript/src/dsl.ts:1086 · sdks/typescript/src/dsl.ts:1098 — 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. — sdks/typescript/src/dsl.ts:1086
sdks/typescript/scripts/parity/generate-fixtures.ts:492 · sdks/typescript/scripts/parity/generate-fixtures.ts:522 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — sdks/typescript/scripts/parity/generate-fixtures.ts:492
sdks/typescript/scripts/edge-drop-regression.ts:23 · sdks/typescript/scripts/edge-drop-regression.ts:38 — 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. — sdks/typescript/scripts/edge-drop-regression.ts:23
sdks/typescript/src/dsl.ts:717 · sdks/typescript/src/dsl.ts:724 · sdks/typescript/src/dsl.ts:734 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — sdks/typescript/src/dsl.ts:717
sdks/typescript/scripts/parity/generate-fixtures.ts:669 · sdks/typescript/scripts/parity/generate-fixtures.ts:691 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases. — sdks/typescript/scripts/parity/generate-fixtures.ts:669
sdks/typescript/scripts/parity/run-embedded-parity.ts:310 · sdks/typescript/scripts/parity/run-helix.ts:386 — 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. — sdks/typescript/scripts/parity/run-embedded-parity.ts:310
sdks/typescript/src/dsl.ts:2192 · sdks/typescript/src/dsl.ts:2199 — 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. — sdks/typescript/src/dsl.ts:2192
sdks/typescript/src/dsl.ts:2240 · sdks/typescript/src/dsl.ts:2246 — 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. — sdks/typescript/src/dsl.ts:2240
sdks/typescript/src/dsl.ts:2261 · sdks/typescript/src/dsl.ts:2267 · sdks/typescript/src/dsl.ts:2273 · sdks/typescript/src/dsl.ts:2282 · +6 more site(s) not listed — all 10 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. — sdks/typescript/src/dsl.ts:2261
sdks/typescript/src/dsl.ts:2270 · sdks/typescript/src/dsl.ts:2372 · sdks/typescript/src/dsl.ts:2378 · sdks/typescript/src/dsl.ts:2390 — all 4 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. — sdks/typescript/src/dsl.ts:2270
sdks/typescript/src/dsl.ts:2312 · sdks/typescript/src/dsl.ts:2318 · sdks/typescript/src/dsl.ts:2336 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — sdks/typescript/src/dsl.ts:2312
sdks/typescript/src/dsl.ts:2369 · sdks/typescript/src/dsl.ts:2375 — 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. — sdks/typescript/src/dsl.ts:2369
sdks/typescript/src/index.ts:585 · sdks/typescript/src/index.ts:687 — 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. — sdks/typescript/src/index.ts:585
sdks/typescript/scripts/parity/generate-fixtures.ts:758 · sdks/typescript/scripts/parity/generate-fixtures.ts:778 — 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. — sdks/typescript/scripts/parity/generate-fixtures.ts:758
What to do
Act on each finding's own remediation rather than one rule: the move depends on what recurs. Where the copies are executable blocks, give the shared part one home and call it from each site; where they are declarations, a listing, a specialisation already delegating to its base, or one shape repeated per entity, there is no call site and the move is a shared type, a generated set or a factory — sometimes there is nothing to extract.
React / JS · Code Health — Per-function cyclomatic/cognitive complexity from the token-level function scanner (D-386) — real branching, not a regex heuristic.
Method: Per-function cyclomatic/cognitive complexity from a token-level function scanner (real branching, not a regex heuristic), computed over every frontend function. Deterministic.
remote has cyclomatic complexity 25 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdks/typescript/src/index.ts:135
convertParamValue has cyclomatic complexity 23 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — sdks/typescript/src/dsl.ts:2917
normalizeTypedQueryValue has cyclomatic complexity 22 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. — sdks/typescript/src/dsl.ts:2981
from has cyclomatic complexity 19 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdks/typescript/src/dsl.ts:417
quoteUnsafeIntegerTokens has cyclomatic complexity 16 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdks/typescript/src/dsl.ts:97
stringifyEncoded has cyclomatic complexity 16 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. — sdks/typescript/src/dsl.ts:160
parseIndexOperationStatus has cyclomatic complexity 16 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdks/typescript/src/dsl.ts:1317
constructor has cyclomatic complexity 14 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdks/typescript/src/graph.ts:46
encode has cyclomatic complexity 12 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 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. — sdks/typescript/src/dsl.ts:10
execute has cyclomatic complexity 12 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 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. — sdks/typescript/src/index.ts:653
(anonymous) has cyclomatic complexity 12 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. — sdks/typescript/scripts/parity/cypher-results.ts:80
(top-level) has cyclomatic complexity 11 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — REDACTED:2
Do you agree with this assessment?
R3 · Large Files2.9 / 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.
sdks/typescript/src/dsl.ts has 3144 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdks/typescript/src/dsl.ts:1
sdks/typescript/scripts/parity/generate-fixtures.ts has 1286 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdks/typescript/scripts/parity/generate-fixtures.ts:1
sdks/typescript/src/index.ts has 666 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — sdks/typescript/src/index.ts:1
What to do
Split each oversized file along the responsibilities already in it, into smaller focused modules in the same package.
Do you agree with this assessment?
R4 · Test Coverage3.3 / 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. (×10) — sdks/typescript/scripts/parity/generate-fixtures.ts:1, sdks/typescript/scripts/parity/run-helix.ts:1, sdks/typescript/scripts/parity/run-embedded-parity.ts:1, …
What to do
Add tests that import the unreached modules (directly or through their public entry).
React / JS · Readiness — How outdated the npm dependencies are (a maturity signal). JS/npm CVEs are scored separately in D30 (JS/npm Dependency Vulnerabilities).
Method: npm dependency staleness from manifest/registry metadata (a maturity signal; JS/npm CVEs are scored separately in D30, which answers dependency vulnerabilities for every ecosystem). Deterministic.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
Do you agree with this assessment?
R7 · Dead Code9.1 / 10Exemplary✓ 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 16 application, 4 tooling and 11 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 (16 application, 4 tooling, 11 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 (×2) — sdks/typescript/scripts/parity/run-embedded-client.ts, sdks/typescript/scripts/edge-drop-regression.ts
Nothing imports this binding — it is safe to review for removal. — sdks/typescript/scripts/parity/paths.ts:15
Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect. (×2) — sdks/typescript/src/dsl.ts:2584, sdks/typescript/src/dsl.ts:2651
What to do
Delete the dead files and unused exports — every line is maintenance cost and rebuild-estimate inflation with zero runtime value.
React / JS · Readiness — npm dependency truthfulness (D-386): unused dependencies, imports not declared anywhere, and type-/test-only packages shipped as production deps.
Method: npm dependency truthfulness: unused dependencies, imports declared nowhere, and type-/test-only packages shipped as production deps — from the manifest + import graph. Deterministic.
Declared in sdks/typescript/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
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 serves HTTP itself (`Server::builder()` (crates/server/src/grpc.rs:29)), 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.
This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `Server::builder()` (crates/server/src/grpc.rs:29).
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `Server::builder()` (crates/server/src/grpc.rs:29).
What to do
Secure the server's transport: serve TLS itself (`HttpServer::bind_rustls_0_23(addr, config)` in actix-web, `axum_server::bind_rustls(addr, RustlsConfig::from_pem_file(…))`, tonic's `Server::builder().tls_config(ServerTlsConfig::new().identity(…))`, Rocket's `[default.tls]`), or run it behind a TLS-terminating proxy and check `X-Forwarded-Proto`; send `Strict-Transport-Security` once it is HTTPS-only.
Set security response headers on what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether functions that make a cancellable request accept or pass on a context.Context or 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 4/6 functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial) accept a context.Context or an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` (Go: `ctx context.Context`) 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.
`execute` 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 })`. (×2) — sdks/typescript/src/index.ts:561, sdks/typescript/src/index.ts:653
What to do
Thread a context.Context or an AbortSignal through 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.
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 `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~1.7 `!` null assertions per 1k TypeScript source lines — 10 assertion(s) across the 5872 source line(s) of the 13 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: sdks/typescript/scripts/parity/run-helix.ts (6), sdks/typescript/src/dsl.ts (3), sdks/typescript/src/graph.ts (1). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
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 — 32 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X6 Hand-rolled structured-format parsing — 3 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 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.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 62 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — Frontend below the scale floor (3 DOM element(s) < 25) — too little surface to assess accessibility.
AC2 Forms & labels — Frontend below the scale floor (3 DOM element(s) < 25) — too little surface to assess accessibility.
AC3 Page structure — Frontend below the scale floor (3 DOM element(s) < 25) — too little surface to assess accessibility.
AC4 Keyboard semantics — Frontend below the scale floor (3 DOM element(s) < 25) — too little surface to assess accessibility.
AC5 ARIA correctness — Frontend below the scale floor (3 DOM element(s) < 25) — too little surface to assess accessibility.
AC6 Visual & motion safety — Frontend below the scale floor (3 DOM element(s) < 25) — too little surface to assess accessibility.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No Go request handler (a net/http, Gin, Echo, Fiber or fasthttp handler, or a gRPC service method) is declared as a method or function, and no handler function literal writes a value captured from outside it, so no state is shared between request goroutines. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
AX4 Dependency direction — not applicable to a CQRS architecture (the inward-dependency rule is for layered/clean styles)
AX6 Interface segregation — AX6 reached only 2% of this repository's production lines — rust (425,417 lines), python (14,819 lines), go (5,312 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX8 Test isolation — no test/production split to check
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — docker build failed (exit 1) — ------ REDACTED:42 -------------------- 40 | /tmp/runtime-root/var/cache/helix 41 | 42 | >>> FROM ${RUNTIME_IMAGE} 43 | 44 | COPY --from=builder /tmp/runtime-root/ / -------------------- ERROR: failed to solve: gcr.io/distroless/cc-debian12:nonroot: failed to do request: Head "https://gcr.io/v2/distroless/cc-debian12/manifests/nonroot": Forbidden; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
D12 Dependency Hygiene — Not scored — 1 Maven/Gradle manifest(s) were read, stating a version for 0 dependency(ies) and leaving 0 to a parent or an imported BOM, but no build resolved the dependency graph, so the outdated signal was not established. NOT a finding that these dependencies are current or healthy.
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.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ sibling projects each declaring an entity of their own or taking another project's integration events. Aggregate roots were found in only one source directory (db), which is a layered codebase, not two contexts. 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 — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 2 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not measured — Rust suite
DM3 Integration-event coupling — no integration events detected — coupling check not applicable
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 — no repository abstraction detected (e.g. uses a document session)
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 Event Sourcing — not scored — this repository shows only 1 of the 3 signals this lens looks for (1 aggregate(s) with Apply/When folds)
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — coverage not measured: this check compares the coverage of the analyzer's own test run across the domain and web layers, and that run measured none here — Test coverage (D8) says why
PF2 Allocation hygiene — Not scored: this check counted allocation-aware idioms (Span, pools, stackalloc) per line, which describes what kind of code a repository is rather than whether it has an allocation problem, so it was withdrawn. Nothing here is a finding about your code.
R11 Import Boundaries — No recognizable feature-sliced/layered src layout — boundary rules not applicable.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X12 Unreachable branch — X12 reached only 5% of this repository's production lines — rust (425,417 lines), go (5,312 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X13 Undrained process stream — X13 reached only 5% of this repository's production lines — rust (425,417 lines), go (5,312 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X14 Bypassable address classification — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X16 Unfloored truncation loop — X16 reached only 2% of this repository's production lines — rust (425,417 lines), python (14,819 lines), go (5,312 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X17 Uncapped recursion over a caller-supplied document — X17 reached only 5% of this repository's production lines — rust (425,417 lines), go (5,312 lines) was left unread. Not scored: a score over a minority of the product would be published as the whole of it.
X18 Disposal-pattern correctness — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X19 Unrestored process-global state — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X22 Contradicted release guard — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X23 Unguarded diagnostic materialisation — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X24 Document value interpolated into markup unescaped — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X25 Inert configuration knob — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X26 Unsynchronised callback handoff — not applicable — the code was read and holds no site of this kind, so there is nothing for this check to judge
X3 Exception handling — X3 reached only 6% of this repository's production lines — rust (425,417 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.
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
db::execution::interpreter::pull::poll::step (cognitive 195) crates/db/src/execution/interpreter/pull/poll.rs:72— db::execution::interpreter::pull::poll::step has cognitive complexity 195 (threshold 15). Drivers by points: if/else 47 (130 pts), loops 16 (37 pts), match/switch 10 (26 pts), boolean chains 2 (nesting depth added 120). 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.
db::migrations::preflight_legacy_vector_reservations (cognitive 87) crates/db/src/migrations/mod.rs:1846— db::migrations::preflight_legacy_vector_reservations has cognitive complexity 87 (threshold 15). Drivers by points: if/else 24 (54 pts), match/switch 6 (13 pts), boolean chains 10, loops 9 (10 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db::index_lifecycle::text::driver::scan_partition_documents (cognitive 63) crates/db/src/index_lifecycle/text/driver.rs:1735— db::index_lifecycle::text::driver::scan_partition_documents has cognitive complexity 63 (threshold 15). Drivers by points: if/else 26 (51 pts), match/switch 5 (10 pts), boolean chains 1, loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db::index_lifecycle::secondary::scan_source (cognitive 56) crates/db/src/index_lifecycle/secondary.rs:1796— db::index_lifecycle::secondary::scan_source has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (30 pts), match/switch 9 (20 pts), loops 4 (6 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.
db::index_lifecycle::vector::driver::step_cleanup (cognitive 54) crates/db/src/index_lifecycle/vector/driver.rs:1324— db::index_lifecycle::vector::driver::step_cleanup has cognitive complexity 54 (threshold 15). Drivers by points: if/else 13 (36 pts), match/switch 6 (16 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.
db::index_lifecycle::secondary::secondary_range_scan_bounds (cognitive 52) crates/db/src/index_lifecycle/secondary.rs:4751— db::index_lifecycle::secondary::secondary_range_scan_bounds has cognitive complexity 52 (threshold 15). Drivers by points: if/else 21 (42 pts), match/switch 4 (7 pts), boolean chains 3 (nesting depth added 24). 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.
db::search::text::search_manifest_with_state_source (cognitive 49) crates/db/src/search/text/mod.rs:550— db::search::text::search_manifest_with_state_source has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 4 (12 pts), loops 4 (8 pts), boolean chains 4 (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.
db::index_lifecycle::secondary::release_validated_rows (cognitive 47) crates/db/src/index_lifecycle/secondary.rs:2805— db::index_lifecycle::secondary::release_validated_rows has cognitive complexity 47 (threshold 15). Drivers by points: if/else 14 (41 pts), loops 3 (4 pts), boolean chains 2 (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.
db::index_lifecycle::text::driver::scan_source (cognitive 46) crates/db/src/index_lifecycle/text/driver.rs:2495— db::index_lifecycle::text::driver::scan_source has cognitive complexity 46 (threshold 15). Drivers by points: if/else 19 (37 pts), match/switch 3 (5 pts), boolean chains 2, loops 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.
db::index_lifecycle::outbox::reconcile_legacy_reader_coordination_operations (cognitive 45) crates/db/src/index_lifecycle/outbox.rs:769— db::index_lifecycle::outbox::reconcile_legacy_reader_coordination_operations has cognitive complexity 45 (threshold 15). Drivers by points: if/else 10 (33 pts), loops 4 (8 pts), match/switch 1 (4 pts) (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db::index_lifecycle::text::validation::select_page (cognitive 44) crates/db/src/index_lifecycle/text/validation.rs:239— db::index_lifecycle::text::validation::select_page has cognitive complexity 44 (threshold 15). Drivers by points: if/else 15 (31 pts), loops 3 (5 pts), boolean chains 4, match/switch 2 (4 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db::index_lifecycle::text::statistics::load_overlaid_query_statistics (cognitive 41) crates/db/src/index_lifecycle/text/statistics.rs:137— db::index_lifecycle::text::statistics::load_overlaid_query_statistics has cognitive complexity 41 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 4 (11 pts), boolean chains 2, 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.
db::search::vector::cache::hydration::hydrate_active_generations (cognitive 41) crates/db/src/search/vector/cache/hydration.rs:141— db::search::vector::cache::hydration::hydrate_active_generations has cognitive complexity 41 (threshold 15). Drivers by points: match/switch 10 (22 pts), if/else 9 (18 pts), loops 1 (nesting depth added 21). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
db::index_lifecycle::secondary::delete_generation_rows (cognitive 39) crates/db/src/index_lifecycle/secondary.rs:3055— db::index_lifecycle::secondary::delete_generation_rows has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 3 (8 pts), boolean chains 4, loops 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.
db::index_lifecycle_testing::contracts::family_shapes (cognitive 38) crates/db/src/index_lifecycle_testing/contracts.rs:4442— db::index_lifecycle_testing::contracts::family_shapes has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 7 (16 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.
db::migrations::vector_retirement::release_reservations_batch (cognitive 37) crates/db/src/migrations/vector_retirement.rs:779— db::migrations::vector_retirement::release_reservations_batch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 3 (7 pts), match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db::index_lifecycle::text::manifest::select_page (cognitive 36) crates/db/src/index_lifecycle/text/manifest.rs:155— db::index_lifecycle::text::manifest::select_page has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (28 pts), match/switch 5 (6 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.
db::index_lifecycle::secondary::catch_up_exact (cognitive 35) crates/db/src/index_lifecycle/secondary.rs:2365— db::index_lifecycle::secondary::catch_up_exact has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 5 (13 pts), loops 4 (5 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.
db::migrations::vector_retirement::delete_core_batch (cognitive 34) crates/db/src/migrations/vector_retirement.rs:534— db::migrations::vector_retirement::delete_core_batch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 16 (30 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.
db::index_lifecycle::secondary::exact::ordered::scan_active_range_generation_ordered (cognitive 33) crates/db/src/index_lifecycle/secondary/exact/ordered.rs:183— db::index_lifecycle::secondary::exact::ordered::scan_active_range_generation_ordered has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (25 pts), match/switch 4 (5 pts), boolean chains 2, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db::index_lifecycle::repository::operation_record_cursors_are_valid (cognitive 32) crates/db/src/index_lifecycle/repository.rs:666— db::index_lifecycle::repository::operation_record_cursors_are_valid has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 9 (19 pts), if/else 2 (8 pts), boolean chains 5 (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.
db::index_lifecycle::text::validation::select_entity_state (cognitive 32) crates/db/src/index_lifecycle/text/validation.rs:693— db::index_lifecycle::text::validation::select_entity_state has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 5, match/switch 2 (4 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db::migrations::vector_properties::materialize_batch (cognitive 32) crates/db/src/migrations/vector_properties.rs:138— db::migrations::vector_properties::materialize_batch has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 4 (6 pts), loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db::index_lifecycle::text::active_compaction::compact_once (cognitive 30) crates/db/src/index_lifecycle/text/active_compaction.rs:32— db::index_lifecycle::text::active_compaction::compact_once has cognitive complexity 30 (threshold 15). Drivers by points: if/else 16 (23 pts), boolean chains 3, loops 2 (3 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.
db::index_lifecycle::vector::driver::plan_and_apply (cognitive 30) crates/db/src/index_lifecycle/vector/driver.rs:3165— db::index_lifecycle::vector::driver::plan_and_apply has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 5 (9 pts), match/switch 4 (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.
FileTooLong: index_lifecycle_testing/contracts.rs crates/db/src/index_lifecycle_testing/contracts.rs— FileTooLong — 4036 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 91 free functions. The bar is 500 significant lines; this is 3536 over it, 8.07× 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: index_lifecycle/secondary.rs crates/db/src/index_lifecycle/secondary.rs— FileTooLong — 3595 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 60 free functions. The bar is 500 significant lines; this is 3095 over it, 7.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: helixdb/dsl.py sdks/python/src/helixdb/dsl.py— FileTooLong — 3319 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2819 over it, 6.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: vector/driver.rs crates/db/src/index_lifecycle/vector/driver.rs— FileTooLong — 3053 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 2553 over it, 6.11× 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: mutation/mod.rs crates/db/src/search/vector/hnsw/mutation/mod.rs— FileTooLong — 2821 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 2321 over it, 5.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: migrations/mod.rs crates/db/src/migrations/mod.rs— FileTooLong — 2664 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 60 free functions. The bar is 500 significant lines; this is 2164 over it, 5.33× 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/db/src/lib.rs— FileTooLong — 2633 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 2133 over it, 5.27× 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/dsl.ts sdks/typescript/src/dsl.ts— FileTooLong — 2442 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1942 over it, 4.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: REDACTED REDACTED— FileTooLong — 2293 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1793 over it, 4.59× 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: text/driver.rs crates/db/src/index_lifecycle/text/driver.rs— FileTooLong — 2116 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 31 free functions. The bar is 500 significant lines; this is 1616 over it, 4.23× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: search/mod.rs crates/db/src/search/mod.rs— FileTooLong — 2099 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 149 free functions. The bar is 500 significant lines; this is 1599 over it, 4.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: interpreter/count.rs crates/db/src/execution/interpreter/count.rs— FileTooLong — 1877 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 86% of them inside a single declaration: ExecutionContext (146-2183). The bar is 500 significant lines; this is 1377 over it, 3.75× 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: text/mod.rs crates/db/src/search/text/mod.rs— FileTooLong — 1787 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 77 free functions. The bar is 500 significant lines; this is 1287 over it, 3.57× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: storage/mod.rs crates/db/src/search/vector/storage/mod.rs— FileTooLong — 1667 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 60% of them inside a single declaration: VectorRows (3 blocks, 291-2310). The bar is 500 significant lines; this is 1167 over it, 3.33× 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: rules/cardinality.rs crates/planner/src/rules/cardinality.rs— FileTooLong — 1650 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 50 free functions. The bar is 500 significant lines; this is 1150 over it, 3.30× 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/traversal.rs crates/ast/src/traversal.rs— FileTooLong — 1595 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 1095 over it, 3.19× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: commands/chef.rs crates/cli/src/commands/chef.rs— FileTooLong — 1512 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 33 free functions. The bar is 500 significant lines; this is 1012 over it, 3.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: index_lifecycle/outbox.rs crates/db/src/index_lifecycle/outbox.rs— FileTooLong — 1364 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 32 free functions. The bar is 500 significant lines; this is 864 over it, 2.73× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/index_lifecycle_testing.rs crates/db/src/index_lifecycle_testing.rs— FileTooLong — 1319 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 819 over it, 2.64× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/local_runtime.rs crates/cli/src/local_runtime.rs— FileTooLong — 1293 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 39 free functions. The bar is 500 significant lines; this is 793 over it, 2.59× 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: relational/planning.rs crates/planner/src/relational/planning.rs— FileTooLong — 1256 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 756 over it, 2.51× 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: queue/publication.rs crates/db/src/index_lifecycle/queue/publication.rs— FileTooLong — 1143 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 643 over it, 2.29× 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: diagnostics/analyze.rs crates/planner/src/diagnostics/analyze.rs— FileTooLong — 1112 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 612 over it, 2.22× 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: migrations/vector_simhash_directory.rs crates/db/src/migrations/vector_simhash_directory.rs— FileTooLong — 1024 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 524 over it, 2.05× 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: sql/expr.rs crates/cypher/src/sql/expr.rs— FileTooLong — 986 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 77% of them inside a single declaration: Translator (25-1003). The bar is 500 significant lines; this is 486 over it, 1.97× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FunctionTooLong: helix_planner::relational::planning::plan_accesses crates/planner/src/relational/planning.rs:226— FunctionTooLong — helix_planner::relational::planning::plan_accesses runs 550 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 450 over it, 5.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::index_lifecycle_testing::contracts::run_secondary_mutation_interleaving crates/db/src/index_lifecycle_testing/contracts.rs:1669— FunctionTooLong — db::index_lifecycle_testing::contracts::run_secondary_mutation_interleaving runs 403 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 303 over it, 4.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::execution::interpreter::pull::poll::step crates/db/src/execution/interpreter/pull/poll.rs:72— FunctionTooLong — db::execution::interpreter::pull::poll::step runs 401 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 301 over it, 4.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: helix_cypher::bind::bind_clauses crates/cypher/src/bind.rs:82— FunctionTooLong — helix_cypher::bind::bind_clauses runs 391 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 291 over it, 3.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: db::index_lifecycle::text::driver::scan_partition_documents crates/db/src/index_lifecycle/text/driver.rs:1735— FunctionTooLong — db::index_lifecycle::text::driver::scan_partition_documents runs 383 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 283 over it, 3.83× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::migrations::vector_scale::run_inner crates/db/src/migrations/vector_scale.rs:274— FunctionTooLong — db::migrations::vector_scale::run_inner runs 371 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 271 over it, 3.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::index_lifecycle::text::driver::scan_source crates/db/src/index_lifecycle/text/driver.rs:2495— FunctionTooLong — db::index_lifecycle::text::driver::scan_source runs 306 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 206 over it, 3.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: helix_ast::testing::variants::ast_nodes crates/ast/src/testing/variants.rs:59— FunctionTooLong — helix_ast::testing::variants::ast_nodes runs 284 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 184 over it, 2.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: db::index_lifecycle::text::manifest::select_page crates/db/src/index_lifecycle/text/manifest.rs:155— FunctionTooLong — db::index_lifecycle::text::manifest::select_page runs 277 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 177 over it, 2.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::migrations::preflight_legacy_vector_reservations crates/db/src/migrations/mod.rs:1846— FunctionTooLong — db::migrations::preflight_legacy_vector_reservations runs 267 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 167 over it, 2.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::index_lifecycle::text::active_batch::prepare_destination crates/db/src/index_lifecycle/text/active_batch.rs:811— FunctionTooLong — db::index_lifecycle::text::active_batch::prepare_destination runs 265 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 165 over it, 2.65× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::index_lifecycle::secondary::scan_source crates/db/src/index_lifecycle/secondary.rs:1796— FunctionTooLong — db::index_lifecycle::secondary::scan_source runs 241 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 141 over it, 2.41× 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: db::index_lifecycle_testing::contracts::all_index_validation::run_case crates/db/src/index_lifecycle_testing/contracts/all_index_validation.rs:182— FunctionTooLong — db::index_lifecycle_testing::contracts::all_index_validation::run_case runs 227 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 127 over it, 2.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::index_lifecycle::text::driver::prepare_compaction_step crates/db/src/index_lifecycle/text/driver.rs:1183— FunctionTooLong — db::index_lifecycle::text::driver::prepare_compaction_step runs 212 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 112 over it, 2.12× 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: db::index_lifecycle::secondary::catch_up_exact crates/db/src/index_lifecycle/secondary.rs:2365— FunctionTooLong — db::index_lifecycle::secondary::catch_up_exact runs 202 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 102 over it, 2.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: db::index_lifecycle::text::active_compaction::compact_once crates/db/src/index_lifecycle/text/active_compaction.rs:32— FunctionTooLong — db::index_lifecycle::text::active_compaction::compact_once runs 200 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::index_lifecycle::text::validation::select_page crates/db/src/index_lifecycle/text/validation.rs:239— FunctionTooLong — db::index_lifecycle::text::validation::select_page runs 200 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::index_lifecycle::outbox::execute_claimed_step_with_evidence crates/db/src/index_lifecycle/outbox.rs:1052— FunctionTooLong — db::index_lifecycle::outbox::execute_claimed_step_with_evidence runs 196 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 96 over it, 1.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: helix_ast::nesting::ast_children crates/ast/src/nesting.rs:136— FunctionTooLong — helix_ast::nesting::ast_children runs 193 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::index_lifecycle::text::validation::select_entity_state crates/db/src/index_lifecycle/text/validation.rs:693— FunctionTooLong — db::index_lifecycle::text::validation::select_entity_state runs 191 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 91 over it, 1.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: helix_cypher::lexer::lex crates/cypher/src/lexer.rs:35— FunctionTooLong — helix_cypher::lexer::lex runs 175 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 75 over it, 1.75× 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: helix_ast_arena_derive::expand::enum_deserialize crates/ast-arena-derive/src/expand.rs:414— FunctionTooLong — helix_ast_arena_derive::expand::enum_deserialize runs 164 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 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: helix_planner::relational::planning::index_predicate crates/planner/src/relational/planning.rs:1049— FunctionTooLong — helix_planner::relational::planning::index_predicate runs 163 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::search::text::search_manifest_with_state_source crates/db/src/search/text/mod.rs:550— FunctionTooLong — db::search::text::search_manifest_with_state_source runs 161 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 61 over it, 1.61× 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: db::index_lifecycle_testing::contracts::run_secondary_vector_public_boundaries crates/db/src/index_lifecycle_testing/contracts.rs:193— FunctionTooLong — db::index_lifecycle_testing::contracts::run_secondary_vector_public_boundaries runs 158 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Hotspot: crates/planner/src/relational/planning.rs crates/planner/src/relational/planning.rs:226— crates/planner/src/relational/planning.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in helix_planner::relational::planning::plan_accesses at line 226. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/planner/src/relational/planning.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/db/src/index_lifecycle/secondary.rs crates/db/src/index_lifecycle/secondary.rs:1796— crates/db/src/index_lifecycle/secondary.rs changed 60 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in db::index_lifecycle::secondary::scan_source at line 1796. 8 of those changes were fix/bug commits, and the other 52 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/index_lifecycle/secondary.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/db/src/lib.rs crates/db/src/lib.rs:3418— crates/db/src/lib.rs changed 91 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in HelixDB::run_configured_vector_memory_warm at line 3418. 8 of those changes were fix/bug commits, and the other 83 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/db/src/migrations/mod.rs crates/db/src/migrations/mod.rs:1846— crates/db/src/migrations/mod.rs changed 20 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in db::migrations::preflight_legacy_vector_reservations at line 1846. 1 of those changes was a fix/bug commit, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/migrations/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/db/src/execution/interpreter/count.rs crates/db/src/execution/interpreter/count.rs:1398— crates/db/src/execution/interpreter/count.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in ExecutionContext::count_cursor_leaf at line 1398. 2 of those changes were fix/bug commits, and the other 28 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/execution/interpreter/count.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/cypher/src/bind.rs crates/cypher/src/bind.rs:82— crates/cypher/src/bind.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 74 in helix_cypher::bind::bind_clauses at line 82. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/cypher/src/bind.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/planner/src/relational/evaluation.rs crates/planner/src/relational/evaluation.rs:486— crates/planner/src/relational/evaluation.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in Evaluation::function at line 486. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/planner/src/relational/evaluation.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/db/src/search/vector/hnsw/restricted.rs crates/db/src/search/vector/hnsw/restricted.rs:1148— crates/db/src/search/vector/hnsw/restricted.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in VectorIndex::restricted_filter_aware_search at line 1148. 5 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/search/vector/hnsw/restricted.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/db/src/index_lifecycle/vector/driver.rs crates/db/src/index_lifecycle/vector/driver.rs:3165— crates/db/src/index_lifecycle/vector/driver.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in db::index_lifecycle::vector::driver::plan_and_apply at line 3165. 4 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/index_lifecycle/vector/driver.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/planner/src/rules/cardinality.rs crates/planner/src/rules/cardinality.rs:284— crates/planner/src/rules/cardinality.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in helix_planner::rules::cardinality::fold_cursor at line 284. 5 of those changes were fix/bug commits, and the other 21 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/planner/src/rules/cardinality.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: scripts/validate-cargo-target-references.py scripts/validate-cargo-target-references.py:751— scripts/validate-cargo-target-references.py changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in validate-cargo-target-references.validate_codec_architecture at line 751. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- scripts/validate-cargo-target-references.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/cli/src/main.rs crates/cli/src/main.rs:578— crates/cli/src/main.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in helix_cli::main at line 578. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/cli/src/main.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/db/src/execution/interpreter/rows/mod.rs crates/db/src/execution/interpreter/rows/mod.rs:137— crates/db/src/execution/interpreter/rows/mod.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in ExecutionContext::row_program at line 137. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/execution/interpreter/rows/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/db/src/search/vector/hnsw/mutation/mod.rs crates/db/src/search/vector/hnsw/mutation/mod.rs:2162— crates/db/src/search/vector/hnsw/mutation/mod.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in VectorIndex::relink_neighbor at line 2162. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/search/vector/hnsw/mutation/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/db/src/execution/interpreter/pull/source.rs crates/db/src/execution/interpreter/pull/source.rs:510— crates/db/src/execution/interpreter/pull/source.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in Source::next at line 510. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/execution/interpreter/pull/source.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/db/src/index_lifecycle/text/driver.rs crates/db/src/index_lifecycle/text/driver.rs:1735— crates/db/src/index_lifecycle/text/driver.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 35 in db::index_lifecycle::text::driver::scan_partition_documents at line 1735. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/index_lifecycle/text/driver.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/db/src/index_lifecycle/outbox.rs crates/db/src/index_lifecycle/outbox.rs:1052— crates/db/src/index_lifecycle/outbox.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in db::index_lifecycle::outbox::execute_claimed_step_with_evidence at line 1052. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/index_lifecycle/outbox.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/cypher/src/parser.rs crates/cypher/src/parser.rs:562— crates/cypher/src/parser.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 56 in Parser::expr_inner at line 562. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/cypher/src/parser.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/db/src/execution/interpreter/rows/projection_chain.rs crates/db/src/execution/interpreter/rows/projection_chain.rs:195— crates/db/src/execution/interpreter/rows/projection_chain.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in ExecutionContext::projection_chain at line 195. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/execution/interpreter/rows/projection_chain.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/db/src/search/vector/hnsw/index.rs crates/db/src/search/vector/hnsw/index.rs:1067— crates/db/src/search/vector/hnsw/index.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in VectorIndex::load_uncached_items_for_layer at line 1067. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/search/vector/hnsw/index.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/cli/src/config.rs crates/cli/src/config.rs:557— crates/cli/src/config.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in HelixConfig::validate at line 557. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/cli/src/config.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/db/src/execution/interpreter/rows/matches.rs crates/db/src/execution/interpreter/rows/matches.rs:83— crates/db/src/execution/interpreter/rows/matches.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in ExecutionContext::match_rows at line 83. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/execution/interpreter/rows/matches.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: sdks/typescript/src/index.ts sdks/typescript/src/index.ts:135— sdks/typescript/src/index.ts changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in HelixError.remote at line 135. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- sdks/typescript/src/index.ts`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: crates/db/src/execution/interpreter/stream/eval/resolved.rs crates/db/src/execution/interpreter/stream/eval/resolved.rs:112— crates/db/src/execution/interpreter/stream/eval/resolved.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in ExecutionContext::eval_resolved at line 112. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/execution/interpreter/stream/eval/resolved.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/db/src/index_lifecycle/queue/publication.rs crates/db/src/index_lifecycle/queue/publication.rs:1095— crates/db/src/index_lifecycle/queue/publication.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in QueuePublisher::publish_vector at line 1095. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/index_lifecycle/queue/publication.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.
MethodTooLong: VectorIndex.search_layer0_with_simhash crates/db/src/search/vector/hnsw/search.rs:267— MethodTooLong — search_layer0_with_simhash runs 616 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 516 over it, 6.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: Translator.select crates/cypher/src/sql/select.rs:209— MethodTooLong — select runs 327 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 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.
MethodTooLong: ExecutionContext.row_program crates/db/src/execution/interpreter/rows/mod.rs:137— MethodTooLong — row_program runs 297 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 197 over it, 2.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ExecutionContext.execute_count crates/db/src/execution/interpreter/count.rs:147— MethodTooLong — execute_count runs 294 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 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.
MethodTooLong: ExecutionContext.count_cursor_leaf crates/db/src/execution/interpreter/count.rs:1398— MethodTooLong — count_cursor_leaf runs 276 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 176 over it, 2.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: ExecutionContext.count_cursor_cardinality crates/db/src/execution/interpreter/count.rs:924— MethodTooLong — count_cursor_cardinality runs 258 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 158 over it, 2.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VectorIndex.restricted_filter_aware_search crates/db/src/search/vector/hnsw/restricted.rs:1148— MethodTooLong — restricted_filter_aware_search runs 249 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 149 over it, 2.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VectorRows.validate_simhash_directory crates/db/src/search/vector/storage/mod.rs:1256— MethodTooLong — validate_simhash_directory runs 241 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 141 over it, 2.41× 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: Source.open crates/db/src/execution/interpreter/pull/source.rs:154— MethodTooLong — open runs 236 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 136 over it, 2.36× 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: Evaluation.function crates/planner/src/relational/evaluation.rs:486— MethodTooLong — function runs 231 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ExecutionContext.count_cursor_ids crates/db/src/execution/interpreter/count.rs:1754— MethodTooLong — count_cursor_ids runs 228 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 128 over it, 2.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Parser.expr_inner crates/cypher/src/parser.rs:562— MethodTooLong — expr_inner runs 217 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 117 over it, 2.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Translator.expr_at_depth crates/cypher/src/sql/expr.rs:68— MethodTooLong — expr_at_depth 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: Binder.expression crates/cypher/src/bind.rs:930— MethodTooLong — expression 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: Translator.function crates/cypher/src/sql/expr.rs:646— MethodTooLong — function runs 193 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ExecutionContext.graph_batch_required crates/db/src/execution/interpreter/rows/graph.rs:159— MethodTooLong — graph_batch_required 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: ExecutionContext.match_rows crates/db/src/execution/interpreter/rows/matches.rs:83— MethodTooLong — match_rows runs 181 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 81 over it, 1.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ExecutableDagBuilder.push_selected_stream_pipeline_op crates/planner/src/exec/selected/lowering/access/pipeline.rs:4— MethodTooLong — push_selected_stream_pipeline_op runs 179 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 79 over it, 1.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: VectorRows.validate_legacy_physical crates/db/src/search/vector/storage/mod.rs:1004— MethodTooLong — validate_legacy_physical runs 176 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Query.new crates/planner/src/relational/query.rs:236— MethodTooLong — new runs 176 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Evaluation.eval crates/planner/src/relational/evaluation.rs:84— MethodTooLong — eval runs 171 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ExecutionContext.project_rows crates/db/src/execution/interpreter/rows/projection.rs:218— MethodTooLong — project_rows runs 169 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ExecutionContext.eval_resolved crates/db/src/execution/interpreter/stream/eval/resolved.rs:112— MethodTooLong — eval_resolved runs 164 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 64 over it, 1.64× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Operation.apply crates/ast/src/traversal.rs:1022— MethodTooLong — apply runs 157 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 57 over it, 1.57× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Step.ToAST REDACTED:1461— MethodTooLong — ToAST runs 151 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 51 over it, 1.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
db::execution::interpreter::pull::poll::step (cyclomatic 104) crates/db/src/execution/interpreter/pull/poll.rs:72— db::execution::interpreter::pull::poll::step has cyclomatic complexity 104 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
db::migrations::preflight_legacy_vector_reservations (cyclomatic 57) crates/db/src/migrations/mod.rs:1846— db::migrations::preflight_legacy_vector_reservations has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
db::index_lifecycle::repository::scoped_cursor_is_valid (cyclomatic 36) crates/db/src/index_lifecycle/repository.rs:454— db::index_lifecycle::repository::scoped_cursor_is_valid 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.
db::index_lifecycle::text::driver::scan_partition_documents (cyclomatic 35) crates/db/src/index_lifecycle/text/driver.rs:1735— db::index_lifecycle::text::driver::scan_partition_documents 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.
db::index_lifecycle::repository::operation_record_cursors_are_valid (cyclomatic 34) crates/db/src/index_lifecycle/repository.rs:666— db::index_lifecycle::repository::operation_record_cursors_are_valid has cyclomatic complexity 34 (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.
db::index_lifecycle::secondary::scan_source (cyclomatic 28) crates/db/src/index_lifecycle/secondary.rs:1796— db::index_lifecycle::secondary::scan_source 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.
db::index_lifecycle::text::driver::scan_source (cyclomatic 28) crates/db/src/index_lifecycle/text/driver.rs:2495— db::index_lifecycle::text::driver::scan_source 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.
db::encoding::v2::values::lifecycle::operation_record::take_operation_progress (cyclomatic 27) crates/db/src/encoding/v2/values/lifecycle/operation_record.rs:280— db::encoding::v2::values::lifecycle::operation_record::take_operation_progress 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.
db::index_lifecycle::vector::driver::step_cleanup (cyclomatic 27) crates/db/src/index_lifecycle/vector/driver.rs:1324— db::index_lifecycle::vector::driver::step_cleanup 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.
db::index_lifecycle::text::manifest::select_page (cyclomatic 26) crates/db/src/index_lifecycle/text/manifest.rs:155— db::index_lifecycle::text::manifest::select_page 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.
db::index_lifecycle::text::validation::select_page (cyclomatic 25) crates/db/src/index_lifecycle/text/validation.rs:239— db::index_lifecycle::text::validation::select_page 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.
db::search::text::search_manifest_with_state_source (cyclomatic 25) crates/db/src/search/text/mod.rs:550— db::search::text::search_manifest_with_state_source 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.
db::encoding::v2::values::property::equality_index_value::prepare::prepare_equality_value (cyclomatic 24) crates/db/src/encoding/v2/values/property/equality_index_value/prepare.rs:107— db::encoding::v2::values::property::equality_index_value::prepare::prepare_equality_value 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.
db::encoding::v2::values::lifecycle::operation_record::put_operation_progress (cyclomatic 23) crates/db/src/encoding/v2/values/lifecycle/operation_record.rs:118— db::encoding::v2::values::lifecycle::operation_record::put_operation_progress 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.
db::index_lifecycle::text::active_compaction::compact_once (cyclomatic 23) crates/db/src/index_lifecycle/text/active_compaction.rs:32— db::index_lifecycle::text::active_compaction::compact_once 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.
db::index_lifecycle::text::validation::select_entity_state (cyclomatic 23) crates/db/src/index_lifecycle/text/validation.rs:693— db::index_lifecycle::text::validation::select_entity_state 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.
db::index_lifecycle::secondary::secondary_range_scan_bounds (cyclomatic 22) crates/db/src/index_lifecycle/secondary.rs:4751— db::index_lifecycle::secondary::secondary_range_scan_bounds 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.
db::migrations::process_loaded_job (cyclomatic 22) crates/db/src/migrations/mod.rs:3159— db::migrations::process_loaded_job has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
db::search::vector::cache::hydration::hydrate_active_generations (cyclomatic 22) crates/db/src/search/vector/cache/hydration.rs:141— db::search::vector::cache::hydration::hydrate_active_generations has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
db::index_lifecycle::secondary::delete_generation_rows (cyclomatic 21) crates/db/src/index_lifecycle/secondary.rs:3055— db::index_lifecycle::secondary::delete_generation_rows 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.
db::index_lifecycle::secondary::reconciliation_plan_from_observations (cyclomatic 21) crates/db/src/index_lifecycle/secondary.rs:3835— db::index_lifecycle::secondary::reconciliation_plan_from_observations 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.
db::index_lifecycle::vector::driver::plan_and_apply (cyclomatic 21) crates/db/src/index_lifecycle/vector/driver.rs:3165— db::index_lifecycle::vector::driver::plan_and_apply 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.
db::index_lifecycle::secondary::exact::ordered::scan_active_range_generation_ordered (cyclomatic 20) crates/db/src/index_lifecycle/secondary/exact/ordered.rs:183— db::index_lifecycle::secondary::exact::ordered::scan_active_range_generation_ordered 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.
db::execution::interpreter::rows::graph::to_property (cyclomatic 19) crates/db/src/execution/interpreter/rows/graph.rs:581— db::execution::interpreter::rows::graph::to_property 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.
db::index_lifecycle::outbox::execute_claimed_step_with_evidence (cyclomatic 19) crates/db/src/index_lifecycle/outbox.rs:1052— db::index_lifecycle::outbox::execute_claimed_step_with_evidence 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.
Duplicated block (7 lines × 2) crates/ast-arena-derive/src/expand.rs:394— crates/ast-arena-derive/src/expand.rs:394-400 | crates/ast-arena-derive/src/expand.rs:543-549 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/ast-arena-derive/src/expand.rs:394` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/db/src/encoding/v2/values/codec.rs:451— crates/db/src/encoding/v2/values/codec.rs:451-457 | crates/db/src/encoding/v2/values/codec.rs:484-490 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/encoding/v2/values/codec.rs:451` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/db/src/encoding/v2/values/lifecycle/entity_state.rs:39— crates/db/src/encoding/v2/values/lifecycle/entity_state.rs:39-45 | crates/db/src/encoding/v2/values/lifecycle/entity_state.rs:99-105 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/values/lifecycle/entity_state.rs:39` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) crates/db/src/execution/interpreter/rows/bound_match.rs:102— crates/db/src/execution/interpreter/rows/bound_match.rs:102-108 | crates/db/src/execution/interpreter/rows/correlated.rs:123-129 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/rows/bound_match.rs:102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/db/src/execution/interpreter/rows/expansion_stack.rs:180— crates/db/src/execution/interpreter/rows/expansion_stack.rs:180-186 | crates/db/src/execution/interpreter/rows/matches.rs:428-434 — 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/db/src/execution/interpreter/rows/expansion_stack.rs:180` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/db/src/execution/interpreter/rows/hash_probe.rs:49— crates/db/src/execution/interpreter/rows/hash_probe.rs:49-55 | crates/db/src/execution/interpreter/rows/joins.rs:63-69 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/rows/hash_probe.rs:49` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/db/src/execution/interpreter/storage.rs:54— crates/db/src/execution/interpreter/storage.rs:54-60 | crates/db/src/execution/interpreter/storage.rs:461-467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/storage.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 lines × 2) crates/db/src/execution/interpreter/stream/filter.rs:320— crates/db/src/execution/interpreter/stream/filter.rs:320-326 | crates/planner/src/ir/expr/validation.rs:35-41 — 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/db/src/execution/interpreter/stream/filter.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 (7 lines × 2) crates/db/src/index_lifecycle/secondary.rs:2688— crates/db/src/index_lifecycle/secondary.rs:2688-2694 | crates/db/src/index_lifecycle/secondary.rs:2764-2770 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/secondary.rs:2688` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/db/src/index_lifecycle/secondary.rs:2684— crates/db/src/index_lifecycle/secondary.rs:2684-2690 | crates/db/src/index_lifecycle/vector/driver.rs:3855-3861 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary.rs` and `crates/db/src/index_lifecycle/vector/driver.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/secondary.rs:2684` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) crates/db/src/index_lifecycle/vector/driver.rs:2831— crates/db/src/index_lifecycle/vector/driver.rs:2831-2837 | crates/db/src/index_lifecycle/vector/driver.rs:3865-3871 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/vector/driver.rs:2831` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/db/src/query_resources/properties/builder.rs:21— crates/db/src/query_resources/properties/builder.rs:21-27 | crates/db/src/query_resources/properties/builder.rs:44-50 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/query_resources/properties/builder.rs:21` it does not close everything it opens, so those 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 `property` to `&property::Property` in one and `property::Property` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) crates/db/src/search/text/mod.rs:1118— crates/db/src/search/text/mod.rs:1118-1124 | crates/db/src/search/text/mod.rs:1150-1156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/search/text/mod.rs:1118` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) crates/db/src/search/vector/spaces/simple_avx.rs:34— crates/db/src/search/vector/spaces/simple_avx.rs:34-40 | crates/db/src/search/vector/spaces/simple_avx.rs:147-153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/search/vector/spaces/simple_avx.rs:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/db/src/search/vector/spaces/simple_neon.rs:40— crates/db/src/search/vector/spaces/simple_neon.rs:40-46 | crates/db/src/search/vector/spaces/simple_neon.rs:78-84 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/search/vector/spaces/simple_neon.rs:40` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) crates/planner/src/exec/lowering/contracts/access/cardinality.rs:79— crates/planner/src/exec/lowering/contracts/access/cardinality.rs:79-85 | crates/planner/src/exec/selected/lowering/contracts/matching/access/source/node.rs:81-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/planner/src/exec/lowering/contracts/access/cardinality.rs:98— crates/planner/src/exec/lowering/contracts/access/cardinality.rs:98-104 | crates/planner/src/exec/selected/lowering/contracts/matching/access/source/edge.rs:81-87 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/planner/src/ir/access/edge/branch.rs:68— crates/planner/src/ir/access/edge/branch.rs:68-74 | crates/planner/src/ir/access/node/branch.rs:68-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 `branches` to `Vec<EdgeResidualBranch>` in one and `Vec<NodeResidualBranch>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (7 lines × 2) crates/server/src/lib.rs:339— crates/server/src/lib.rs:339-345 | crates/server/src/lib.rs:357-363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/server/src/lib.rs:339` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (7 lines × 2) crates/db/src/encoding/v2/values/property/property_value.rs:329— crates/db/src/encoding/v2/values/property/property_value.rs:329-335 | crates/planner/src/analysis/scalar/values.rs:173-179 — before extracting anything, compare `crates/db/src/encoding/v2/values/property/property_value.rs` and `crates/planner/src/analysis/scalar/values.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 70 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 (7 lines × 2) crates/db/src/encoding/v2/values/property/property_value.rs:338— crates/db/src/encoding/v2/values/property/property_value.rs:338-344 | crates/planner/src/analysis/scalar/values.rs:181-187 — before extracting anything, compare `crates/db/src/encoding/v2/values/property/property_value.rs` and `crates/planner/src/analysis/scalar/values.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 70 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 (7 lines × 2) crates/db/src/execution/interpreter/stream/order.rs:20— crates/db/src/execution/interpreter/stream/order.rs:20-26 | crates/db/src/execution/interpreter/stream/projection/rows.rs:165-171 — 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/db/src/execution/interpreter/stream/order.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 (7 lines × 2) crates/db/src/execution/interpreter/stream/projection/rows.rs:84— crates/db/src/execution/interpreter/stream/projection/rows.rs:84-90 | crates/db/src/execution/interpreter/stream/projection/rows.rs:135-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) crates/cypher/src/bind.rs:956— crates/cypher/src/bind.rs:956-962 | crates/planner/src/relational/expression.rs:583-589 — 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) crates/db/src/migrations/startup/bootstrap.rs:127— crates/db/src/migrations/startup/bootstrap.rs:127-133 | crates/db/src/migrations/startup/bootstrap.rs:190-196 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/migrations/startup/bootstrap.rs:127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/cli/src/commands/cloud/project.rs:28— crates/cli/src/commands/cloud/project.rs:28-38 | crates/cli/src/commands/cloud/workspace.rs:24-34 — 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/cli/src/commands/cloud/project.rs:28` it does not close everything it opens, so those 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/cli/src/commands/cloud/workspace.rs:35` calls `clone`, `unwrap_or_default` and `crates/cli/src/commands/cloud/project.rs:39` 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 × 2) crates/db/src/config/definition_differences.rs:183— crates/db/src/config/definition_differences.rs:183-193 | crates/db/src/config/definition_differences.rs:234-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/config/definition_differences.rs:183` it begins part-way through the construct above it, so those 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 `existing` to `&ValidatedVectorIndexDefinition` in one and `&ValidatedTextIndexDefinition` 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/db/src/encoding/v2/keys/indexes/range/edge.rs:260— crates/db/src/encoding/v2/keys/indexes/range/edge.rs:260-270 | crates/db/src/encoding/v2/keys/indexes/range/edge.rs:427-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 `crates/db/src/encoding/v2/keys/indexes/range/edge.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 (11 lines × 2) crates/db/src/execution/interpreter/count.rs:369— crates/db/src/execution/interpreter/count.rs:369-379 | crates/db/src/execution/interpreter/count.rs:1122-1133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/count.rs:1122` it begins part-way through the construct above it, so those 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) crates/db/src/execution/interpreter/count.rs:393— crates/db/src/execution/interpreter/count.rs:393-403 | crates/db/src/execution/interpreter/count.rs:1151-1162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/count.rs:1151` it begins part-way through the construct above it, so those 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) crates/db/src/execution/interpreter/count.rs:829— crates/db/src/execution/interpreter/count.rs:829-839 | crates/db/src/execution/interpreter/count.rs:842-852 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/count.rs:829` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/db/src/execution/interpreter/count.rs:890— crates/db/src/execution/interpreter/count.rs:890-900 | crates/db/src/execution/interpreter/count.rs:903-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/db/src/execution/interpreter/count.rs:890` it begins part-way through the construct above it, so those exact lines 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/db/src/execution/interpreter/mutation/edge.rs:269— crates/db/src/execution/interpreter/mutation/edge.rs:269-279 | crates/db/src/execution/interpreter/mutation/node.rs:174-184 — before extracting anything, compare `crates/db/src/execution/interpreter/mutation/edge.rs` and `crates/db/src/execution/interpreter/mutation/node.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/mutation/edge.rs:269` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) crates/db/src/execution/interpreter/mutation/node.rs:404— crates/db/src/execution/interpreter/mutation/node.rs:404-414 | crates/db/src/execution/interpreter/mutation/node.rs:457-467 — both copies are in the same file, so extract the block into 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/db/src/execution/interpreter/rows/matches.rs:590— crates/db/src/execution/interpreter/rows/matches.rs:590-600 | crates/db/src/execution/interpreter/rows/matches.rs:603-613 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/rows/matches.rs:590` it begins part-way through the construct above it, so those exact lines 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/db/src/execution/interpreter/rows/matches.rs:673— crates/db/src/execution/interpreter/rows/matches.rs:673-683 | crates/db/src/execution/interpreter/rows/matches.rs:691-701 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/rows/matches.rs:673` it begins part-way through the construct above it, so those 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) crates/db/src/index_lifecycle/queue/publication.rs:1258— crates/db/src/index_lifecycle/queue/publication.rs:1258-1268 | crates/db/src/index_lifecycle/queue/publication.rs:1817-1827 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/queue/publication.rs:1258` 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) crates/db/src/index_lifecycle/secondary.rs:1873— crates/db/src/index_lifecycle/secondary.rs:1873-1883 | crates/db/src/index_lifecycle/secondary.rs:1891-1902 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/secondary.rs:1891` it begins part-way through the construct above it, so those exact lines 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/db/src/index_lifecycle/secondary.rs:2756— crates/db/src/index_lifecycle/secondary.rs:2756-2766 | crates/db/src/index_lifecycle/vector/driver.rs:3667-3677 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary.rs` and `crates/db/src/index_lifecycle/vector/driver.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/db/src/index_lifecycle/text/active_batch.rs:997— crates/db/src/index_lifecycle/text/active_batch.rs:997-1007 | crates/db/src/index_lifecycle/text/driver.rs:1360-1370 — 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/db/src/index_lifecycle/text/active_batch.rs:997` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) crates/db/src/index_lifecycle/text/active_compaction.rs:446— crates/db/src/index_lifecycle/text/active_compaction.rs:446-456 | crates/db/src/index_lifecycle/text/compaction.rs:342-352 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) crates/db/src/index_lifecycle/text/driver.rs:2566— crates/db/src/index_lifecycle/text/driver.rs:2566-2576 | crates/db/src/index_lifecycle/text/driver.rs:2679-2689 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/text/driver.rs:2566` it begins part-way through the construct above it, so those exact lines 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/db/src/index_lifecycle/vector/driver.rs:1695— crates/db/src/index_lifecycle/vector/driver.rs:1695-1705 | crates/db/src/index_lifecycle/vector/driver.rs:1800-1810 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/vector/driver.rs:1695` it does not close everything it opens, so those exact lines 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/db/src/index_lifecycle/work.rs:421— crates/db/src/index_lifecycle/work.rs:421-431 | crates/db/src/index_lifecycle/work.rs:458-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.
Duplicated block (11 lines × 2) crates/planner/src/planning/envelope/write_contract.rs:72— crates/planner/src/planning/envelope/write_contract.rs:72-82 | crates/planner/src/planning/selected/native/context_usage.rs:328-338 — before extracting anything, compare `crates/planner/src/planning/envelope/write_contract.rs` and `crates/planner/src/planning/selected/native/context_usage.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) crates/planner/src/rules/access/order/satisfaction.rs:75— crates/planner/src/rules/access/order/satisfaction.rs:75-85 | crates/planner/src/rules/access/order/satisfaction.rs:115-125 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/rules/access/order/satisfaction.rs:75` 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 `out` to `&mut Vec<ir::NodeAccessSourcePlan>` in one and `&mut Vec<ir::EdgeAccessSourcePlan>` 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/planner/src/rules/access/sets/equality_range/intersection/edge.rs:142— crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:142-152 | crates/planner/src/rules/access/sets/equality_range/intersection/node.rs:142-152 — before extracting anything, compare `crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs` and `crates/planner/src/rules/access/sets/equality_range/intersection/node.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 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/planner/src/rules/access/sets/equality_range/intersection/edge.rs:142` 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) crates/planner/src/rules/access/sets/equality_range/range_union/edge.rs:55— crates/planner/src/rules/access/sets/equality_range/range_union/edge.rs:55-65 | crates/planner/src/rules/access/sets/equality_range/range_union/node.rs:55-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/rules/access/sets/equality_range/range_union/edge.rs:55` 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 `range_buckets` to `&BTreeMap<digest::PlanDigest, Vec<EdgeRangeBucketEntry<'_>>>` in one and `&BTreeMap<digest::PlanDigest, Vec<NodeRangeBucketEntry<'_>>>` 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/planner/src/rules/cardinality.rs:1469— crates/planner/src/rules/cardinality.rs:1469-1479 | crates/planner/src/rules/cardinality.rs:1546-1556 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/rules/cardinality.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. 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 `children` to `&ir::AtLeast<ir::NodeAccessSourcePlan, 2>` in one and `&ir::AtLeast<ir::EdgeAccessSourcePlan, 2>` 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/planner/src/rules/physical_contracts/support/pipeline.rs:163— crates/planner/src/rules/physical_contracts/support/pipeline.rs:163-173 | crates/planner/src/rules/physical_contracts/support/pipeline.rs:203-213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/rules/physical_contracts/support/pipeline.rs:163` it does not close everything it opens, so those exact lines 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/db/src/encoding/v2/keys/data.rs:379— crates/db/src/encoding/v2/keys/data.rs:379-388 | crates/db/src/encoding/v2/keys/managed_index.rs:187-196 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:268— crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:268-277 | crates/db/src/encoding/v2/keys/indexes/label.rs:58-67 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/equality/edge.rs` and `crates/db/src/encoding/v2/keys/indexes/label.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:268` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) crates/db/src/encoding/v2/values/adjacency/mod.rs:398— crates/db/src/encoding/v2/values/adjacency/mod.rs:398-407 | crates/db/src/encoding/v2/values/adjacency/mod.rs:429-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/encoding/v2/values/adjacency/mod.rs:398` it begins part-way through the construct above it, so those 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/db/src/encoding/v2/values/adjacency/mod.rs:442` calls `take_u32_le` and `crates/db/src/encoding/v2/values/adjacency/mod.rs:408` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) crates/db/src/execution/interpreter/control/foreach.rs:149— crates/db/src/execution/interpreter/control/foreach.rs:149-158 | crates/db/src/execution/interpreter/control/foreach.rs:191-200 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/control/foreach.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. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `&AstPropertyValue` in one and `&QueryValue` 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) crates/db/src/execution/interpreter/count.rs:324— crates/db/src/execution/interpreter/count.rs:324-333 | crates/db/src/execution/interpreter/count.rs:372-381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/count.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) crates/db/src/execution/interpreter/count.rs:348— crates/db/src/execution/interpreter/count.rs:348-357 | crates/db/src/execution/interpreter/count.rs:396-405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/count.rs:348` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) crates/db/src/execution/interpreter/count.rs:2295— crates/db/src/execution/interpreter/count.rs:2295-2304 | crates/planner/src/rules/cardinality.rs:2161-2170 — before extracting anything, compare `crates/db/src/execution/interpreter/count.rs` and `crates/planner/src/rules/cardinality.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) crates/db/src/execution/interpreter/pull/count.rs:50— crates/db/src/execution/interpreter/pull/count.rs:50-59 | crates/db/src/execution/interpreter/pull/count.rs:82-91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/pull/count.rs:50` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/db/src/execution/interpreter/storage.rs:206— crates/db/src/execution/interpreter/storage.rs:206-215 | crates/db/src/execution/interpreter/storage.rs:273-282 — both copies are in the same file, so extract the block into 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/db/src/index_lifecycle/outbox.rs:1521— crates/db/src/index_lifecycle/outbox.rs:1521-1530 | crates/db/src/index_lifecycle/outbox.rs:1770-1779 — both copies are in the same file, so extract the block into 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/db/src/index_lifecycle/queue/publication.rs:1312— crates/db/src/index_lifecycle/queue/publication.rs:1312-1321 | crates/db/src/index_lifecycle/queue/publication.rs:1861-1870 — both copies are in the same file, so extract the block into 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/db/src/index_lifecycle/text/validation.rs:671— crates/db/src/index_lifecycle/text/validation.rs:671-680 | crates/db/src/index_lifecycle/text/validation.rs:919-929 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/text/validation.rs:671` it begins part-way through the construct above it, so those exact lines 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/db/src/index_lifecycle/vector/driver.rs:1726— crates/db/src/index_lifecycle/vector/driver.rs:1726-1735 | crates/db/src/index_lifecycle/vector/driver.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/db/src/index_lifecycle/vector/driver.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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) crates/db/src/index_lifecycle/vector/driver.rs:2407— crates/db/src/index_lifecycle/vector/driver.rs:2407-2416 | crates/db/src/index_lifecycle/vector/driver.rs:2635-2644 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/vector/driver.rs:2407` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) crates/db/src/search/mod.rs:1390— crates/db/src/search/mod.rs:1390-1399 | crates/db/src/search/mod.rs:1430-1439 — both copies are in the same file, so extract the block into 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/db/src/search/mod.rs:1592— crates/db/src/search/mod.rs:1592-1601 | crates/db/src/search/mod.rs:1662-1671 — both copies are in the same file, so extract the block into 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/db/src/search/mod.rs:1975— crates/db/src/search/mod.rs:1975-1984 | crates/db/src/search/mod.rs:1996-2005 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/mod.rs:1975` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/db/src/search/vector/hnsw/search.rs:1089— crates/db/src/search/vector/hnsw/search.rs:1089-1098 | crates/db/src/search/vector/hnsw/search.rs:1102-1111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) crates/db/src/search/vector/storage/mod.rs:1032— crates/db/src/search/vector/storage/mod.rs:1032-1041 | crates/db/src/search/vector/storage/mod.rs:1629-1638 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/storage/mod.rs:1032` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) crates/db/src/search/vector/storage/mod.rs:1821— crates/db/src/search/vector/storage/mod.rs:1821-1830 | crates/db/src/search/vector/storage/mod.rs:1845-1854 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/storage/mod.rs:1821` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 2) crates/planner/src/rules/access/sets/contradiction/edge.rs:68— crates/planner/src/rules/access/sets/contradiction/edge.rs:68-77 | crates/planner/src/rules/access/sets/contradiction/node.rs:68-77 — before extracting anything, compare `crates/planner/src/rules/access/sets/contradiction/edge.rs` and `crates/planner/src/rules/access/sets/contradiction/node.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 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 `equality` to `&ir::EdgeAccessPlan` in one and `&ir::NodeAccessPlan` 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) crates/server/src/diagnostics/mod.rs:895— crates/server/src/diagnostics/mod.rs:895-904 | crates/server/src/diagnostics/mod.rs:995-1004 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/server/src/diagnostics/mod.rs:895` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) crates/planner/src/ir/bounds/search.rs:89— crates/planner/src/ir/bounds/search.rs:89-98 | crates/planner/src/ir/bounds/stream/bound.rs:82-91 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) crates/planner/src/rules/access/sets/contradiction/edge.rs:81— crates/planner/src/rules/access/sets/contradiction/edge.rs:81-90 | crates/planner/src/rules/access/sets/contradiction/node.rs:81-90 — before extracting anything, compare `crates/planner/src/rules/access/sets/contradiction/edge.rs` and `crates/planner/src/rules/access/sets/contradiction/node.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 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/planner/src/rules/access/sets/contradiction/edge.rs:81` it begins part-way through the construct above it, so those 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 `plan` to `&ir::EdgeAccessPlan` in one and `&ir::NodeAccessPlan` 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) crates/db/src/migrations/vector_retirement.rs:116— crates/db/src/migrations/vector_retirement.rs:116-127 | crates/db/src/migrations/vector_retirement.rs:703-712 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/migrations/vector_retirement.rs:116` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/cli/src/local_runtime.rs:1219— crates/cli/src/local_runtime.rs:1219-1227 | crates/cli/src/local_runtime.rs:1244-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.
Duplicated block (9 lines × 2) crates/db/src/encoding/v2/values/codec.rs:381— crates/db/src/encoding/v2/values/codec.rs:381-389 | crates/db/src/encoding/v2/values/codec.rs:403-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.
Duplicated block (9 lines × 2) crates/db/src/encoding/v2/values/indexes/equality/mod.rs:274— crates/db/src/encoding/v2/values/indexes/equality/mod.rs:274-282 | crates/db/src/encoding/v2/values/indexes/range.rs:49-57 — 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/db/src/encoding/v2/values/indexes/equality/mod.rs:274` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/db/src/execution/interpreter/storage.rs:209— crates/db/src/execution/interpreter/storage.rs:209-217 | crates/db/src/execution/interpreter/storage.rs:333-341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/storage.rs:209` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/db/src/execution/interpreter/storage.rs:276— crates/db/src/execution/interpreter/storage.rs:276-284 | crates/db/src/execution/interpreter/storage.rs:365-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/storage.rs:276` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/db/src/index_lifecycle/secondary/exact/unique.rs:92— crates/db/src/index_lifecycle/secondary/exact/unique.rs:92-100 | crates/db/src/index_lifecycle/secondary/exact/unique.rs:157-165 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/db/src/index_lifecycle/text/driver.rs:1051— crates/db/src/index_lifecycle/text/driver.rs:1051-1059 | crates/db/src/index_lifecycle/text/driver.rs:1363-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 (9 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:3287— crates/db/src/index_lifecycle_testing/contracts.rs:3287-3295 | crates/db/src/index_lifecycle_testing/contracts.rs:3319-3327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle_testing/contracts.rs:3287` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/db/src/migrations/startup/bootstrap.rs:143— crates/db/src/migrations/startup/bootstrap.rs:143-151 | crates/db/src/migrations/startup/bootstrap.rs:226-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/migrations/startup/bootstrap.rs:143` it begins part-way through the construct above it, so those 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/db/src/migrations/startup/bootstrap.rs:153` calls `rollback` and `crates/db/src/migrations/startup/bootstrap.rs:236` 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) crates/db/src/search/mod.rs:733— crates/db/src/search/mod.rs:733-741 | crates/db/src/search/mod.rs:2324-2332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/mod.rs:733` it does not close everything it opens, so those 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) crates/db/src/search/mod.rs:1090— crates/db/src/search/mod.rs:1090-1098 | crates/db/src/search/mod.rs:1100-1108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) crates/planner/src/analysis/index_atoms/equality.rs:113— crates/planner/src/analysis/index_atoms/equality.rs:113-121 | crates/planner/src/analysis/index_atoms/value.rs:26-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/planner/src/rules/access/pipeline/support/empty.rs:62— crates/planner/src/rules/access/pipeline/support/empty.rs:62-70 | crates/planner/src/rules/root/control_flow/contracts.rs:50-58 — 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 (9 lines × 2) crates/planner/src/rules/access/sets/contradiction/edge.rs:8— crates/planner/src/rules/access/sets/contradiction/edge.rs:8-16 | crates/planner/src/rules/access/sets/contradiction/node.rs:8-16 — before extracting anything, compare `crates/planner/src/rules/access/sets/contradiction/edge.rs` and `crates/planner/src/rules/access/sets/contradiction/node.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 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/planner/src/rules/access/sets/contradiction/edge.rs:8` 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) crates/planner/src/rules/access/sets/range/edge.rs:20— crates/planner/src/rules/access/sets/range/edge.rs:20-28 | crates/planner/src/rules/access/sets/range/node.rs:20-28 — 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/planner/src/rules/access/sets/range/edge.rs:20` 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) crates/planner/src/rules/cardinality.rs:1498— crates/planner/src/rules/cardinality.rs:1498-1506 | crates/planner/src/rules/cardinality.rs:1575-1583 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/rules/cardinality.rs:1498` 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 `children` to `&ir::AtLeast<ir::NodeAccessSourcePlan, 2>` in one and `&ir::AtLeast<ir::EdgeAccessSourcePlan, 2>` 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) crates/db/src/index_lifecycle_testing/contracts.rs:1421— crates/db/src/index_lifecycle_testing/contracts.rs:1421-1429 | crates/db/src/index_lifecycle_testing/contracts.rs:1484-1492 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle_testing/contracts.rs:1421` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/db/src/search/vector/spaces/simple_avx.rs:255— crates/db/src/search/vector/spaces/simple_avx.rs:255-263 | crates/db/src/search/vector/spaces/simple_avx.rs:293-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/search/vector/spaces/simple_avx.rs:255` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/planner/src/rules/cardinality.rs:1508— crates/planner/src/rules/cardinality.rs:1508-1516 | crates/planner/src/rules/cardinality.rs:1585-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 `crates/planner/src/rules/cardinality.rs:1508` it begins part-way through the construct above it, so those 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) crates/db/src/execution/interpreter/rows/joins.rs:31— crates/db/src/execution/interpreter/rows/joins.rs:31-39 | crates/db/src/execution/interpreter/rows/scan.rs:241-249 — 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/db/src/execution/interpreter/rows/joins.rs:31` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) crates/db/src/index_lifecycle/repository.rs:134— crates/db/src/index_lifecycle/repository.rs:134-142 | crates/db/src/migrations/startup/bootstrap.rs:200-208 — before extracting anything, compare `crates/db/src/index_lifecycle/repository.rs` and `crates/db/src/migrations/startup/bootstrap.rs` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/repository.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 (9 lines × 2) crates/planner/src/rules/access/sets/contradiction/edge.rs:54— crates/planner/src/rules/access/sets/contradiction/edge.rs:54-62 | crates/planner/src/rules/access/sets/contradiction/node.rs:54-62 — before extracting anything, compare `crates/planner/src/rules/access/sets/contradiction/edge.rs` and `crates/planner/src/rules/access/sets/contradiction/node.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 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 `left` to `&ir::EdgeAccessPlan` in one and `&ir::NodeAccessPlan` 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) crates/planner/src/rules/access/filter/index/edge.rs:117— crates/planner/src/rules/access/filter/index/edge.rs:117-125 | crates/planner/src/rules/access/filter/index/node.rs:133-141 — 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/planner/src/rules/access/filter/index/edge.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.
Duplicated block (9 lines × 2) crates/planner/src/rules/access/sets/equality_range/range_union/edge.rs:22— crates/planner/src/rules/access/sets/equality_range/range_union/edge.rs:22-30 | crates/planner/src/rules/access/sets/equality_range/range_union/node.rs:22-30 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:3595— crates/db/src/index_lifecycle_testing/contracts.rs:3595-3603 | crates/db/src/index_lifecycle_testing/contracts.rs:3683-3697 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle_testing/contracts.rs:3595` 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 lines × 2) crates/db-testkit/src/model.rs:736— crates/db-testkit/src/model.rs:736-747 | crates/db-testkit/src/model.rs:1159-1170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db-testkit/src/model.rs:736` it begins part-way through the construct above it, so those exact lines 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/db/src/encoding/v2/keys/indexes/range/edge.rs:422— crates/db/src/encoding/v2/keys/indexes/range/edge.rs:422-433 | crates/db/src/encoding/v2/keys/indexes/range/node.rs:216-227 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/range/edge.rs` and `crates/db/src/encoding/v2/keys/indexes/range/node.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 81 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/db/src/encoding/v2/keys/indexes/range/edge.rs:422` it does not close everything it opens, so those exact lines 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/db/src/encoding/v2/values/adjacency/mod.rs:364— crates/db/src/encoding/v2/values/adjacency/mod.rs:364-375 | crates/db/src/encoding/v2/values/adjacency/mod.rs:398-409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/encoding/v2/values/adjacency/mod.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 (12 lines × 2) crates/db/src/execution/interpreter/storage.rs:230— crates/db/src/execution/interpreter/storage.rs:230-241 | crates/db/src/execution/interpreter/storage.rs:297-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/storage.rs:230` it begins part-way through the construct above it, so those exact lines 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/db/src/index_lifecycle/repository.rs:184— crates/db/src/index_lifecycle/repository.rs:184-195 | crates/db/src/migrations/startup/bootstrap.rs:331-342 — before extracting anything, compare `crates/db/src/index_lifecycle/repository.rs` and `crates/db/src/migrations/startup/bootstrap.rs` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/repository.rs:184` it does not close everything it opens, so those 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) crates/db/src/index_lifecycle/secondary.rs:2941— crates/db/src/index_lifecycle/secondary.rs:2941-2952 | crates/db/src/index_lifecycle/secondary.rs:3247-3258 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/secondary.rs:2941` 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/db/src/index_lifecycle/secondary.rs:4789— crates/db/src/index_lifecycle/secondary.rs:4789-4800 | crates/db/src/index_lifecycle/secondary.rs:4827-4838 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/secondary.rs:4789` it begins part-way through the construct above it, so those exact lines 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/db/src/index_lifecycle/text/active_batch.rs:1226— crates/db/src/index_lifecycle/text/active_batch.rs:1226-1237 | crates/db/src/index_lifecycle/text/active_batch.rs:1304-1315 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/text/active_batch.rs:1226` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12 lines × 2) crates/db/src/index_lifecycle/text/compaction.rs:86— crates/db/src/index_lifecycle/text/compaction.rs:86-97 | crates/db/src/index_lifecycle/text/manifest.rs:163-174 — 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/db/src/index_lifecycle/text/compaction.rs:86` it does not close everything it opens, so those exact lines 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/db/src/index_lifecycle/text/statistics.rs:780— crates/db/src/index_lifecycle/text/statistics.rs:780-791 | crates/db/src/index_lifecycle/text/statistics.rs:1044-1055 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/text/statistics.rs:780` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) crates/db/src/index_lifecycle/vector/driver.rs:1811— crates/db/src/index_lifecycle/vector/driver.rs:1811-1822 | crates/db/src/index_lifecycle/vector/driver.rs:1838-1849 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/vector/driver.rs:1811` it begins part-way through the construct above it, so those 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) crates/db/src/index_lifecycle_testing.rs:1203— crates/db/src/index_lifecycle_testing.rs:1203-1214 | crates/db/src/index_lifecycle_testing.rs:1387-1398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle_testing.rs:1203` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) crates/db/src/migrations/vector_scale.rs:419— crates/db/src/migrations/vector_scale.rs:419-430 | crates/db/src/migrations/vector_scale.rs:574-585 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/migrations/vector_scale.rs:419` it begins part-way through the construct above it, so those exact lines 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/db/src/search/mod.rs:1564— crates/db/src/search/mod.rs:1564-1575 | crates/db/src/search/mod.rs:1634-1645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/db/src/search/mod.rs:1578— crates/db/src/search/mod.rs:1578-1589 | crates/db/src/search/mod.rs:1648-1659 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/db/src/search/mod.rs:1698— crates/db/src/search/mod.rs:1698-1709 | crates/db/src/search/mod.rs:1734-1745 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/mod.rs:1698` 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/db/src/search/vector/storage/mod.rs:1047— crates/db/src/search/vector/storage/mod.rs:1047-1058 | crates/db/src/search/vector/storage/mod.rs:1288-1299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/search/vector/storage/mod.rs:1047` it does not close everything it opens, so those exact lines 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/planner/src/analysis/index_atoms/candidate.rs:70— crates/planner/src/analysis/index_atoms/candidate.rs:70-81 | crates/planner/src/analysis/labels.rs:136-147 — before extracting anything, compare `crates/planner/src/analysis/index_atoms/candidate.rs` and `crates/planner/src/analysis/labels.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/analysis/index_atoms/candidate.rs:70` it does not close everything it opens, so those exact lines 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/planner/src/exec/lowering/contracts/stream/delivered.rs:8— crates/planner/src/exec/lowering/contracts/stream/delivered.rs:8-19 | crates/planner/src/rules/physical_contracts/support/delivered.rs:96-107 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) crates/planner/src/exec/selected/lowering/access/leaf.rs:71— crates/planner/src/exec/selected/lowering/access/leaf.rs:71-82 | crates/planner/src/exec/selected/lowering/access/leaf.rs:160-171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/exec/selected/lowering/access/leaf.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.
Duplicated block (12 lines × 2) crates/planner/src/ir/index/range/value.rs:26— crates/planner/src/ir/index/range/value.rs:26-37 | crates/planner/src/ir/index/range/value.rs:229-240 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/ir/index/range/value.rs:26` 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/planner/src/relational/input_window.rs:67— crates/planner/src/relational/input_window.rs:67-78 | crates/planner/src/relational/input_window.rs:155-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/server/src/lib.rs:348— crates/server/src/lib.rs:348-359 | crates/server/src/lib.rs:365-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/server/src/lib.rs:348` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) sdks/rust/helix-dsl-macros/src/lib.rs:103— sdks/rust/helix-dsl-macros/src/lib.rs:103-114 | sdks/rust/helix-dsl-macros/src/lib.rs:131-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdks/rust/helix-dsl-macros/src/lib.rs:103` it does not close everything it opens, so those exact lines 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/planner/src/exec/lowering/secondary_set.rs:154— crates/planner/src/exec/lowering/secondary_set.rs:154-165 | crates/planner/src/exec/lowering/secondary_set.rs:209-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/exec/lowering/secondary_set.rs:154` it begins part-way through the construct above it, so those exact lines 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/db-testkit/src/model.rs:968— crates/db-testkit/src/model.rs:968-973 | crates/value-semantics/src/lib.rs:89-94 — 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/db-testkit/src/model.rs:968` it does not close everything it opens, so those 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) crates/db/src/encoding/v2/values/indexes/operation_queue/mod.rs:979— crates/db/src/encoding/v2/values/indexes/operation_queue/mod.rs:979-984 | crates/db/src/encoding/v2/values/indexes/operation_queue/mod.rs:1012-1017 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/encoding/v2/values/indexes/operation_queue/mod.rs:979` it does not close everything it opens, so those exact lines 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/db/src/execution/interpreter/count.rs:186— crates/db/src/execution/interpreter/count.rs:186-191 | crates/db/src/execution/interpreter/count.rs:211-216 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/count.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 (6 lines × 2) crates/db/src/index_lifecycle/secondary.rs:3216— crates/db/src/index_lifecycle/secondary.rs:3216-3221 | crates/db/src/index_lifecycle/vector/driver.rs:1918-1923 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary.rs` and `crates/db/src/index_lifecycle/vector/driver.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/secondary.rs:3216` it does not close everything it opens, so those exact lines 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/db/src/index_lifecycle/vector/driver.rs:3680— crates/db/src/index_lifecycle/vector/driver.rs:3680-3685 | crates/db/src/index_lifecycle/vector/driver.rs:3864-3869 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/vector/driver.rs:3680` it does not close everything it opens, so those exact lines 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/db/src/migrations/tenant/envelope.rs:92— crates/db/src/migrations/tenant/envelope.rs:92-97 | crates/db/src/migrations/tenant/envelope.rs:180-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.
Duplicated block (6 lines × 2) crates/db/src/search/vector/hnsw/mutation/mod.rs:1481— crates/db/src/search/vector/hnsw/mutation/mod.rs:1481-1486 | crates/db/src/search/vector/hnsw/mutation/mod.rs:1507-1512 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/planner/src/exec/lowering/costing.rs:323— crates/planner/src/exec/lowering/costing.rs:323-328 | crates/planner/src/exec/lowering/costing.rs:447-452 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/exec/lowering/costing.rs:323` it does not close everything it opens, so those exact lines 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/planner/src/ir/bounds/search.rs:196— crates/planner/src/ir/bounds/search.rs:196-201 | crates/planner/src/ir/bounds/stream/bound.rs:222-227 — 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/planner/src/ir/bounds/search.rs:196` 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) crates/planner/src/ir/index/range/bounds/bound.rs:102— crates/planner/src/ir/index/range/bounds/bound.rs:102-107 | crates/planner/src/ir/index/range/bounds/bound.rs:119-124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/ir/index/range/bounds/bound.rs:102` it does not close everything it opens, so those exact lines 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/planner/src/rules/root/control_flow/implementation.rs:31— crates/planner/src/rules/root/control_flow/implementation.rs:31-36 | crates/planner/src/rules/root/control_flow/implementation.rs:68-73 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/rules/root/control_flow/implementation.rs:31` 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) crates/server/src/http.rs:177— crates/server/src/http.rs:177-182 | crates/server/src/http.rs:230-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/server/src/http.rs:177` it does not close everything it opens, so those exact lines 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/db-testkit/src/model.rs:991— crates/db-testkit/src/model.rs:991-996 | crates/value-semantics/src/lib.rs:113-118 — 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/db-testkit/src/model.rs:991` it does not close everything it opens, so those 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) crates/db/src/encoding/v2/values/property/property_value.rs:222— crates/db/src/encoding/v2/values/property/property_value.rs:222-227 | crates/planner/src/analysis/scalar/values.rs:188-193 — before extracting anything, compare `crates/db/src/encoding/v2/values/property/property_value.rs` and `crates/planner/src/analysis/scalar/values.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/values/property/property_value.rs:222` 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) crates/db/src/config/indexes.rs:692— crates/db/src/config/indexes.rs:692-697 | crates/db/src/index_lifecycle/model.rs:433-438 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/db/src/encoding/v2/keys/data.rs:330— crates/db/src/encoding/v2/keys/data.rs:330-335 | crates/db/src/encoding/v2/keys/managed_index.rs:179-184 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:295— crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:295-300 | crates/db/src/encoding/v2/keys/indexes/equality/node.rs:109-114 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/equality/edge.rs` and `crates/db/src/encoding/v2/keys/indexes/equality/node.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) crates/planner/src/exec/lowering/contracts/access/cardinality.rs:110— crates/planner/src/exec/lowering/contracts/access/cardinality.rs:110-115 | crates/planner/src/rules/physical_contracts/access/estimates.rs:37-42 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/planner/src/logical/access/unary/candidates/order.rs:86— crates/planner/src/logical/access/unary/candidates/order.rs:86-91 | crates/planner/src/rules/access/order/direction/contracts.rs:69-74 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/logical/access/unary/candidates/order.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 (6 lines × 2) crates/planner/src/rules/access/filter/index/translate.rs:69— crates/planner/src/rules/access/filter/index/translate.rs:69-74 | crates/planner/src/rules/cardinality.rs:1615-1620 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/db/src/encoding/v2/keys/indexes/vector/metadata.rs:75— crates/db/src/encoding/v2/keys/indexes/vector/metadata.rs:75-80 | crates/db/src/encoding/v2/legacy/vector/transaction_guard.rs:73-78 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/vector/metadata.rs` and `crates/db/src/encoding/v2/legacy/vector/transaction_guard.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) crates/db/src/search/vector/dimension.rs:26— crates/db/src/search/vector/dimension.rs:26-31 | crates/db/src/search/vector/hnsw/neighbor_set.rs:22-27 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) crates/planner/src/exec/selected/lowering/contracts/delivered/access.rs:46— crates/planner/src/exec/selected/lowering/contracts/delivered/access.rs:46-51 | crates/planner/src/exec/selected/lowering/contracts/estimate.rs:26-31 — 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/planner/src/exec/selected/lowering/contracts/delivered/access.rs:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) crates/planner/src/rules/access/sets/contradiction/edge.rs:94— crates/planner/src/rules/access/sets/contradiction/edge.rs:94-99 | crates/planner/src/rules/access/sets/contradiction/node.rs:94-99 — before extracting anything, compare `crates/planner/src/rules/access/sets/contradiction/edge.rs` and `crates/planner/src/rules/access/sets/contradiction/node.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 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/planner/src/rules/access/sets/contradiction/edge.rs:94` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `plan` to `&ir::EdgeAccessPlan` in one and `&ir::NodeAccessPlan` 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) crates/planner/src/rules/access/sets/equality_range/intersection/node.rs:36— crates/planner/src/rules/access/sets/equality_range/intersection/node.rs:36-41 | crates/planner/src/rules/access/sets/equality_range/range_union/node.rs:37-43 — 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/planner/src/rules/access/sets/equality_range/intersection/node.rs:36` 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.
ExecutionContext::match_rows (cognitive 112) crates/db/src/execution/interpreter/rows/matches.rs:83— ExecutionContext::match_rows has cognitive complexity 112 (threshold 15). Drivers by points: loops 13 (54 pts), if/else 10 (35 pts), match/switch 5 (21 pts), boolean chains 2 (nesting depth added 82). 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.
ExecutionContext::finish_pattern_candidates (cognitive 93) crates/db/src/execution/interpreter/rows/matches.rs:569— ExecutionContext::finish_pattern_candidates has cognitive complexity 93 (threshold 15). Drivers by points: if/else 17 (57 pts), loops 13 (30 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 59). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecutionContext::row_program (cognitive 76) crates/db/src/execution/interpreter/rows/mod.rs:137— ExecutionContext::row_program has cognitive complexity 76 (threshold 15). Drivers by points: if/else 16 (42 pts), loops 8 (23 pts), match/switch 3 (7 pts), boolean chains 4 (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.
ExecutionContext::expansion_batches (cognitive 75) crates/db/src/execution/interpreter/rows/expansion.rs:28— ExecutionContext::expansion_batches has cognitive complexity 75 (threshold 15). Drivers by points: if/else 13 (37 pts), match/switch 9 (27 pts), loops 4 (7 pts), boolean chains 4 (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.
ExecutionContext::graph_batch_required (cognitive 69) crates/db/src/execution/interpreter/rows/graph.rs:159— ExecutionContext::graph_batch_required has cognitive complexity 69 (threshold 15). Drivers by points: if/else 20 (46 pts), match/switch 7 (16 pts), loops 4 (6 pts), boolean chains 1 (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.
ExecutionContext::update_rows (cognitive 65) crates/db/src/execution/interpreter/rows/mutations.rs:210— ExecutionContext::update_rows has cognitive complexity 65 (threshold 15). Drivers by points: if/else 7 (27 pts), match/switch 7 (26 pts), loops 4 (10 pts), boolean chains 2 (nesting depth added 45). Of this number, 64 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecutionContext::projection_chain (cognitive 56) crates/db/src/execution/interpreter/rows/projection_chain.rs:195— ExecutionContext::projection_chain has cognitive complexity 56 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 6 (13 pts), match/switch 4 (12 pts), boolean chains 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.
ExecutionContext::project_rows (cognitive 42) crates/db/src/execution/interpreter/rows/projection.rs:218— ExecutionContext::project_rows has cognitive complexity 42 (threshold 15). Drivers by points: loops 10 (23 pts), if/else 11 (15 pts), boolean chains 4 (nesting depth added 17). 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.
ExecutionContext::eval_resolved (cognitive 42) crates/db/src/execution/interpreter/stream/eval/resolved.rs:112— ExecutionContext::eval_resolved has cognitive complexity 42 (threshold 15). Drivers by points: if/else 9 (28 pts), match/switch 5 (9 pts), loops 2 (5 pts) (nesting depth added 26). 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.
ExecutionContext::create_rows (cognitive 40) crates/db/src/execution/interpreter/rows/mutations.rs:49— ExecutionContext::create_rows has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 6 (13 pts), match/switch 2 (8 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.
ExecutionContext::delete_rows (cognitive 35) crates/db/src/execution/interpreter/rows/mutations.rs:396— ExecutionContext::delete_rows has cognitive complexity 35 (threshold 15). Drivers by points: loops 8 (20 pts), if/else 4 (11 pts), match/switch 1 (4 pts) (nesting depth added 22). 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.
ExecutionContext::project_bindings (cognitive 32) crates/db/src/execution/interpreter/stream/projection/rows.rs:193— ExecutionContext::project_bindings has cognitive complexity 32 (threshold 15). Drivers by points: if/else 4 (16 pts), loops 5 (11 pts), match/switch 1 (4 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.
ExecutionContext::execute_shortest_path (cognitive 31) crates/db/src/execution/interpreter/shortest_path.rs:17— ExecutionContext::execute_shortest_path has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 4 (7 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecutionContext::relationship_scan_batches (cognitive 30) crates/db/src/execution/interpreter/rows/relationship_scan.rs:43— ExecutionContext::relationship_scan_batches has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (6 pts), boolean chains 3, match/switch 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.
ExecutionContext::execute_branch_with_context (cognitive 29) crates/db/src/execution/interpreter/control/branch.rs:41— ExecutionContext::execute_branch_with_context has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 5 (12 pts), boolean chains 1, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ExecutionContext::expansion_ids (cognitive 24) crates/db/src/execution/interpreter/access/expand.rs:104— ExecutionContext::expansion_ids has cognitive complexity 24 (threshold 15). Drivers by points: match/switch 7 (19 pts), if/else 2 (5 pts) (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.
ExecutionContext::aggregate_batches (cognitive 22) crates/db/src/execution/interpreter/rows/aggregation.rs:28— ExecutionContext::aggregate_batches has cognitive complexity 22 (threshold 15). Drivers by points: loops 6 (11 pts), match/switch 3 (8 pts), if/else 2, boolean chains 1 (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ExecutionContext::match_source_ids (cognitive 22) crates/db/src/execution/interpreter/rows/matches.rs:323— ExecutionContext::match_source_ids has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecutionContext::delete_elements (cognitive 21) crates/db/src/execution/interpreter/mutation/node.rs:528— ExecutionContext::delete_elements has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), match/switch 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.
ExecutionContext::project_value_map (cognitive 21) crates/db/src/execution/interpreter/stream/projection/rows.rs:99— ExecutionContext::project_value_map has cognitive complexity 21 (threshold 15). Drivers by points: if/else 2 (9 pts), loops 3 (7 pts), match/switch 2 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecutionContext::row_apply_edits (cognitive 19) crates/db/src/execution/interpreter/mutation/rows.rs:187— ExecutionContext::row_apply_edits has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 2 (4 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ExecutionContext::count_cursor_leaf (cognitive 18) crates/db/src/execution/interpreter/count.rs:1398— ExecutionContext::count_cursor_leaf has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (8 pts), if/else 2 (6 pts), loops 2 (4 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.
ExecutionContext::commit_write_tx (cognitive 18) crates/db/src/execution/interpreter/mutation/tx.rs:271— ExecutionContext::commit_write_tx has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 3, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
ExecutionContext::search_vector_index_with_candidates (cognitive 16) crates/db/src/execution/interpreter/access/search/storage.rs:69— ExecutionContext::search_vector_index_with_candidates has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, match/switch 4 (5 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.
ExecutionContext::distinct_batches (cognitive 16) crates/db/src/execution/interpreter/rows/distinct.rs:42— ExecutionContext::distinct_batches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (8 lines × 2) crates/cypher/src/parser.rs:396— crates/cypher/src/parser.rs:396-403 | crates/cypher/src/parser.rs:410-417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) crates/cypher/src/parser.rs:906— crates/cypher/src/parser.rs:906-913 | crates/cypher/src/sql/expr.rs:1185-1192 — 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/cypher/src/parser.rs:906` it begins part-way through the construct above it, so those 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) crates/db/src/encoding/v2/values/property/property_value.rs:347— crates/db/src/encoding/v2/values/property/property_value.rs:347-354 | crates/db/src/encoding/v2/values/property/property_value.rs:357-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. 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 `left` to `&[f64]` in one and `&[f32]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) crates/db/src/index_lifecycle/secondary.rs:1847— crates/db/src/index_lifecycle/secondary.rs:1847-1854 | crates/db/src/index_lifecycle/text/driver.rs:2564-2571 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary.rs` and `crates/db/src/index_lifecycle/text/driver.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/secondary.rs:1847` it does not close everything it opens, so those 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) crates/db/src/index_lifecycle/secondary.rs:2423— crates/db/src/index_lifecycle/secondary.rs:2423-2430 | crates/db/src/index_lifecycle/secondary.rs:2840-2847 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/secondary.rs:2423` 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) crates/db/src/search/vector/storage/mod.rs:1811— crates/db/src/search/vector/storage/mod.rs:1811-1818 | crates/db/src/search/vector/storage/mod.rs:1836-1843 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) crates/planner/src/analysis/index_atoms/candidate.rs:34— crates/planner/src/analysis/index_atoms/candidate.rs:34-41 | crates/planner/src/analysis/scalar/extract.rs:133-140 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/analysis/index_atoms/candidate.rs:34` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/planner/src/analysis/index_atoms/range.rs:108— crates/planner/src/analysis/index_atoms/range.rs:108-115 | crates/planner/src/analysis/index_atoms/range.rs:121-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/analysis/index_atoms/range.rs:108` it does not close everything it opens, so those 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) crates/planner/src/exec/lowering/costing.rs:283— crates/planner/src/exec/lowering/costing.rs:283-290 | crates/planner/src/exec/lowering/costing.rs:294-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) crates/planner/src/rules/access/sets/subsumption/mod.rs:35— crates/planner/src/rules/access/sets/subsumption/mod.rs:35-42 | crates/planner/src/rules/access/sets/subsumption/mod.rs:52-59 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) crates/planner/src/rules/cardinality.rs:193— crates/planner/src/rules/cardinality.rs:193-200 | crates/planner/src/rules/physical_contracts/root_stream/contract.rs:157-164 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/planner/src/rules/cardinality.rs:1712— crates/planner/src/rules/cardinality.rs:1712-1719 | crates/planner/src/rules/cardinality.rs:1755-1762 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/rules/cardinality.rs:1712` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/server/src/http.rs:165— crates/server/src/http.rs:165-172 | crates/server/src/http.rs:179-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/server/src/http.rs:165` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/server/src/http.rs:218— crates/server/src/http.rs:218-225 | crates/server/src/http.rs:232-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/server/src/http.rs:218` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/db/src/migrations/tenant/envelope.rs:126— crates/db/src/migrations/tenant/envelope.rs:126-133 | crates/db/src/migrations/tenant/envelope.rs:162-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/migrations/tenant/envelope.rs:126` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/db/src/search/text/mod.rs:395— crates/db/src/search/text/mod.rs:395-402 | crates/db/src/search/text/mod.rs:415-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/text/mod.rs:395` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/planner/src/ir/input/search/text.rs:105— crates/planner/src/ir/input/search/text.rs:105-112 | crates/planner/src/ir/input/search/vector.rs:208-215 — 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/planner/src/ir/input/search/text.rs:105` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/db/src/migrations/vector_retirement.rs:482— crates/db/src/migrations/vector_retirement.rs:482-489 | crates/db/src/migrations/vector_retirement.rs:884-891 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/migrations/vector_retirement.rs:482` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/planner/src/ir/access/edge/source.rs:36— crates/planner/src/ir/access/edge/source.rs:36-43 | crates/planner/src/ir/access/node/source.rs:40-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Note first that the copies are not typed on the same thing: the declarations holding them bind `plan` to `EdgeAccessPlan` in one and `NodeAccessPlan` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) crates/planner/src/ir/input/property.rs:40— crates/planner/src/ir/input/property.rs:40-47 | crates/planner/src/ir/input/search/expr.rs:40-47 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 2) crates/planner/src/rules/access/filter/index/edge.rs:82— crates/planner/src/rules/access/filter/index/edge.rs:82-89 | crates/planner/src/rules/access/filter/index/node.rs:82-89 — 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/planner/src/rules/access/filter/index/edge.rs:82` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/db/src/execution/interpreter/rows/lookup.rs:143— crates/db/src/execution/interpreter/rows/lookup.rs:143-153 | crates/db/src/execution/interpreter/rows/lookup.rs:291-298 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/rows/lookup.rs:143` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/db/src/index_lifecycle/failpoints.rs:176— crates/db/src/index_lifecycle/failpoints.rs:176-183 | crates/db/src/migrations/indexes/equality_bitmap.rs:144-153 — 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/db/src/index_lifecycle/failpoints.rs:176` 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 first that the copies are not typed on the same thing: the declarations holding them bind `failpoint` to `IndexOutboxFailpoint` in one and `EqualityBitmapMigrationFailpoint` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 2) crates/db/src/search/text/split.rs:401— crates/db/src/search/text/split.rs:401-408 | crates/db/src/search/text/split.rs:417-424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/search/text/split.rs:401` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) crates/db/src/encoding/v2/values/adjacency/mod.rs:187— crates/db/src/encoding/v2/values/adjacency/mod.rs:187-194 | crates/db/src/encoding/v2/values/adjacency/mod.rs:195-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 3 more in this group — see findings.md.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×27
Duplicated block (14 lines × 2) crates/cli/src/commands/add.rs:150— crates/cli/src/commands/add.rs:150-163 | crates/cli/src/commands/start.rs:99-112 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) crates/db/src/execution/interpreter/access/indexes.rs:304— crates/db/src/execution/interpreter/access/indexes.rs:304-317 | crates/db/src/execution/interpreter/access/indexes.rs:381-394 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/access/indexes.rs:304` 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/db/src/execution/interpreter/count.rs:2280— crates/db/src/execution/interpreter/count.rs:2280-2293 | crates/planner/src/rules/cardinality.rs:2146-2159 — before extracting anything, compare `crates/db/src/execution/interpreter/count.rs` and `crates/planner/src/rules/cardinality.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/count.rs:2280` it begins part-way through the construct above it, so those exact lines 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/db/src/execution/interpreter/mutation/edge.rs:281— crates/db/src/execution/interpreter/mutation/edge.rs:281-294 | crates/db/src/execution/interpreter/mutation/edge.rs:345-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/mutation/edge.rs:281` it begins part-way through the construct above it, so those exact lines 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/db/src/execution/interpreter/mutation/node.rs:222— crates/db/src/execution/interpreter/mutation/node.rs:222-235 | crates/db/src/execution/interpreter/mutation/node.rs:299-312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/mutation/node.rs:222` it begins part-way through the construct above it, so those exact lines 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/db/src/index_lifecycle/queue/publication.rs:1154— crates/db/src/index_lifecycle/queue/publication.rs:1154-1167 | crates/db/src/index_lifecycle/queue/publication.rs:1734-1747 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/queue/publication.rs:1154` it begins part-way through the construct above it, so those exact lines 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/db/src/lib.rs:1430— crates/db/src/lib.rs:1430-1443 | crates/db/src/lib.rs:1718-1731 — both copies are in the same file, so extract the block into 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/db/src/migrations/mod.rs:2526— crates/db/src/migrations/mod.rs:2526-2539 | crates/db/src/migrations/mod.rs:2555-2568 — both copies are in the same file, so extract the block into 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/db/src/search/vector/storage/mod.rs:2520— crates/db/src/search/vector/storage/mod.rs:2520-2533 | crates/db/src/search/vector/storage/mod.rs:2543-2556 — both copies are in the same file, so extract the block into 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/graph-algorithms/src/algorithms/centrality.rs:391— crates/graph-algorithms/src/algorithms/centrality.rs:391-404 | crates/graph-algorithms/src/algorithms/centrality.rs:415-428 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/graph-algorithms/src/algorithms/centrality.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.
Duplicated block (14 lines × 2) crates/planner/src/ir/access/edge/analysis.rs:93— crates/planner/src/ir/access/edge/analysis.rs:93-106 | crates/planner/src/ir/access/edge/analysis.rs:122-135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/ir/access/edge/analysis.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 (14 lines × 2) crates/planner/src/ir/access/node/analysis.rs:102— crates/planner/src/ir/access/node/analysis.rs:102-115 | crates/planner/src/ir/access/node/analysis.rs:131-144 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/ir/access/node/analysis.rs:102` 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/planner/src/planning/selected/native/scoped/control_flow/branch.rs:21— crates/planner/src/planning/selected/native/scoped/control_flow/branch.rs:21-34 | crates/planner/src/planning/selected/native/scoped/control_flow/branch.rs:76-89 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/planning/selected/native/scoped/control_flow/branch.rs:21` it does not close everything it opens, so those exact lines 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/planner/src/rules/physical_contracts/access/source/edge.rs:80— crates/planner/src/rules/physical_contracts/access/source/edge.rs:80-93 | crates/planner/src/rules/physical_contracts/access/source/node.rs:83-96 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/rules/physical_contracts/access/source/edge.rs:80` 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/db/src/search/vector/generation.rs:398— crates/db/src/search/vector/generation.rs:398-411 | crates/db/src/search/vector/generation.rs:512-525 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/planner/src/exec/selected/control_flow/branch.rs:56— crates/planner/src/exec/selected/control_flow/branch.rs:56-69 | crates/planner/src/exec/selected/control_flow/repeat.rs:44-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/exec/selected/control_flow/branch.rs:56` it begins part-way through the construct above it, so those exact lines 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/db/src/migrations/vector_simhash_directory.rs:550— crates/db/src/migrations/vector_simhash_directory.rs:550-563 | crates/db/src/migrations/vector_simhash_directory.rs:755-768 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/migrations/vector_simhash_directory.rs:550` 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) crates/db/src/lib.rs:614— crates/db/src/lib.rs:614-627 | crates/db/src/lib.rs:1139-1152 — both copies are in the same file, so extract the 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) sdks/python/scripts/run_embedded_parity.py:298— sdks/python/scripts/run_embedded_parity.py:298-311 | sdks/python/scripts/run_embedded_parity.py:331-344 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `sdks/python/scripts/run_embedded_parity.py:298` it begins part-way through the construct above it, so those 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) sdks/python/src/helixdb/dsl.py:1390— sdks/python/src/helixdb/dsl.py:1390-1403 | sdks/python/src/helixdb/dsl.py:1427-1440 — both copies are in the same file, so extract the 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) REDACTED:2349— REDACTED:2349-2362 | REDACTED:2845-2858 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
TooManyMethods: ExecutionContext crates/db/src/execution/interpreter/runtime_context.rs:269— TooManyMethods — 328 methods, declared across 78 files: interpreter/count.rs (21), access/rows.rs (15), access/secondary_set.rs (15), access/indexes.rs (13), +74 more file(s). The bar is 30 methods; this is 298 over it, 10.93× 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: HelixDB crates/db/src/lib.rs:979— TooManyMethods — 115 methods, declared across 4 files: src/lib.rs (100), src/index_lifecycle_testing.rs (9), src/cypher.rs (4), cypher/explain.rs (2). The bar is 30 methods; this is 85 over it, 3.83× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: VectorIndex crates/db/src/search/vector/hnsw/index.rs:109— TooManyMethods — 107 methods, declared across 5 files: hnsw/index.rs (55), mutation/mod.rs (36), hnsw/restricted.rs (9), hnsw/search.rs (6), +1 more file(s). The bar is 30 methods; this is 77 over it, 3.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: Traversal REDACTED:1650— TooManyMethods — 106 methods. The bar is 30 methods; this is 76 over it, 3.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Traversal crates/ast/src/traversal.rs:1458— TooManyMethods — 102 methods. The bar is 30 methods; this is 72 over it, 3.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Traversal sdks/typescript/src/dsl.ts:1901— TooManyMethods — 100 methods. The bar is 30 methods; this is 70 over it, 3.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Step sdks/typescript/src/dsl.ts:1351— TooManyMethods — 90 methods. The bar is 30 methods; this is 60 over it, 3.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Graph crates/graph-algorithms/src/model.rs:400— TooManyMethods — 60 methods, declared across 8 files: src/model.rs (20), algorithms/traversal.rs (19), src/transform.rs (7), algorithms/centrality.rs (6), +4 more file(s). The bar is 30 methods; this is 30 over it, 2.00× 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: Translator crates/cypher/src/sql.rs:462— TooManyMethods — 49 methods, declared across 5 files: sql/expr.rs (14), src/sql.rs (10), sql/dml.rs (10), sql/select.rs (8), +1 more file(s). 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. 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: ExecutableDagBuilder crates/planner/src/exec/lowering.rs:39— TooManyMethods — 49 methods, declared across 30 files: exec/lowering.rs (5), access/leaf.rs (4), lowering/batch.rs (4), mutation/emit.rs (3), +26 more file(s). 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. 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: LocalRuntime crates/cli/src/local_runtime.rs:91— TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MutationOpCache crates/db/src/search/vector/hnsw/mutation/mod.rs:2957— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NativeGraph bindings/uniffi/src/graph.rs:400— TooManyMethods — 43 methods. The bar is 30 methods; this is 13 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DbConfig crates/db/src/config/db.rs:184— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: StorageCostProfile crates/planner/src/cost/profile.rs:32— TooManyMethods — 36 methods, declared across 3 files: profile/formulas.rs (33), profile/overrides.rs (2), profile/residual.rs (1). The bar is 30 methods; this is 6 over it, 1.20× 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: NativeGraph sdks/go/graph.go:366— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SubTraversal sdks/typescript/src/dsl.ts:2426— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RuleApplicability crates/planner/src/rules/contracts/applicability.rs:31— TooManyMethods — 32 methods, declared across 2 files: contracts/applicability.rs (31), applicability/matching.rs (1). The bar is 30 methods; this is 2 over it, 1.07× 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: NativeGraph sdks/python/src/helixdb/graph.py:471— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SubTraversal crates/ast/src/traversal.rs:1199— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Edited copy of a member (13 corresponding lines) · ×19
Edited copy of a member (13 corresponding lines) crates/db/src/encoding/v2/values/property/property_value.rs:126— crates/db/src/encoding/v2/values/property/property_value.rs:126-140 | crates/planner/src/analysis/scalar/values.rs:198-210 — 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/db/src/index_lifecycle/text/manifest.rs:54— crates/db/src/index_lifecycle/text/manifest.rs:54-67 | crates/db/src/index_lifecycle/text/validation.rs:178-190 — 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/db/src/index_lifecycle/operation.rs:554— crates/db/src/index_lifecycle/operation.rs:554-566 | crates/db/src/index_lifecycle/operation.rs:569-581 — 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/db/src/encoding/v2/values/indexes/operation_queue/algebra.rs:375— crates/db/src/encoding/v2/values/indexes/operation_queue/algebra.rs:375-387 | crates/db/src/encoding/v2/values/indexes/operation_queue/algebra.rs:390-402 — 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/db/src/encoding/v2/values/indexes/equality/mod.rs:270— crates/db/src/encoding/v2/values/indexes/equality/mod.rs:270-282 | crates/db/src/encoding/v2/values/indexes/range.rs:45-57 — 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/db/src/execution/interpreter/access/params.rs:73— crates/db/src/execution/interpreter/access/params.rs:73-85 | crates/db/src/execution/interpreter/access/params.rs:90-102 — 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/db/src/query_service.rs:359— crates/db/src/query_service.rs:359-371 | crates/db/src/query_service.rs:377-393 — 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/planner/src/ir/index/range/bounds/bound.rs:73— crates/planner/src/ir/index/range/bounds/bound.rs:73-85 | crates/planner/src/ir/index/range/bounds/bound.rs:87-99 — 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/planner/src/rules/root/control_flow/implementation.rs:29— crates/planner/src/rules/root/control_flow/implementation.rs:29-41 | crates/planner/src/rules/root/control_flow/implementation.rs:66-80 — 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/db/src/id_allocator.rs:152— crates/db/src/id_allocator.rs:152-164 | crates/db/src/id_allocator.rs:169-185 — 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/db/src/search/vector/simhash/mod.rs:240— crates/db/src/search/vector/simhash/mod.rs:240-252 | crates/db/src/search/vector/simhash/mod.rs:266-279 — 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/db/src/lib.rs:2494— crates/db/src/lib.rs:2494-2506 | crates/db/src/lib.rs:2513-2525 — 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/planner/src/rules/access/sets/canonical/normalization.rs:57— crates/planner/src/rules/access/sets/canonical/normalization.rs:57-69 | crates/planner/src/rules/access/sets/canonical/normalization.rs:86-101 — 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/db/src/lib.rs:2789— crates/db/src/lib.rs:2789-2801 | crates/db/src/lib.rs:2808-2822 — 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/planner/src/exec/selected/lowering/contracts/delivered/variable.rs:8— crates/planner/src/exec/selected/lowering/contracts/delivered/variable.rs:8-23 | crates/planner/src/rules/physical_contracts/support/delivered.rs:79-91 — 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/server/src/grpc.rs:27— crates/server/src/grpc.rs:27-39 | crates/server/src/http.rs:26-38 — 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/db/src/search/text/restricted.rs:93— crates/db/src/search/text/restricted.rs:93-105 | crates/db/src/search/vector/hnsw/restricted.rs:614-626 — 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) sdks/python/src/helixdb/async_client.py:305— sdks/python/src/helixdb/async_client.py:305-317 | REDACTED:211-223 — 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/planner/src/experiments/fixtures/batch.rs:57— crates/planner/src/experiments/fixtures/batch.rs:57-69 | crates/planner/src/experiments/fixtures/batch.rs:96-108 — These two members are one piece of code written twice and then edited apart: 13 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×19
Edited copy of a member (10 corresponding lines) crates/planner/src/planning/selected/native/stream/accumulator/lowering.rs:34— crates/planner/src/planning/selected/native/stream/accumulator/lowering.rs:34-47 | crates/planner/src/rules/access/pipeline/mod.rs:164-173 — 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/planner/src/planning/selected/native/pipeline.rs:30— crates/planner/src/planning/selected/native/pipeline.rs:30-39 | crates/planner/src/planning/selected/native/scoped/pipeline.rs:25-36 — 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/server/src/http.rs:163— crates/server/src/http.rs:163-172 | crates/server/src/http.rs:216-225 — 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/db/src/encoding/v2/values/indexes/text.rs:54— crates/db/src/encoding/v2/values/indexes/text.rs:54-63 | crates/db/src/encoding/v2/values/indexes/text.rs:80-92 — 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/planner/src/planning/selected/native/scoped/terminal.rs:25— crates/planner/src/planning/selected/native/scoped/terminal.rs:25-38 | crates/planner/src/planning/selected/native/terminal/expr.rs:22-31 — 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) sdks/python/scripts/run_embedded_parity.py:368— sdks/python/scripts/run_embedded_parity.py:368-379 | sdks/python/scripts/run_server_parity.py:495-504 — 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/db/src/execution/interpreter/access/secondary_set.rs:382— crates/db/src/execution/interpreter/access/secondary_set.rs:382-391 | crates/db/src/execution/interpreter/access/secondary_set.rs:404-413 — 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/planner/src/rules/access/sets/equality_range/intersection/edge.rs:113— crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:113-122 | crates/planner/src/rules/access/sets/equality_range/intersection/node.rs:113-122 — 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/planner/src/rules/core/exploration/filter.rs:26— crates/planner/src/rules/core/exploration/filter.rs:26-35 | crates/planner/src/rules/core/exploration/filter.rs:59-70 — 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) REDACTED:118— REDACTED:118-130 | REDACTED:281-290 — 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/db/src/config/indexes.rs:801— crates/db/src/config/indexes.rs:801-810 | crates/db/src/config/indexes.rs:812-821 — 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/db/src/execution/interpreter/reserved/sack.rs:30— crates/db/src/execution/interpreter/reserved/sack.rs:30-40 | crates/db/src/execution/interpreter/reserved/sack.rs:46-55 — 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) sdks/python/scripts/run_server_parity.py:445— sdks/python/scripts/run_server_parity.py:445-454 | sdks/python/scripts/run_server_parity.py:460-469 — 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/db/src/execution/interpreter/access/rows.rs:180— crates/db/src/execution/interpreter/access/rows.rs:180-189 | crates/db/src/execution/interpreter/access/rows.rs:203-212 — 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/planner/src/rules/access/sets/canonical/normalization.rs:113— crates/planner/src/rules/access/sets/canonical/normalization.rs:113-124 | crates/planner/src/rules/access/sets/canonical/normalization.rs:134-143 — 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/planner/src/rules/access/sets/contradiction/edge.rs:18— crates/planner/src/rules/access/sets/contradiction/edge.rs:18-27 | crates/planner/src/rules/access/sets/contradiction/node.rs:18-27 — 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/planner/src/rules/access/order/rules/distinct.rs:30— crates/planner/src/rules/access/order/rules/distinct.rs:30-41 | crates/planner/src/rules/access/order/rules/range_direction.rs:28-37 — 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/db/src/index_lifecycle/vector/driver.rs:2347— crates/db/src/index_lifecycle/vector/driver.rs:2347-2363 | crates/db/src/index_lifecycle/text/driver.rs:1671-1680 — 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/planner/src/relational/projection.rs:58— crates/planner/src/relational/projection.rs:58-67 | crates/planner/src/relational/selection.rs:49-58 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (11 corresponding lines) · ×18
Edited copy of a member (11 corresponding lines) crates/db/src/search/vector/hnsw/mutation/mod.rs:1480— crates/db/src/search/vector/hnsw/mutation/mod.rs:1480-1490 | crates/db/src/search/vector/hnsw/mutation/mod.rs:1506-1522 — 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/db/src/encoding/v2/keys/indexes/secondary.rs:71— crates/db/src/encoding/v2/keys/indexes/secondary.rs:71-84 | crates/db/src/encoding/v2/keys/indexes/secondary.rs:132-142 — 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/db/src/search/text/caching_directory.rs:124— crates/db/src/search/text/caching_directory.rs:124-134 | crates/db/src/search/text/caching_directory.rs:136-146 — 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/planner/src/rules/access/sets/equality_range/range_union/edge.rs:34— crates/planner/src/rules/access/sets/equality_range/range_union/edge.rs:34-44 | crates/planner/src/rules/access/sets/equality_range/range_union/node.rs:34-44 — 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/db/src/execution/interpreter/access/secondary_set.rs:100— crates/db/src/execution/interpreter/access/secondary_set.rs:100-110 | crates/db/src/execution/interpreter/access/secondary_set.rs:118-128 — 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/planner/src/rules/access/sets/equality_range/range_union/edge.rs:10— crates/planner/src/rules/access/sets/equality_range/range_union/edge.rs:10-20 | crates/planner/src/rules/access/sets/equality_range/range_union/node.rs:10-20 — 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) sdks/python/scripts/run_embedded_parity.py:351— sdks/python/scripts/run_embedded_parity.py:351-364 | sdks/python/scripts/run_server_parity.py:517-527 — 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/db/src/lib.rs:2106— crates/db/src/lib.rs:2106-2118 | crates/db/src/lib.rs:2122-2132 — 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/db/src/encoding/v2/keys/data.rs:337— crates/db/src/encoding/v2/keys/data.rs:337-347 | crates/db/src/encoding/v2/keys/managed_index.rs:125-135 — 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/planner/src/rules/access/sets/range/edge.rs:6— crates/planner/src/rules/access/sets/range/edge.rs:6-16 | crates/planner/src/rules/access/sets/range/node.rs:6-16 — 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/planner/src/rules/access/sets/range/edge.rs:18— crates/planner/src/rules/access/sets/range/edge.rs:18-28 | crates/planner/src/rules/access/sets/range/node.rs:18-28 — 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/db/src/merge_operator.rs:490— crates/db/src/merge_operator.rs:490-500 | crates/db/src/merge_operator.rs:507-519 — 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/planner/src/rules/access/filter/mod.rs:81— crates/planner/src/rules/access/filter/mod.rs:81-91 | crates/planner/src/rules/access/pipeline/support/rebuild.rs:29-39 — 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/planner/src/cost/profile/formulas.rs:193— crates/planner/src/cost/profile/formulas.rs:193-206 | crates/planner/src/cost/profile/formulas.rs:230-240 — 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/planner/src/logical/access/window.rs:132— crates/planner/src/logical/access/window.rs:132-142 | crates/planner/src/ir/bounds/stream/range.rs:74-84 — 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/db/src/encoding/v2/keys/data.rs:359— crates/db/src/encoding/v2/keys/data.rs:359-369 | crates/db/src/encoding/v2/keys/managed_index.rs:137-147 — 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/db/src/index_lifecycle/text/driver.rs:624— crates/db/src/index_lifecycle/text/driver.rs:624-634 | crates/db/src/index_lifecycle/vector/driver.rs:1051-1061 — 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) sdks/python/src/helixdb/async_client.py:329— sdks/python/src/helixdb/async_client.py:329-339 | REDACTED:235-245 — 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.
Duplicated block (13 lines × 2) crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:29— crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:29-41 | crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:95-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:29` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) crates/db/src/execution/interpreter/access/indexes.rs:290— crates/db/src/execution/interpreter/access/indexes.rs:290-302 | crates/db/src/execution/interpreter/access/indexes.rs:367-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/access/indexes.rs:290` it does not close everything it opens, so those exact lines 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/db/src/execution/interpreter/count.rs:314— crates/db/src/execution/interpreter/count.rs:314-326 | crates/db/src/execution/interpreter/count.rs:338-350 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/count.rs:314` 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 (13 lines × 2) crates/db/src/execution/interpreter/count.rs:362— crates/db/src/execution/interpreter/count.rs:362-374 | crates/db/src/execution/interpreter/count.rs:386-398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/count.rs:362` 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 (13 lines × 2) crates/db/src/execution/interpreter/count.rs:660— crates/db/src/execution/interpreter/count.rs:660-672 | crates/db/src/execution/interpreter/count.rs:718-730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/count.rs:660` it does not close everything it opens, so those 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, `crates/db/src/execution/interpreter/count.rs:659` calls `default` and `crates/db/src/execution/interpreter/count.rs:717` 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 (13 lines × 2) crates/db/src/execution/interpreter/count.rs:1058— crates/db/src/execution/interpreter/count.rs:1058-1070 | crates/db/src/execution/interpreter/count.rs:1087-1099 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/count.rs:1058` 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 (13 lines × 2) crates/db/src/execution/interpreter/count.rs:1116— crates/db/src/execution/interpreter/count.rs:1116-1128 | crates/db/src/execution/interpreter/count.rs:1145-1157 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/count.rs:1116` 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 (13 lines × 2) crates/db/src/index_lifecycle/secondary.rs:3175— crates/db/src/index_lifecycle/secondary.rs:3175-3187 | crates/db/src/index_lifecycle/secondary.rs:3250-3262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/secondary.rs:3175` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/db/src/index_lifecycle/secondary.rs:3188` calls `Some`, `try_new`, `map_err` and `crates/db/src/index_lifecycle/secondary.rs:3263` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) crates/db/src/merge_operator.rs:155— crates/db/src/merge_operator.rs:155-167 | crates/db/src/merge_operator.rs:179-191 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/merge_operator.rs:155` 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/db/src/search/mod.rs:2493— crates/db/src/search/mod.rs:2493-2505 | crates/db/src/search/mod.rs:2507-2519 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) crates/db/src/search/vector/storage/mod.rs:1933— crates/db/src/search/vector/storage/mod.rs:1933-1945 | crates/db/src/search/vector/storage/mod.rs:1963-1975 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/planner/src/planning/search/access/edge.rs:24— crates/planner/src/planning/search/access/edge.rs:24-36 | crates/planner/src/planning/search/access/node.rs:24-36 — before extracting anything, compare `crates/planner/src/planning/search/access/edge.rs` and `crates/planner/src/planning/search/access/node.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/planning/search/access/edge.rs:24` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/planner/src/planning/search/access/edge.rs:52— crates/planner/src/planning/search/access/edge.rs:52-64 | crates/planner/src/planning/search/access/node.rs:52-64 — before extracting anything, compare `crates/planner/src/planning/search/access/edge.rs` and `crates/planner/src/planning/search/access/node.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/planning/search/access/edge.rs:52` 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/planner/src/rules/access/filter/rules.rs:69— crates/planner/src/rules/access/filter/rules.rs:69-81 | crates/planner/src/rules/access/pipeline/filter.rs:39-51 — 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/planner/src/rules/access/filter/rules.rs:69` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) crates/db/src/search/vector/hnsw/search.rs:692— crates/db/src/search/vector/hnsw/search.rs:692-704 | crates/db/src/search/vector/hnsw/search.rs:852-865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/hnsw/search.rs:692` it begins part-way through the construct above it, so those 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, `crates/db/src/search/vector/hnsw/search.rs:865` calls `saturating_add` and `crates/db/src/search/vector/hnsw/search.rs:704` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:3583— crates/db/src/index_lifecycle_testing/contracts.rs:3583-3595 | crates/db/src/index_lifecycle_testing/contracts.rs:3875-3887 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle_testing/contracts.rs:3583` it does not close everything it opens, so those exact lines 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/planner/src/rules/physical_contracts/support/pipeline.rs:180— crates/planner/src/rules/physical_contracts/support/pipeline.rs:180-192 | crates/planner/src/rules/physical_contracts/support/pipeline.rs:220-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/rules/physical_contracts/support/pipeline.rs:180` it begins part-way through the construct above it, so those exact lines 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/db/src/index_lifecycle_testing/contracts.rs:1255— crates/db/src/index_lifecycle_testing/contracts.rs:1255-1267 | crates/db/src/index_lifecycle_testing/contracts.rs:1834-1846 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/db/src/encoding/v2/keys/indexes/secondary.rs:72— crates/db/src/encoding/v2/keys/indexes/secondary.rs:72-76 | crates/db/src/encoding/v2/keys/managed_index.rs:74-78 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/keys/indexes/secondary.rs:72` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) crates/db/src/encoding/v2/values/indexes/operation_queue/algebra.rs:224— crates/db/src/encoding/v2/values/indexes/operation_queue/algebra.rs:224-229 | crates/db/src/encoding/v2/values/indexes/operation_queue/algebra.rs:259-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/values/indexes/operation_queue/algebra.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 (5 lines × 2) crates/db/src/index_lifecycle/secondary.rs:1017— crates/db/src/index_lifecycle/secondary.rs:1017-1021 | crates/db/src/index_lifecycle/secondary.rs:3473-3477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/secondary.rs:1017` it does not close everything it opens, so those 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 (5 lines × 2) crates/db/src/search/vector/cache/store.rs:266— crates/db/src/search/vector/cache/store.rs:266-271 | crates/db/src/search/vector/cache/store.rs:418-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/cache/store.rs:266` it does not close everything it opens, so those 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/db/src/search/vector/cache/store.rs:416` calls `default` and `crates/db/src/search/vector/cache/store.rs:264` 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 × 2) crates/db/src/search/vector/hnsw/mutation/mod.rs:435— crates/db/src/search/vector/hnsw/mutation/mod.rs:435-439 | crates/db/src/search/vector/hnsw/search.rs:238-242 — 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/db/src/search/vector/hnsw/mutation/mod.rs:435` it does not close everything it opens, so those exact lines 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/planner/src/exec/access/edge.rs:282— crates/planner/src/exec/access/edge.rs:282-286 | crates/planner/src/exec/access/node.rs:431-435 — 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/planner/src/exec/access/edge.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 (5 lines × 2) crates/planner/src/exec/count.rs:1249— crates/planner/src/exec/count.rs:1249-1253 | crates/planner/src/exec/count.rs:1318-1322 — both copies are in the same file, so extract the block into 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/db/src/index_lifecycle_testing.rs:750— crates/db/src/index_lifecycle_testing.rs:750-754 | crates/db/src/search/text/cache.rs:1301-1305 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (5 lines × 2) crates/planner/src/rules/access/filter/index/edge.rs:127— crates/planner/src/rules/access/filter/index/edge.rs:127-131 | crates/planner/src/rules/access/filter/index/node.rs:143-147 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) crates/planner/src/rules/access/pipeline/membership.rs:53— crates/planner/src/rules/access/pipeline/membership.rs:53-57 | crates/planner/src/rules/access/pipeline/source_index.rs:56-60 — 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) sdks/rust/src/lib.rs:759— sdks/rust/src/lib.rs:759-764 | sdks/rust/src/lib.rs:767-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 `sdks/rust/src/lib.rs:759` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) crates/cli/src/commands/cloud/database.rs:248— crates/cli/src/commands/cloud/database.rs:248-252 | crates/cli/src/commands/cloud/service_credential.rs:48-52 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/cli/src/commands/cloud/database.rs:248` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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/db-testkit/src/model.rs:843— crates/db-testkit/src/model.rs:843-847 | crates/planner/src/analysis/scalar/values.rs:159-163 — 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/db-testkit/src/model.rs:843` it does not close everything it opens, so those exact lines 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/db/src/encoding/v2/values/property/property_value.rs:128— crates/db/src/encoding/v2/values/property/property_value.rs:128-132 | crates/db/src/encoding/v2/values/property/property_value.rs:206-210 — both copies are in the same file, so extract the block into 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/db/src/execution/interpreter/rows/projection.rs:335— crates/db/src/execution/interpreter/rows/projection.rs:335-339 | crates/db/src/execution/interpreter/rows/top_k.rs:51-55 — 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/db/src/execution/interpreter/rows/projection.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.
Duplicated block (5 lines × 2) crates/db/src/index_lifecycle/secondary.rs:1841— crates/db/src/index_lifecycle/secondary.rs:1841-1845 | crates/db/src/index_lifecycle/text/driver.rs:2558-2562 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary.rs` and `crates/db/src/index_lifecycle/text/driver.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/secondary.rs:1841` it does not close everything it opens, so those exact lines 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/planner/src/exec/selected/lowering/contracts/delivered/pipeline.rs:38— crates/planner/src/exec/selected/lowering/contracts/delivered/pipeline.rs:38-42 | crates/planner/src/rules/physical_contracts/support/pipeline.rs:153-157 — 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/planner/src/exec/selected/lowering/contracts/delivered/pipeline.rs:38` it does not close everything it opens, so those exact lines 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/planner/src/exec/selected/lowering/contracts/delivered/pipeline.rs:48— crates/planner/src/exec/selected/lowering/contracts/delivered/pipeline.rs:48-52 | crates/planner/src/rules/physical_contracts/support/pipeline.rs:193-197 — 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/planner/src/exec/selected/lowering/contracts/delivered/pipeline.rs:48` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
ExecutionContext::eval_resolved (cyclomatic 42) crates/db/src/execution/interpreter/stream/eval/resolved.rs:112— ExecutionContext::eval_resolved has cyclomatic complexity 42 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ExecutionContext::count_cursor_leaf (cyclomatic 37) crates/db/src/execution/interpreter/count.rs:1398— ExecutionContext::count_cursor_leaf has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ExecutionContext::match_rows (cyclomatic 36) crates/db/src/execution/interpreter/rows/matches.rs:83— ExecutionContext::match_rows has cyclomatic complexity 36 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ExecutionContext::finish_pattern_candidates (cyclomatic 35) crates/db/src/execution/interpreter/rows/matches.rs:569— ExecutionContext::finish_pattern_candidates 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.
ExecutionContext::row_program (cyclomatic 35) crates/db/src/execution/interpreter/rows/mod.rs:137— ExecutionContext::row_program 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.
ExecutionContext::projection_chain (cyclomatic 34) crates/db/src/execution/interpreter/rows/projection_chain.rs:195— ExecutionContext::projection_chain 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.
ExecutionContext::execute_count (cyclomatic 33) crates/db/src/execution/interpreter/count.rs:147— ExecutionContext::execute_count 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.
ExecutionContext::expansion_batches (cyclomatic 33) crates/db/src/execution/interpreter/rows/expansion.rs:28— ExecutionContext::expansion_batches 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.
ExecutionContext::graph_batch_required (cyclomatic 29) crates/db/src/execution/interpreter/rows/graph.rs:159— ExecutionContext::graph_batch_required 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.
ExecutionContext::update_rows (cyclomatic 26) crates/db/src/execution/interpreter/rows/mutations.rs:210— ExecutionContext::update_rows has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 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.
ExecutionContext::project_rows (cyclomatic 24) crates/db/src/execution/interpreter/rows/projection.rs:218— ExecutionContext::project_rows has cyclomatic complexity 24 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ExecutionContext::node_secondary_ids (cyclomatic 16) crates/db/src/execution/interpreter/access/secondary_set.rs:510— ExecutionContext::node_secondary_ids 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.
ExecutionContext::execute_branch_with_context (cyclomatic 16) crates/db/src/execution/interpreter/control/branch.rs:41— ExecutionContext::execute_branch_with_context 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.
ExecutionContext::create_rows (cyclomatic 16) crates/db/src/execution/interpreter/rows/mutations.rs:49— ExecutionContext::create_rows 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.
ExecutionContext::relationship_scan_batches (cyclomatic 16) crates/db/src/execution/interpreter/rows/relationship_scan.rs:43— ExecutionContext::relationship_scan_batches 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.
ExecutionContext::execute_shortest_path (cyclomatic 16) crates/db/src/execution/interpreter/shortest_path.rs:17— ExecutionContext::execute_shortest_path has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
D4 · Code Duplication· Edited copy of a member (16 corresponding lines) · ×15
Edited copy of a member (16 corresponding lines) crates/db-testkit/src/model.rs:1056— crates/db-testkit/src/model.rs:1056-1073 | crates/value-semantics/src/lib.rs:156-171 — 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/metrics/src/query.rs:429— crates/metrics/src/query.rs:429-444 | crates/metrics/src/query.rs:446-462 — 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/planner/src/logical/memo_children/control.rs:15— crates/planner/src/logical/memo_children/control.rs:15-30 | crates/planner/src/planning/selected/control/branch.rs:9-24 — 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/planner/src/ir/index/range/bounds/bound.rs:101— crates/planner/src/ir/index/range/bounds/bound.rs:101-116 | crates/planner/src/ir/index/range/bounds/bound.rs:118-133 — 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/db/src/search/vector/hnsw/index.rs:1378— crates/db/src/search/vector/hnsw/index.rs:1378-1393 | crates/db/src/search/vector/hnsw/index.rs:1440-1463 — 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/db/src/config/runtime_catalog.rs:362— crates/db/src/config/runtime_catalog.rs:362-377 | crates/db/src/config/runtime_catalog.rs:385-406 — 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/planner/src/planning/selected/native/root_stream/ast/control_flow.rs:12— crates/planner/src/planning/selected/native/root_stream/ast/control_flow.rs:12-27 | crates/planner/src/planning/selected/native/scoped/root_stream/control_flow.rs:14-29 — 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/db/src/search/vector/storage/transaction.rs:176— crates/db/src/search/vector/storage/transaction.rs:176-191 | crates/db/src/search/vector/storage/transaction.rs:197-213 — 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/planner/src/ir/index/range/bounds/range.rs:158— crates/planner/src/ir/index/range/bounds/range.rs:158-173 | crates/planner/src/ir/index/range/bounds/range.rs:200-215 — 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/planner/src/analysis/index_atoms/equality.rs:208— crates/planner/src/analysis/index_atoms/equality.rs:208-223 | crates/planner/src/analysis/scalar/values.rs:237-252 — 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/db/src/search/vector/storage/mod.rs:1932— crates/db/src/search/vector/storage/mod.rs:1932-1952 | crates/db/src/search/vector/storage/mod.rs:2037-2052 — 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/db/src/encoding/v2/values/lifecycle/operation_record.rs:229— crates/db/src/encoding/v2/values/lifecycle/operation_record.rs:229-244 | crates/db/src/encoding/v2/values/lifecycle/operation_record.rs:246-265 — 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/planner/src/rules/access/sets/equality_range/range_union/removal.rs:20— crates/planner/src/rules/access/sets/equality_range/range_union/removal.rs:20-36 | crates/planner/src/rules/access/sets/subsumption/mod.rs:68-83 — 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/db/src/migrations/mod.rs:1241— crates/db/src/migrations/mod.rs:1241-1256 | crates/db/src/migrations/mod.rs:1261-1276 — 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) sdks/go/cmd/generate-parity-fixtures/main.go:310— sdks/go/cmd/generate-parity-fixtures/main.go:310-326 | sdks/go/cmd/generate-parity-fixtures/main.go:329-344 — 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.
helix_planner::relational::planning::plan_accesses (cognitive 229) crates/planner/src/relational/planning.rs:226— helix_planner::relational::planning::plan_accesses has cognitive complexity 229 (threshold 15). Drivers by points: if/else 41 (147 pts), match/switch 12 (40 pts), loops 12 (28 pts), boolean chains 14 (nesting depth added 150). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_planner::relational::evaluation::binary (cognitive 40) crates/planner/src/relational/evaluation.rs:884— helix_planner::relational::evaluation::binary has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 7 (14 pts), boolean chains 4, loops 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.
helix_planner::relational::planning::index_predicate (cognitive 39) crates/planner/src/relational/planning.rs:1049— helix_planner::relational::planning::index_predicate has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 5 (11 pts), loops 3 (8 pts), boolean chains 4 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_planner::rules::cardinality::fold_cursor (cognitive 29) crates/planner/src/rules/cardinality.rs:284— helix_planner::rules::cardinality::fold_cursor has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_planner::relational::consumers::prepare (cognitive 26) crates/planner/src/relational/consumers.rs:13— helix_planner::relational::consumers::prepare has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 6, match/switch 2 (3 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.
helix_planner::optimizer::driver::exploration::explore (cognitive 24) crates/planner/src/optimizer/driver/exploration.rs:23— helix_planner::optimizer::driver::exploration::explore has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 2 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_planner::exec::validation::contracts::validate_step_contracts (cognitive 23) crates/planner/src/exec/validation/contracts.rs:7— helix_planner::exec::validation::contracts::validate_step_contracts has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_planner::relational::evaluation::integer::from_decimal (cognitive 22) crates/planner/src/relational/evaluation/integer.rs:12— helix_planner::relational::evaluation::integer::from_decimal has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 5, match/switch 3 (4 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.
helix_planner::relational::planning::collect_ranges (cognitive 22) crates/planner/src/relational/planning.rs:1529— helix_planner::relational::planning::collect_ranges has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (7 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.
helix_planner::rules::access::filter::atoms::collect::access_filter_index_atom (cognitive 17) crates/planner/src/rules/access/filter/atoms/collect.rs:46— helix_planner::rules::access::filter::atoms::collect::access_filter_index_atom has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_planner::rules::physical_contracts::support::pipeline::stream_pipeline_op_contract (cognitive 17) crates/planner/src/rules/physical_contracts/support/pipeline.rs:51— helix_planner::rules::physical_contracts::support::pipeline::stream_pipeline_op_contract has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 10 (17 pts) (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.
helix_planner::analysis::prune::prune_junction (cognitive 16) crates/planner/src/analysis/prune.rs:78— helix_planner::analysis::prune::prune_junction has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (10 pts), if/else 2 (3 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
helix_planner::rules::cardinality::node_equality_count (cognitive 16) crates/planner/src/rules/cardinality.rs:740— helix_planner::rules::cardinality::node_equality_count has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 7 (14 pts), if/else 1 (2 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
helix_planner::rules::stream::window::compose::compose_static_stream_windows (cognitive 16) crates/planner/src/rules/stream/window/compose.rs:6— helix_planner::rules::stream::window::compose::compose_static_stream_windows has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 4 (6 pts), loops 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D4 · Code Duplication· Edited copy of a member (9 corresponding lines) · ×14
Edited copy of a member (9 corresponding lines) crates/planner/src/ir/bounds/search.rs:193— crates/planner/src/ir/bounds/search.rs:193-201 | crates/planner/src/ir/bounds/stream/bound.rs:219-227 — 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/planner/src/analysis/labels.rs:43— crates/planner/src/analysis/labels.rs:43-51 | crates/planner/src/analysis/labels.rs:53-61 — 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/planner/src/exec/access/ordering.rs:8— crates/planner/src/exec/access/ordering.rs:8-16 | crates/planner/src/rules/physical_contracts/access/delivered.rs:46-54 — 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/planner/src/rules/access/sources/sets.rs:5— crates/planner/src/rules/access/sources/sets.rs:5-13 | crates/planner/src/rules/access/sources/sets.rs:17-25 — 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/planner/src/rules/access/sources/sets.rs:29— crates/planner/src/rules/access/sources/sets.rs:29-37 | crates/planner/src/rules/access/sources/sets.rs:41-49 — 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/db/src/id_allocator.rs:240— crates/db/src/id_allocator.rs:240-251 | crates/db/src/id_allocator.rs:368-376 — 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/db/src/execution/interpreter/rows/projection.rs:141— crates/db/src/execution/interpreter/rows/projection.rs:141-149 | crates/db/src/execution/interpreter/rows/top_k.rs:145-155 — 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/planner/src/rules/access/sets/subsumption/mod.rs:34— crates/planner/src/rules/access/sets/subsumption/mod.rs:34-42 | crates/planner/src/rules/access/sets/subsumption/mod.rs:51-59 — 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) sdks/rust/src/lib.rs:690— sdks/rust/src/lib.rs:690-700 | sdks/rust/src/lib.rs:742-750 — 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/db/src/execution/interpreter/control/branch.rs:31— crates/db/src/execution/interpreter/control/branch.rs:31-39 | crates/db/src/execution/interpreter/control/repeat.rs:14-22 — 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/db/src/index_lifecycle/queue/backlog.rs:1013— crates/db/src/index_lifecycle/queue/backlog.rs:1013-1024 | crates/db/src/search/vector/cache/store.rs:794-802 — 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/db/src/encoding/v2/values/codec.rs:231— crates/db/src/encoding/v2/values/codec.rs:231-239 | crates/db/src/encoding/v2/values/indexes/operation_queue/mod.rs:1168-1176 — 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/db/src/encoding/v2/values/codec.rs:621— crates/db/src/encoding/v2/values/codec.rs:621-629 | crates/db/src/encoding/v2/values/indexes/operation_queue/mod.rs:954-963 — 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/planner/src/experiments/fixtures/batch.rs:128— crates/planner/src/experiments/fixtures/batch.rs:128-139 | crates/planner/src/experiments/fixtures/batch.rs:302-310 — 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.
Duplicated block (15 lines × 2) bindings/uniffi/src/graph.rs:913— bindings/uniffi/src/graph.rs:913-927 | bindings/uniffi/src/graph.rs:950-964 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:83— crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:83-97 | crates/db/src/encoding/v2/keys/indexes/vector/upper_layers.rs:23-37 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs` and `crates/db/src/encoding/v2/keys/indexes/vector/upper_layers.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) crates/db/src/encoding/v2/keys/indexes/vector/storage_prefixes.rs:181— crates/db/src/encoding/v2/keys/indexes/vector/storage_prefixes.rs:181-195 | crates/db/src/encoding/v2/keys/indexes/vector/storage_prefixes.rs:234-248 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) crates/db/src/execution/interpreter/rows/bound_match.rs:186— crates/db/src/execution/interpreter/rows/bound_match.rs:186-200 | crates/db/src/execution/interpreter/rows/correlated.rs:228-242 — 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/db/src/execution/interpreter/rows/bound_match.rs:186` 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/db/src/index_lifecycle/queue/publication.rs:1126— crates/db/src/index_lifecycle/queue/publication.rs:1126-1140 | crates/db/src/index_lifecycle/queue/publication.rs:1715-1729 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/queue/publication.rs:1126` 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 (15 lines × 2) crates/db/src/index_lifecycle/worker.rs:729— crates/db/src/index_lifecycle/worker.rs:729-743 | crates/db/src/index_lifecycle/worker.rs:791-805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/worker.rs:729` it does not close everything it opens, so those exact lines 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/db/src/index_lifecycle_testing/contracts.rs:4225— crates/db/src/index_lifecycle_testing/contracts.rs:4225-4239 | crates/db/src/index_lifecycle_testing/contracts.rs:4325-4339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle_testing/contracts.rs:4225` it does not close everything it opens, so those 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/db/src/index_lifecycle_testing/contracts.rs:4323` calls `Fn` and `crates/db/src/index_lifecycle_testing/contracts.rs:4223` 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) crates/db/src/search/text/mod.rs:1174— crates/db/src/search/text/mod.rs:1174-1188 | crates/db/src/search/text/mod.rs:1196-1210 — both copies are in the same file, so extract the 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) crates/db/src/search/vector/hnsw/restricted.rs:1130— crates/db/src/search/vector/hnsw/restricted.rs:1130-1144 | crates/db/src/search/vector/hnsw/restricted.rs:1443-1457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/hnsw/restricted.rs:1130` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) crates/planner/src/exec/access/edge.rs:310— crates/planner/src/exec/access/edge.rs:310-324 | crates/planner/src/exec/access/node.rs:474-488 — 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/planner/src/exec/access/edge.rs:310` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/planner/src/exec/access/node.rs:473` calls `take` and `crates/planner/src/exec/access/edge.rs:309` 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) crates/planner/src/exec/lowering/costing.rs:390— crates/planner/src/exec/lowering/costing.rs:390-404 | crates/planner/src/exec/lowering/costing.rs:514-528 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/exec/lowering/costing.rs:390` it begins part-way through the construct above it, so those exact lines 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/planner/src/exec/lowering/secondary_set.rs:258— crates/planner/src/exec/lowering/secondary_set.rs:258-272 | crates/planner/src/exec/lowering/secondary_set.rs:320-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/exec/lowering/secondary_set.rs:258` 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 `child` to `exec::ExecNodeSecondarySetPlan` in one and `exec::ExecEdgeSecondarySetPlan` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 2) crates/planner/src/rules/cardinality.rs:1482— crates/planner/src/rules/cardinality.rs:1482-1496 | crates/planner/src/rules/cardinality.rs:1559-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/rules/cardinality.rs:1482` 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 first that the copies are not typed on the same thing: the declarations holding them bind `children` to `&ir::AtLeast<ir::NodeAccessSourcePlan, 2>` in one and `&ir::AtLeast<ir::EdgeAccessSourcePlan, 2>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (15 lines × 2) crates/planner/src/rules/cardinality.rs:1421— crates/planner/src/rules/cardinality.rs:1421-1435 | crates/planner/src/rules/cardinality.rs:1445-1459 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/rules/cardinality.rs:1421` it begins part-way through the construct above it, so those 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 `children` to `&ir::AtLeast<ir::NodeAccessSourcePlan, 2>` in one and `&ir::AtLeast<ir::EdgeAccessSourcePlan, 2>` 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.
helix_planner::relational::planning::plan_accesses (cyclomatic 84) crates/planner/src/relational/planning.rs:226— helix_planner::relational::planning::plan_accesses has cyclomatic complexity 84 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
helix_planner::relational::evaluation::binary (cyclomatic 42) crates/planner/src/relational/evaluation.rs:884— helix_planner::relational::evaluation::binary has cyclomatic complexity 42 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
helix_planner::analysis::scalar::truth::static_predicate_value (cyclomatic 27) crates/planner/src/analysis/scalar/truth.rs:13— helix_planner::analysis::scalar::truth::static_predicate_value 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.
helix_planner::relational::planning::index_predicate (cyclomatic 26) crates/planner/src/relational/planning.rs:1049— helix_planner::relational::planning::index_predicate 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.
helix_planner::relational::consumers::prepare (cyclomatic 21) crates/planner/src/relational/consumers.rs:13— helix_planner::relational::consumers::prepare 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.
helix_planner::rules::cardinality::fold_cursor (cyclomatic 21) crates/planner/src/rules/cardinality.rs:284— helix_planner::rules::cardinality::fold_cursor 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: helix_planner::rules::cardinality::count_plan_cursor (cyclomatic 31) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
helix_planner::rules::physical_contracts::support::pipeline::stream_pipeline_op_contract (cyclomatic 20) crates/planner/src/rules/physical_contracts/support/pipeline.rs:51— helix_planner::rules::physical_contracts::support::pipeline::stream_pipeline_op_contract has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
helix_planner::relational::evaluation::integer::from_decimal (cyclomatic 18) crates/planner/src/relational/evaluation/integer.rs:12— helix_planner::relational::evaluation::integer::from_decimal 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.
helix_planner::relational::planning::bound_value (cyclomatic 17) crates/planner/src/relational/planning.rs:1663— helix_planner::relational::planning::bound_value 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.
helix_planner::analysis::prune::prune_junction (cyclomatic 16) crates/planner/src/analysis/prune.rs:78— helix_planner::analysis::prune::prune_junction 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.
helix_planner::exec::selected::lowering::contracts::delivered::pipeline::selected_stream_pipeline_delivered_properties (cyclomatic 16) crates/planner/src/exec/selected/lowering/contracts/delivered/pipeline.rs:6— helix_planner::exec::selected::lowering::contracts::delivered::pipeline::selected_stream_pipeline_delivered_properties 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.
helix_planner::rules::access::filter::atoms::merge_literal_equality_branches (cyclomatic 16) crates/planner/src/rules/access/filter/atoms/mod.rs:177— helix_planner::rules::access::filter::atoms::merge_literal_equality_branches has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
helix_planner::rules::physical_contracts::pipeline::delivered::delivered_after_pipeline_op (cyclomatic 16) crates/planner/src/rules/physical_contracts/pipeline/delivered.rs:7— helix_planner::rules::physical_contracts::pipeline::delivered::delivered_after_pipeline_op 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.
ClassTooLong: VectorRows crates/db/src/search/vector/storage/mod.rs:291— ClassTooLong — 994 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 3 blocks, lines 291-2310. The bar is 400 significant lines; this is 594 over it, 2.49× 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: VectorIndex crates/db/src/search/vector/hnsw/index.rs:109— ClassTooLong — 853 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 107 methods, 2 blocks, lines 109-1634. The bar is 400 significant lines; this is 453 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LocalRuntime crates/cli/src/local_runtime.rs:91— ClassTooLong — 681 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 91-1181. The bar is 400 significant lines; this is 281 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Traversal crates/ast/src/traversal.rs:1458— 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), 102 methods, 6 blocks, lines 1458-2599. 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.
ClassTooLong: Parser crates/cypher/src/parser.rs:22— ClassTooLong — 636 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods, 2 blocks, lines 22-887. The bar is 400 significant lines; this is 236 over it, 1.59× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Evaluation crates/planner/src/relational/evaluation.rs:18— ClassTooLong — 605 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 3 blocks, lines 18-836. The bar is 400 significant lines; this is 205 over it, 1.51× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Analyzer crates/planner/src/diagnostics/analyze.rs:12— ClassTooLong — 529 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 14 methods, 2 blocks, lines 12-688. The bar is 400 significant lines; this is 129 over it, 1.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FtsCache crates/db/src/search/text/cache.rs:352— ClassTooLong — 517 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods. The bar is 400 significant lines; this is 117 over it, 1.29× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Source crates/db/src/execution/interpreter/pull/source.rs:24— ClassTooLong — 464 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 2 blocks, lines 24-697. The bar is 400 significant lines; this is 64 over it, 1.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LifecycleTestController crates/db/src/index_lifecycle_testing.rs:895— ClassTooLong — 452 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods. The bar is 400 significant lines; this is 52 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: NativeGraph bindings/uniffi/src/graph.rs:400— ClassTooLong — 451 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 43 methods, 4 blocks, lines 400-1066. The bar is 400 significant lines; this is 51 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Binder crates/cypher/src/bind.rs:589— ClassTooLong — 445 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 10 methods, 2 blocks, lines 589-1186. The bar is 400 significant lines; this is 45 over it, 1.11× 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: Step sdks/typescript/src/dsl.ts:1351— ClassTooLong — 423 significant lines (blank, comment-only and punctuation-only lines excluded), 90 methods. The bar is 400 significant lines; this is 23 over it, 1.06× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities· Medium CVE · ×13
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (20 corresponding lines) · ×12
Edited copy of a member (20 corresponding lines) crates/db/src/search/text/mod.rs:1531— crates/db/src/search/text/mod.rs:1531-1550 | crates/db/src/search/text/mod.rs:1556-1576 — 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/db/src/merge_operator.rs:331— crates/db/src/merge_operator.rs:331-350 | crates/db/src/merge_operator.rs:357-380 — 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/planner/src/rules/access/filter/rules.rs:62— crates/planner/src/rules/access/filter/rules.rs:62-81 | crates/planner/src/rules/access/pipeline/filter.rs:28-51 — 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/db/src/search/vector/storage/mod.rs:1810— crates/db/src/search/vector/storage/mod.rs:1810-1830 | crates/db/src/search/vector/storage/mod.rs:1835-1854 — 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/db/src/config/definition_differences.rs:156— crates/db/src/config/definition_differences.rs:156-175 | crates/db/src/config/definition_differences.rs:232-251 — 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/db/src/migrations/mod.rs:3992— crates/db/src/migrations/mod.rs:3992-4011 | crates/db/src/migrations/mod.rs:4016-4035 — 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/planner/src/rules/cardinality.rs:1856— crates/planner/src/rules/cardinality.rs:1856-1875 | crates/planner/src/rules/cardinality.rs:1881-1900 — 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/db/src/index_lifecycle_testing/contracts.rs:3124— crates/db/src/index_lifecycle_testing/contracts.rs:3124-3143 | crates/db/src/index_lifecycle_testing/contracts/all_index_validation.rs:1026-1055 — 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/planner/src/rules/access/filter/index/label_domain.rs:61— crates/planner/src/rules/access/filter/index/label_domain.rs:61-80 | crates/planner/src/rules/access/filter/index/label_domain.rs:85-104 — 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/planner/src/planning/selected/native/root_stream/ast/mod.rs:37— crates/planner/src/planning/selected/native/root_stream/ast/mod.rs:37-56 | crates/planner/src/planning/selected/native/scoped/root_stream/mod.rs:44-66 — 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/db/src/search/vector/hnsw/index.rs:1301— crates/db/src/search/vector/hnsw/index.rs:1301-1323 | crates/db/src/search/vector/hnsw/index.rs:1408-1427 — 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/db/src/index_lifecycle/text/serving.rs:40— crates/db/src/index_lifecycle/text/serving.rs:40-59 | crates/db/src/index_lifecycle/vector/driver.rs:3022-3045 — These two members are one piece of code written twice and then edited apart: 20 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (19 corresponding lines) · ×12
Edited copy of a member (19 corresponding lines) sdks/python/scripts/cypher_parity.py:33— sdks/python/scripts/cypher_parity.py:33-51 | sdks/python/scripts/cypher_parity.py:55-73 — 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/db/src/execution/interpreter/access/rows.rs:114— crates/db/src/execution/interpreter/access/rows.rs:114-132 | crates/db/src/execution/interpreter/access/rows.rs:148-166 — 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/planner/src/rules/cardinality.rs:1417— crates/planner/src/rules/cardinality.rs:1417-1435 | crates/planner/src/rules/cardinality.rs:1441-1459 — 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/db/src/search/text/mod.rs:1116— crates/db/src/search/text/mod.rs:1116-1142 | crates/db/src/search/text/mod.rs:1148-1166 — 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/planner/src/planning/selected/native/batch/draft/entry.rs:38— crates/planner/src/planning/selected/native/batch/draft/entry.rs:38-56 | crates/planner/src/planning/selected/native/batch/draft/entry.rs:81-99 — 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/planner/src/rules/access/sets/equality_range/intersection/edge.rs:138— crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:138-156 | crates/planner/src/rules/access/sets/equality_range/intersection/node.rs:138-156 — 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/planner/src/ir/access/node/analysis.rs:64— crates/planner/src/ir/access/node/analysis.rs:64-82 | crates/planner/src/ir/access/node/membership.rs:323-346 — 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/db/src/encoding/v2/values/indexes/operation_queue/algebra.rs:274— crates/db/src/encoding/v2/values/indexes/operation_queue/algebra.rs:274-292 | crates/db/src/encoding/v2/values/indexes/operation_queue/mod.rs:1147-1166 — 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/db/src/index_lifecycle_testing/contracts.rs:395— crates/db/src/index_lifecycle_testing/contracts.rs:395-421 | crates/db/src/index_lifecycle_testing/contracts/text_build_reconciliation.rs:208-226 — 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/db/src/encoding/v2/values/edge_endpoints.rs:51— crates/db/src/encoding/v2/values/edge_endpoints.rs:51-69 | crates/db/src/migrations/mod.rs:4118-4139 — 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/db/src/index_lifecycle/text/cleanup.rs:219— crates/db/src/index_lifecycle/text/cleanup.rs:219-237 | crates/db/src/index_lifecycle/text/cleanup.rs:244-263 — 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/db/src/search/vector/cache/registry.rs:328— crates/db/src/search/vector/cache/registry.rs:328-346 | crates/db/src/search/vector/cache/registry.rs:390-409 — 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 (7 corresponding lines) · ×12
Edited copy of a member (7 corresponding lines) bindings/uniffi/src/helix_db.rs:180— bindings/uniffi/src/helix_db.rs:180-186 | bindings/uniffi/src/helix_db.rs:200-206 — 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/planner/src/rules/access/sets/equality_range/intersection/edge.rs:126— crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:126-132 | crates/planner/src/rules/access/sets/equality_range/intersection/node.rs:126-132 — 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/db/src/migrations/mod.rs:1181— crates/db/src/migrations/mod.rs:1181-1188 | crates/db/src/migrations/mod.rs:1190-1196 — 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/planner/src/analysis/labels.rs:291— crates/planner/src/analysis/labels.rs:291-301 | crates/planner/src/analysis/scalar/extract.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/planner/src/exec/validation/order.rs:144— crates/planner/src/exec/validation/order.rs:144-151 | crates/planner/src/exec/validation/order.rs:153-159 — 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/cypher/src/sql.rs:500— crates/cypher/src/sql.rs:500-506 | crates/cypher/src/sql.rs:509-519 — 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/db/src/search/text/caching_directory.rs:177— crates/db/src/search/text/caching_directory.rs:177-183 | crates/db/src/search/text/split.rs:632-638 — 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/server/src/grpc.rs:238— crates/server/src/grpc.rs:238-244 | crates/server/src/http.rs:389-395 — 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/db/src/encoding/v2/keys/indexes/property.rs:32— crates/db/src/encoding/v2/keys/indexes/property.rs:32-38 | crates/db/src/search/mod.rs:301-310 — 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/db/src/config/cache.rs:860— crates/db/src/config/cache.rs:860-867 | crates/db/src/config/utils.rs:87-93 — 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/ast/src/index.rs:214— crates/ast/src/index.rs:214-220 | crates/ast/src/traversal.rs:1774-1782 — 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/db/src/execution/interpreter/rows/projection.rs:107— crates/db/src/execution/interpreter/rows/projection.rs:107-113 | crates/db/src/execution/interpreter/rows/requirements.rs:13-19 — 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.
Repeated repair: crates/cli/src/local_runtime.rs crates/cli/src/local_runtime.rs:768— crates/cli/src/local_runtime.rs changed 48 times in last 90 days and 29 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is LocalRuntime::ensure_image at line 768), 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(server): default the disk cache budget to 8 GiB”; “fix(cli): give S3-backed local instances a small disk cache volume”; “fix(cli): harden Cloud resolution and the --json contract after review”; “fix(cli): name init projects after the real directory and shorten image digests”. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/cli/src/local_runtime.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: crates/db/src/search/text/cache.rs crates/db/src/search/text/cache.rs:961— crates/db/src/search/text/cache.rs changed 14 times in last 90 days and 13 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is FtsCache::cleanup_disk at line 961), 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(db): recheck the disk only after a full-text split open missed it”; “fix(db): reopen full-text splits from disk once hydration publishes them”; “fix(db): keep FTS disk cleanup inside the cache's close”; “fix(db): leave no hydration staging file behind on any error or cancel”. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/search/text/cache.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/planner/src/rules/access/filter/index/membership.rs crates/planner/src/rules/access/filter/index/membership.rs:38— crates/planner/src/rules/access/filter/index/membership.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is helix_planner::rules::access::filter::index::membership::index_membership_filter at line 38), 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(db,planner): address membership review findings”; “fix(planner): price membership row by row with the residual formula”; “fix(planner): bind unscoped membership to one label and price its misses”; “fix(planner,db): keep range scans out of index membership”. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/planner/src/rules/access/filter/index/membership.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/cli/src/commands/query.rs crates/cli/src/commands/query.rs:124— crates/cli/src/commands/query.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is helix_cli::commands::query::execute at line 124), 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(cli): harden Cloud resolution and the --json contract after review”; “fix(cli): print query results under --quiet and document RFC 3339 log times”; “fix(cli): protect query credentials”; “fix(cli): format query auth headers”. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/cli/src/commands/query.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/planner/src/optimizer/driver/exploration.rs crates/planner/src/optimizer/driver/exploration.rs:23— crates/planner/src/optimizer/driver/exploration.rs changed 5 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 13 (its worst body is helix_planner::optimizer::driver::exploration::explore at line 23), 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(planner): replace the wall-clock exploration budget with a rule-fire budget”; “fix(planner): keep every implementation-deferred rewrite after the time budget”; “fix(planner): keep the required empty-input rewrite after the time budget”; “fix(planner): keep implementing queued expressions after the time budget expires”. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/planner/src/optimizer/driver/exploration.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/cli/src/commands/metrics.rs crates/cli/src/commands/metrics.rs:12— crates/cli/src/commands/metrics.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is helix_cli::commands::metrics::run at line 12), 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(cli): harden Cloud resolution and the --json contract after review”; “fix(cli): apply rustfmt to metrics email test”; “fix(cli): handle EOF and invalid email input in metrics full”. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/cli/src/commands/metrics.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/planner/src/digest.rs crates/planner/src/digest.rs:137— crates/planner/src/digest.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is JsonFnv64::write at line 137), 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(planner): digest with the standard library's SipHash”; “fix(planner): hash digest words with a step no word can reset”; “fix(planner): screen wide subsumption sets with a signed-zero-blind digest”. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/planner/src/digest.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/db/src/execution/interpreter/pull/value.rs crates/db/src/execution/interpreter/pull/value.rs:15— crates/db/src/execution/interpreter/pull/value.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is Shape::of at line 15), 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(db,planner): merge partly indexed OR branches in ID order”; “fix: preserve pull value contracts and bounded reverse scans”; “fix: preserve terminal lifecycle values through pure regions”. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/db/src/execution/interpreter/pull/value.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/planner/src/rules/contracts/applicability.rs crates/planner/src/rules/contracts/applicability.rs:290— crates/planner/src/rules/contracts/applicability.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is RuleApplicability::is_required_rewrite at line 290), 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(planner): replace the wall-clock exploration budget with a rule-fire budget”; “fix(planner): keep every implementation-deferred rewrite after the time budget”; “fix(planner): keep the required empty-input rewrite after the time budget”. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/planner/src/rules/contracts/applicability.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/cli/src/commands/prune.rs crates/cli/src/commands/prune.rs:10— crates/cli/src/commands/prune.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is helix_cli::commands::prune::run at line 10), 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(cli): harden Cloud resolution and the --json contract after review”; “fix: address review on instance-name validation and CI failures”; “fix: close remaining instance-name validation gaps flagged in review”. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/cli/src/commands/prune.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/cli/src/commands/cloud/project.rs crates/cli/src/commands/cloud/project.rs:9— crates/cli/src/commands/cloud/project.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is helix_cli::commands::cloud::project::run at line 9), 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(cli): address review of Cloud resolution and --json”; “fix(cli): harden Cloud resolution and the --json contract after review”; “fix(cli): align linked markers and colour states in Cloud tables”. 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-08-16..2026-11-14, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-08-16 10:33:25 +00:00' --until='2026-11-14 10:33:25 +00:00' --full-history --no-merges -- crates/cli/src/commands/cloud/project.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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×11
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×11
Edited copy of a member (18 corresponding lines) crates/planner/src/ir/index/range/value.rs:20— crates/planner/src/ir/index/range/value.rs:20-37 | crates/planner/src/ir/index/range/value.rs:223-240 — 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) sdks/python/scripts/cypher_parity.py:77— sdks/python/scripts/cypher_parity.py:77-94 | sdks/python/scripts/cypher_parity.py:100-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/db/src/execution/interpreter/count.rs:546— crates/db/src/execution/interpreter/count.rs:546-567 | crates/db/src/execution/interpreter/count.rs:569-586 — 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/planner/src/analysis/scalar/values.rs:20— crates/planner/src/analysis/scalar/values.rs:20-37 | crates/planner/src/analysis/scalar/values.rs:138-155 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) crates/server/src/http.rs:193— crates/server/src/http.rs:193-210 | crates/server/src/http.rs:245-269 — 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/planner/src/rules/access/sets/equality_range/intersection/edge.rs:10— crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:10-27 | crates/planner/src/rules/access/sets/equality_range/intersection/node.rs:10-27 — 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/db/src/search/vector/storage/mod.rs:2519— crates/db/src/search/vector/storage/mod.rs:2519-2536 | crates/db/src/search/vector/storage/mod.rs:2542-2559 — 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/planner/src/analysis/scalar/constraints/property.rs:84— crates/planner/src/analysis/scalar/constraints/property.rs:84-101 | crates/planner/src/analysis/scalar/constraints/property.rs:103-120 — 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/db-testkit/src/model.rs:935— crates/db-testkit/src/model.rs:935-957 | crates/value-semantics/src/lib.rs:135-152 — 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/db/src/index_lifecycle/metadata.rs:131— crates/db/src/index_lifecycle/metadata.rs:131-151 | crates/db/src/index_lifecycle/metadata.rs:158-175 — 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) scripts/validate-cargo-target-references.py:383— scripts/validate-cargo-target-references.py:383-405 | scripts/validate-cargo-target-references.py:409-426 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (12 corresponding lines) · ×10
Edited copy of a member (12 corresponding lines) crates/planner/src/rules/access/order/direction/mod.rs:19— crates/planner/src/rules/access/order/direction/mod.rs:19-30 | crates/planner/src/rules/access/window/rule/rewrite.rs:48-59 — 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/ast/src/batch.rs:186— crates/ast/src/batch.rs:186-197 | crates/ast/src/batch.rs:226-237 — 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/planner/src/planning/mutation/shared.rs:31— crates/planner/src/planning/mutation/shared.rs:31-42 | crates/planner/src/planning/selected/native/access/ids.rs:14-25 — 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/planner/src/rules/access/sets/contradiction/edge.rs:5— crates/planner/src/rules/access/sets/contradiction/edge.rs:5-16 | crates/planner/src/rules/access/sets/contradiction/node.rs:5-16 — 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/db/src/encoding/v2/values/indexes/text.rs:126— crates/db/src/encoding/v2/values/indexes/text.rs:126-137 | crates/db/src/encoding/v2/values/indexes/text.rs:151-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/db/src/execution/interpreter/access/params.rs:18— crates/db/src/execution/interpreter/access/params.rs:18-29 | crates/db/src/execution/interpreter/control/foreach.rs:64-77 — 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/planner/src/planning/selected/native/root_stream/ast/variable.rs:11— crates/planner/src/planning/selected/native/root_stream/ast/variable.rs:11-22 | crates/planner/src/planning/selected/native/scoped/root_stream/variable.rs:11-22 — 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/planner/src/rules/core/implementation/filter.rs:26— crates/planner/src/rules/core/implementation/filter.rs:26-37 | crates/planner/src/rules/core/implementation/order.rs:26-38 — 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/planner/src/cost/profile/formulas.rs:56— crates/planner/src/cost/profile/formulas.rs:56-71 | crates/planner/src/cost/profile/formulas.rs:98-109 — 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) sdks/python/scripts/run_embedded_parity.py:278— sdks/python/scripts/run_embedded_parity.py:278-290 | sdks/python/scripts/run_server_parity.py:388-399 — These two members are one piece of code written twice and then edited apart: 12 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (8 corresponding lines) · ×10
Edited copy of a member (8 corresponding lines) crates/planner/src/ir/access.rs:104— crates/planner/src/ir/access.rs:104-111 | crates/planner/src/ir/access.rs:120-127 — 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/db/src/execution/interpreter/mutation/edge.rs:685— crates/db/src/execution/interpreter/mutation/edge.rs:685-692 | crates/db/src/execution/interpreter/mutation/node.rs:654-665 — 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/planner/src/ir/access/edge/branch.rs:67— crates/planner/src/ir/access/edge/branch.rs:67-74 | crates/planner/src/ir/access/node/branch.rs:67-74 — 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) sdks/python/src/helixdb/graph.py:930— sdks/python/src/helixdb/graph.py:930-938 | sdks/python/src/helixdb/graph.py:942-949 — 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/planner/src/rules/stream/window/contracts.rs:43— crates/planner/src/rules/stream/window/contracts.rs:43-52 | crates/planner/src/rules/core/exploration/pipeline.rs:12-19 — 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/db/src/search/vector/storage/mod.rs:2203— crates/db/src/search/vector/storage/mod.rs:2203-2210 | crates/db/src/search/vector/storage/mod.rs:2428-2436 — 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/planner/src/rules/access/sets/range/edge.rs:30— crates/planner/src/rules/access/sets/range/edge.rs:30-37 | crates/planner/src/rules/access/sets/range/node.rs:30-37 — 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/db/src/execution/interpreter/access/indexes.rs:759— crates/db/src/execution/interpreter/access/indexes.rs:759-766 | crates/db/src/execution/interpreter/access/range.rs:309-316 — 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/db-testkit/src/ids.rs:169— crates/db-testkit/src/ids.rs:169-176 | crates/db-testkit/src/trace.rs:33-40 — 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/db/src/execution/interpreter/rows/bound_match.rs:28— crates/db/src/execution/interpreter/rows/bound_match.rs:28-35 | crates/db/src/execution/interpreter/rows/correlated.rs:35-43 — 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.
R4 · Test Coverage· No test reaches this file · ×10
No test reaches this file sdks/typescript/scripts/parity/generate-fixtures.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file sdks/typescript/scripts/parity/run-helix.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file sdks/typescript/scripts/parity/run-embedded-parity.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file sdks/typescript/scripts/parity/run-embedded-client.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file sdks/typescript/scripts/parity/compare-json.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file bindings/uniffi/scripts/finalize-node-package.mjs:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file sdks/typescript/scripts/parity/cypher-client.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file sdks/typescript/scripts/edge-drop-regression.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file sdks/typescript/scripts/parity/run-python-generator.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file sdks/typescript/scripts/parity/progress.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×9
Edited copy of a member (24 corresponding lines) crates/planner/src/diagnostics/analyze.rs:1137— crates/planner/src/diagnostics/analyze.rs:1137-1162 | crates/planner/src/diagnostics/analyze.rs:1164-1187 — 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/planner/src/exec/lowering/costing.rs:202— crates/planner/src/exec/lowering/costing.rs:202-225 | crates/planner/src/exec/lowering/costing.rs:230-253 — 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/db/src/execution/interpreter/pull/count.rs:427— crates/db/src/execution/interpreter/pull/count.rs:427-450 | crates/db/src/execution/interpreter/pull/count.rs:457-481 — 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/db/src/index_lifecycle_testing/contracts.rs:3286— crates/db/src/index_lifecycle_testing/contracts.rs:3286-3309 | crates/db/src/index_lifecycle_testing/contracts.rs:3318-3341 — 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/planner/src/rules/access/filter/index/label_domain.rs:106— crates/planner/src/rules/access/filter/index/label_domain.rs:106-129 | crates/planner/src/rules/access/filter/index/label_domain.rs:131-154 — 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/cli/src/commands/add.rs:143— crates/cli/src/commands/add.rs:143-166 | crates/cli/src/commands/init.rs:148-171 — 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/db/src/search/vector/storage/mod.rs:1962— crates/db/src/search/vector/storage/mod.rs:1962-1985 | crates/db/src/search/vector/storage/mod.rs:2062-2087 — 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/db/src/index_lifecycle/text/statistics.rs:770— crates/db/src/index_lifecycle/text/statistics.rs:770-793 | crates/db/src/index_lifecycle/text/statistics.rs:1034-1057 — 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/db/src/index_lifecycle/secondary.rs:4142— crates/db/src/index_lifecycle/secondary.rs:4142-4165 | crates/db/src/index_lifecycle/vector/driver.rs:4455-4482 — 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.
VectorIndex::search_layer0_with_simhash (cognitive 241) crates/db/src/search/vector/hnsw/search.rs:267— VectorIndex::search_layer0_with_simhash has cognitive complexity 241 (threshold 15). Drivers by points: if/else 85 (206 pts), loops 8 (19 pts), boolean chains 12, match/switch 2 (4 pts) (nesting depth added 134). 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.
VectorIndex::restricted_filter_aware_search (cognitive 97) crates/db/src/search/vector/hnsw/restricted.rs:1148— VectorIndex::restricted_filter_aware_search has cognitive complexity 97 (threshold 15). Drivers by points: if/else 24 (62 pts), loops 10 (27 pts), boolean chains 8 (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.
VectorIndex::load_uncached_items_for_layer (cognitive 55) crates/db/src/search/vector/hnsw/index.rs:1067— VectorIndex::load_uncached_items_for_layer has cognitive complexity 55 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 8 (18 pts), boolean chains 4, match/switch 2 (4 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.
VectorIndex::search_layer_beam (cognitive 30) crates/db/src/search/vector/hnsw/mutation/mod.rs:1003— VectorIndex::search_layer_beam has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 3, loops 2 (3 pts), match/switch 1 (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.
VectorIndex::relink_neighbor (cognitive 29) crates/db/src/search/vector/hnsw/mutation/mod.rs:2162— VectorIndex::relink_neighbor has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 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.
VectorIndex::insert_with_mutation_cache (cognitive 19) crates/db/src/search/vector/hnsw/mutation/mod.rs:744— VectorIndex::insert_with_mutation_cache has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 2 (3 pts), match/switch 2 (3 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.
VectorIndex::search_layer_greedy (cognitive 18) crates/db/src/search/vector/hnsw/search.rs:169— VectorIndex::search_layer_greedy has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorIndex::add_bidirectional_link (cognitive 17) crates/db/src/search/vector/hnsw/mutation/mod.rs:1639— VectorIndex::add_bidirectional_link has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_opencypher_tck::runner::steps (cognitive 58) tools/opencypher-tck/src/runner.rs:105— helix_opencypher_tck::runner::steps has cognitive complexity 58 (threshold 15). Drivers by points: if/else 13 (40 pts), loops 3 (8 pts), boolean chains 5, match/switch 2 (5 pts) (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_opencypher_tck::gate::draft (cognitive 30) tools/opencypher-tck/src/gate.rs:160— helix_opencypher_tck::gate::draft has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 2 (5 pts), loops 2 (3 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.
helix_opencypher_tck::corpus::expand (cognitive 29) tools/opencypher-tck/src/corpus.rs:96— helix_opencypher_tck::corpus::expand has cognitive complexity 29 (threshold 15). Drivers by points: loops 5 (17 pts), if/else 5 (12 pts) (nesting depth added 19). 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.
helix_opencypher_tck::values::wire (cognitive 25) tools/opencypher-tck/src/values.rs:257— helix_opencypher_tck::values::wire has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 4 (8 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
helix_opencypher_tck::gate::verify (cognitive 21) tools/opencypher-tck/src/gate.rs:42— helix_opencypher_tck::gate::verify has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 4, 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.
helix_opencypher_tck::workers::run_with (cognitive 21) tools/opencypher-tck/src/workers.rs:140— helix_opencypher_tck::workers::run_with has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 5 (7 pts), boolean chains 1, 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.
helix_opencypher_tck::snapshot::take (cognitive 20) tools/opencypher-tck/src/snapshot.rs:15— helix_opencypher_tck::snapshot::take has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (6 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.
helix_opencypher_tck::corpus::table_escapes (cognitive 19) tools/opencypher-tck/src/corpus.rs:172— helix_opencypher_tck::corpus::table_escapes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 1 (5 pts), loops 2 (4 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.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×8
Edited copy of a member (26 corresponding lines) crates/db/src/encoding/v2/values/property/property_value.rs:202— crates/db/src/encoding/v2/values/property/property_value.rs:202-227 | crates/planner/src/analysis/scalar/values.rs:158-193 — 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/planner/src/rules/cardinality.rs:1185— crates/planner/src/rules/cardinality.rs:1185-1210 | crates/planner/src/rules/cardinality.rs:1216-1241 — 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/planner/src/cost/profile/residual.rs:44— crates/planner/src/cost/profile/residual.rs:44-69 | crates/planner/src/diagnostics/analyze.rs:1322-1350 — 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/planner/src/rules/cardinality.rs:1359— crates/planner/src/rules/cardinality.rs:1359-1384 | crates/planner/src/rules/cardinality.rs:1386-1411 — 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) bindings/uniffi/src/graph.rs:905— bindings/uniffi/src/graph.rs:905-930 | bindings/uniffi/src/graph.rs:940-968 — 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/cli/src/update.rs:59— crates/cli/src/update.rs:59-87 | crates/cli/src/update.rs:272-297 — 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/db/src/index_lifecycle_testing.rs:311— crates/db/src/index_lifecycle_testing.rs:311-337 | crates/db/src/index_lifecycle_testing.rs:857-882 — 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/db/src/index_lifecycle/operation.rs:1032— crates/db/src/index_lifecycle/operation.rs:1032-1060 | crates/db/src/index_lifecycle/operation.rs:1464-1489 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×8
Edited copy of a member (22 corresponding lines) crates/db/src/index_lifecycle/secondary.rs:2680— crates/db/src/index_lifecycle/secondary.rs:2680-2701 | crates/db/src/index_lifecycle/secondary.rs:2755-2788 — 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/db/src/index_lifecycle/public.rs:424— crates/db/src/index_lifecycle/public.rs:424-445 | crates/db/src/index_lifecycle/public.rs:450-477 — 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/db/src/execution/interpreter/access/restricted_text.rs:27— crates/db/src/execution/interpreter/access/restricted_text.rs:27-57 | crates/db/src/execution/interpreter/access/restricted_vector.rs:17-38 — 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/db/src/execution/interpreter/access/secondary_set.rs:320— crates/db/src/execution/interpreter/access/secondary_set.rs:320-343 | crates/db/src/execution/interpreter/access/secondary_set.rs:348-369 — 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/db/src/config/runtime_catalog.rs:295— crates/db/src/config/runtime_catalog.rs:295-316 | crates/db/src/config/runtime_catalog.rs:321-348 — 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/db/src/query_resources/properties/builder.rs:20— crates/db/src/query_resources/properties/builder.rs:20-41 | crates/db/src/query_resources/properties/builder.rs:43-64 — 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/planner/src/ir/access/edge/analysis.rs:198— crates/planner/src/ir/access/edge/analysis.rs:198-219 | crates/planner/src/ir/access/node/analysis.rs:207-228 — 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/db/src/execution/interpreter/mutation/topology.rs:303— crates/db/src/execution/interpreter/mutation/topology.rs:303-332 | crates/db/src/execution/interpreter/mutation/topology.rs:358-379 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×8
Edited copy of a member (23 corresponding lines) crates/planner/src/planning/selected/native/source/lowering/stream.rs:169— crates/planner/src/planning/selected/native/source/lowering/stream.rs:169-191 | crates/planner/src/planning/selected/native/source/lowering/stream.rs:196-218 — 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/cli/src/local_runtime.rs:1208— crates/cli/src/local_runtime.rs:1208-1232 | crates/cli/src/local_runtime.rs:1235-1257 — 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/db/src/index_lifecycle/failpoints.rs:165— crates/db/src/index_lifecycle/failpoints.rs:165-188 | crates/db/src/migrations/indexes/equality_bitmap.rs:136-158 — 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/cli/src/local_runtime.rs:971— crates/cli/src/local_runtime.rs:971-993 | crates/cli/src/local_runtime.rs:995-1017 — 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/db/src/index_lifecycle/text/attachment.rs:31— crates/db/src/index_lifecycle/text/attachment.rs:31-54 | crates/db/src/index_lifecycle/text/driver.rs:2392-2414 — 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/db/src/search/mod.rs:1389— crates/db/src/search/mod.rs:1389-1411 | crates/db/src/search/mod.rs:1429-1451 — 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/server/src/grpc.rs:67— crates/server/src/grpc.rs:67-91 | crates/server/src/grpc.rs:99-121 — 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/db/src/lib.rs:2404— crates/db/src/lib.rs:2404-2426 | crates/db/src/lib.rs:2446-2468 — 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.
D4 · Code Duplication· Edited copy of a member (15 corresponding lines) · ×8
Edited copy of a member (15 corresponding lines) crates/planner/src/planning/selected/native/access/edge.rs:11— crates/planner/src/planning/selected/native/access/edge.rs:11-25 | crates/planner/src/planning/selected/native/access/node.rs:11-25 — 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/db/src/execution/interpreter/mutation/topology.rs:414— crates/db/src/execution/interpreter/mutation/topology.rs:414-428 | crates/db/src/execution/interpreter/mutation/topology.rs:437-452 — 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/db/src/merge_operator.rs:153— crates/db/src/merge_operator.rs:153-167 | crates/db/src/merge_operator.rs:174-191 — 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/db/src/encoding/v2/keys/indexes/equality/scans.rs:34— crates/db/src/encoding/v2/keys/indexes/equality/scans.rs:34-50 | crates/db/src/encoding/v2/keys/indexes/equality/scans.rs:185-199 — 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/db/src/execution/interpreter/pull/source.rs:85— crates/db/src/execution/interpreter/pull/source.rs:85-99 | crates/db/src/execution/interpreter/pull/source.rs:101-115 — 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/db/src/merge_operator.rs:198— crates/db/src/merge_operator.rs:198-212 | crates/db/src/merge_operator.rs:387-402 — 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) sdks/python/src/helixdb/dsl.py:2749— sdks/python/src/helixdb/dsl.py:2749-2763 | sdks/python/src/helixdb/dsl.py:2783-2797 — 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/planner/src/exec/plan/top_level.rs:92— crates/planner/src/exec/plan/top_level.rs:92-110 | crates/planner/src/exec/plan/top_level.rs:115-129 — These two members are one piece of code written twice and then edited apart: 15 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (32 corresponding lines) · ×7
Edited copy of a member (32 corresponding lines) crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:29— crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:29-60 | crates/planner/src/rules/access/sets/equality_range/intersection/node.rs:29-60 — 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/db/src/search/mod.rs:993— crates/db/src/search/mod.rs:993-1024 | crates/db/src/search/mod.rs:2373-2405 — 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/db/src/execution/interpreter/control/foreach.rs:140— crates/db/src/execution/interpreter/control/foreach.rs:140-177 | crates/db/src/execution/interpreter/control/foreach.rs:182-213 — 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/planner/src/ir/access/edge/analysis.rs:75— crates/planner/src/ir/access/edge/analysis.rs:75-106 | crates/planner/src/ir/access/node/analysis.rs:84-115 — 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/planner/src/planning/index_ddl/create.rs:17— crates/planner/src/planning/index_ddl/create.rs:17-60 | crates/planner/src/planning/index_ddl/drop.rs:15-46 — 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/planner/src/ir/input/search/text.rs:55— crates/planner/src/ir/input/search/text.rs:55-86 | crates/planner/src/ir/input/search/vector.rs:160-191 — 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/db/src/index_lifecycle_testing/contracts.rs:3006— crates/db/src/index_lifecycle_testing/contracts.rs:3006-3043 | crates/db/src/index_lifecycle_testing/contracts.rs:3380-3411 — These two members are one piece of code written twice and then edited apart: 32 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (17 corresponding lines) · ×7
Edited copy of a member (17 corresponding lines) crates/ast/src/query.rs:196— crates/ast/src/query.rs:196-214 | crates/db/src/cypher.rs:328-344 — 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/db/src/encoding/v2/keys/indexes/range/scans.rs:42— crates/db/src/encoding/v2/keys/indexes/range/scans.rs:42-58 | crates/db/src/encoding/v2/keys/indexes/range/scans.rs:155-171 — 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/graph-algorithms/src/algorithms/centrality.rs:386— crates/graph-algorithms/src/algorithms/centrality.rs:386-404 | crates/graph-algorithms/src/algorithms/centrality.rs:412-428 — 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/planner/src/rules/access/sets/equality_range/range_union/edge.rs:49— crates/planner/src/rules/access/sets/equality_range/range_union/edge.rs:49-65 | crates/planner/src/rules/access/sets/equality_range/range_union/node.rs:49-65 — 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/cli/src/commands/chef.rs:1281— crates/cli/src/commands/chef.rs:1281-1301 | crates/cli/src/commands/chef.rs:1303-1319 — 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/db/src/search/mod.rs:1263— crates/db/src/search/mod.rs:1263-1279 | crates/db/src/search/mod.rs:2254-2270 — 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/planner/src/rules/access/sets/range/edge.rs:42— crates/planner/src/rules/access/sets/range/edge.rs:42-58 | crates/planner/src/rules/access/sets/range/node.rs:42-58 — These two members are one piece of code written twice and then edited apart: 17 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Duplicated block (6 lines × 3) crates/planner/src/planning/envelope/write_contract.rs:60— crates/planner/src/planning/envelope/write_contract.rs:60-65 | crates/planner/src/planning/selected/native/context_usage.rs:60-65 | crates/planner/src/planning/selected/native/context_usage.rs:317-323 — before extracting anything, compare `crates/planner/src/planning/envelope/write_contract.rs` and `crates/planner/src/planning/selected/native/context_usage.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 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/db/src/execution/interpreter/rows/hash_probe.rs:47— crates/db/src/execution/interpreter/rows/hash_probe.rs:47-52 | crates/db/src/execution/interpreter/rows/joins.rs:61-66 | crates/db/src/execution/interpreter/rows/lookup.rs:39-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 all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/rows/hash_probe.rs:47` it does not close everything it opens, so those exact lines 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/db/src/execution/interpreter/mutation/contracts.rs:31— crates/db/src/execution/interpreter/mutation/contracts.rs:31-36 | crates/db/src/index_lifecycle/mutation_catalog.rs:309-314 | crates/db/src/migrations/mod.rs:4111-4116 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `properties` to `&[crate::encoding::v2::values::property::Property]` in one and `&[Property]` 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) crates/planner/src/rules/access/sets/equality_range/intersection/mod.rs:25— crates/planner/src/rules/access/sets/equality_range/intersection/mod.rs:25-30 | crates/planner/src/rules/access/sets/equality_range/range_union/mod.rs:25-30 | crates/planner/src/rules/access/sets/range/mod.rs:24-29 — 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/planner/src/rules/access/sets/equality_range/intersection/mod.rs:25` it begins part-way through the construct above it, so those exact lines 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/planner/src/planning/index_ddl/shared.rs:8— crates/planner/src/planning/index_ddl/shared.rs:8-13 | crates/planner/src/planning/search/access/edge.rs:69-74 | crates/planner/src/planning/search/access/node.rs:69-74 — before extracting anything, compare `crates/planner/src/planning/search/access/edge.rs` and `crates/planner/src/planning/search/access/node.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 32 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/planning/index_ddl/shared.rs:8` it begins part-way through the construct above it, so those exact lines 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/db/src/execution/interpreter/pull/poll.rs:264— crates/db/src/execution/interpreter/pull/poll.rs:264-269 | crates/db/src/execution/interpreter/pull/poll.rs:544-549 | crates/db/src/execution/interpreter/pull/poll.rs:561-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/db/src/execution/interpreter/pull/poll.rs:264` it does not close everything it opens, so those exact lines 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/db-testkit/src/model.rs:851— crates/db-testkit/src/model.rs:851-856 | crates/db/src/encoding/v2/values/property/property_value.rs:211-216 | crates/planner/src/analysis/scalar/values.rs:167-172 — before extracting anything, compare `crates/db/src/encoding/v2/values/property/property_value.rs` and `crates/planner/src/analysis/scalar/values.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 70 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db-testkit/src/model.rs:851` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×6
Members sharing a duplicated core (4 members, 50+ identical tokens) crates/ast/src/nesting.rs:136— crates/ast/src/nesting.rs:136-356 | crates/planner/src/planning/envelope/write_contract.rs:22-142 | crates/planner/src/planning/selected/native/context_usage.rs:21-152 | crates/planner/src/planning/selected/native/context_usage.rs:214-370 — 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/db/src/execution/interpreter/mutation/edge.rs:264— crates/db/src/execution/interpreter/mutation/edge.rs:264-296 | crates/db/src/execution/interpreter/mutation/edge.rs:323-360 | crates/db/src/execution/interpreter/mutation/node.rs:160-237 | crates/db/src/execution/interpreter/mutation/node.rs:275-314 — 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/db/src/index_lifecycle/scope_gate.rs:301— crates/db/src/index_lifecycle/scope_gate.rs:301-313 | crates/db/src/index_lifecycle/scope_gate.rs:315-327 | crates/db/src/index_lifecycle/scope_gate.rs:338-350 | crates/db/src/index_lifecycle/scope_gate.rs:352-364 — 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/db/src/search/mod.rs:1216— crates/db/src/search/mod.rs:1216-1228 | crates/db/src/search/mod.rs:1244-1257 | crates/db/src/search/mod.rs:1289-1299 | crates/db/src/search/mod.rs:1353-1364 — 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/planner/src/rules/access/sets/equality_range/intersection/mod.rs:12— crates/planner/src/rules/access/sets/equality_range/intersection/mod.rs:12-21 | crates/planner/src/rules/access/sets/equality_range/range_union/mod.rs:12-21 | crates/planner/src/rules/access/sets/range/mod.rs:11-20 | crates/planner/src/rules/access/sets/subsumption/mod.rs:16-25 — 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) sdks/python/scripts/run_embedded_parity.py:294— sdks/python/scripts/run_embedded_parity.py:294-314 | sdks/python/scripts/run_embedded_parity.py:325-347 | sdks/python/scripts/run_server_parity.py:403-417 | sdks/python/scripts/run_server_parity.py:421-435 — 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 copies of one member (3 members, 10+ corresponding lines) · ×6
Edited copies of one member (3 members, 10+ corresponding lines) crates/planner/src/exec/count.rs:265— crates/planner/src/exec/count.rs:265-274 | crates/planner/src/exec/count.rs:277-286 | crates/planner/src/exec/count.rs:289-301 — 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/db/src/search/mod.rs:1970— crates/db/src/search/mod.rs:1970-1984 | crates/db/src/search/mod.rs:1994-2005 | crates/db/src/search/text/mod.rs:413-422 — 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/db/src/encoding/v2/keys/indexes/range/scans.rs:107— crates/db/src/encoding/v2/keys/indexes/range/scans.rs:107-116 | crates/db/src/encoding/v2/keys/indexes/range/scans.rs:216-225 | crates/db/src/encoding/v2/keys/indexes/range/scans.rs:370-380 — 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/db/src/index_lifecycle/worker.rs:508— crates/db/src/index_lifecycle/worker.rs:508-518 | crates/db/src/lib.rs:645-654 | crates/db/src/migrations/background/worker.rs:62-71 — 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/planner/src/rules/root/barrier.rs:29— crates/planner/src/rules/root/barrier.rs:29-38 | crates/planner/src/rules/root/barrier.rs:63-72 | crates/planner/src/rules/root/barrier.rs:97-106 — 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/db/src/search/mod.rs:532— crates/db/src/search/mod.rs:532-543 | crates/db/src/search/mod.rs:1481-1490 | crates/db/src/search/mod.rs:1520-1529 — 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.
Duplicated block (16 lines × 2) crates/ast/src/query.rs:878— crates/ast/src/query.rs:878-893 | crates/ast/src/query.rs:1098-1113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/ast/src/query.rs:878` it begins part-way through the construct above it, so those exact lines 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/db/src/encoding/v2/keys/indexes/equality/edge.rs:150— crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:150-165 | crates/db/src/encoding/v2/keys/indexes/range/edge.rs:169-184 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. 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 `slice` to `&[u8]` in one and `&'a [u8]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (16 lines × 2) crates/db/src/index_lifecycle_testing.rs:1216— crates/db/src/index_lifecycle_testing.rs:1216-1231 | crates/db/src/index_lifecycle_testing.rs:1400-1415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle_testing.rs:1216` it begins part-way through the construct above it, so those exact lines 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/planner/src/exec/lowering/costing.rs:367— crates/planner/src/exec/lowering/costing.rs:367-382 | crates/planner/src/exec/lowering/costing.rs:491-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 `crates/planner/src/exec/lowering/costing.rs:367` it begins part-way through the construct above it, so those exact lines 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/planner/src/rules/access/order/direction/edge.rs:11— crates/planner/src/rules/access/order/direction/edge.rs:11-26 | crates/planner/src/rules/access/order/direction/node.rs:11-26 — 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 (16 lines × 2) crates/db/src/index_lifecycle/vector/driver.rs:2389— crates/db/src/index_lifecycle/vector/driver.rs:2389-2404 | crates/db/src/index_lifecycle/vector/driver.rs:2617-2632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/vector/driver.rs:2389` 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) crates/db/src/encoding/v2/keys/indexes/range/edge.rs:207— crates/db/src/encoding/v2/keys/indexes/range/edge.rs:207-217 | crates/db/src/encoding/v2/keys/indexes/range/edge.rs:389-399 | crates/db/src/encoding/v2/keys/indexes/range/node.rs:32-42 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/range/edge.rs` and `crates/db/src/encoding/v2/keys/indexes/range/node.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 81 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/db/src/encoding/v2/keys/indexes/range/edge.rs:207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 3) crates/db/src/encoding/v2/keys/managed_index.rs:738— crates/db/src/encoding/v2/keys/managed_index.rs:738-748 | crates/db/src/encoding/v2/values/codec.rs:145-155 | crates/db/src/encoding/v2/values/indexes/operation_queue/mod.rs:1079-1089 — 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 `self` to `crate) fn take_bytes(&mut` in one and `super) fn take_raw(&mut` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 3) crates/planner/src/analysis/index_atoms/candidate.rs:71— crates/planner/src/analysis/index_atoms/candidate.rs:71-81 | crates/planner/src/analysis/index_atoms/range.rs:64-74 | crates/planner/src/analysis/labels.rs:137-147 — before extracting anything, compare `crates/planner/src/analysis/index_atoms/candidate.rs` and `crates/planner/src/analysis/labels.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/analysis/index_atoms/candidate.rs:71` it does not close everything it opens, so those exact lines 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/cli/src/commands/cloud/database.rs:160— crates/cli/src/commands/cloud/database.rs:160-171 | crates/cli/src/commands/cloud/project.rs:107-117 | crates/cli/src/commands/cloud/service_credential.rs:174-185 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `crates/cli/src/commands/cloud/database.rs:160` it does not close everything it opens, so those 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 lines × 3) crates/db/src/index_lifecycle/text/validation.rs:288— crates/db/src/index_lifecycle/text/validation.rs:288-298 | crates/db/src/index_lifecycle/text/validation.rs:537-547 | crates/db/src/index_lifecycle/text/validation.rs:728-738 — 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/db/src/index_lifecycle/text/validation.rs:288` it begins part-way through the construct above it, so those exact lines 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/db/src/index_lifecycle_testing.rs:1165— crates/db/src/index_lifecycle_testing.rs:1165-1175 | crates/db/src/index_lifecycle_testing.rs:1291-1301 | crates/db/src/index_lifecycle_testing.rs:1331-1341 — 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/db/src/index_lifecycle_testing.rs:1165` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) crates/db/src/encoding/v2/keys/indexes/range/edge.rs:259— crates/db/src/encoding/v2/keys/indexes/range/edge.rs:259-268 | crates/db/src/encoding/v2/keys/indexes/range/edge.rs:426-435 | crates/db/src/encoding/v2/keys/indexes/range/node.rs:220-229 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/range/edge.rs` and `crates/db/src/encoding/v2/keys/indexes/range/node.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 81 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/db/src/encoding/v2/keys/indexes/range/edge.rs:259` 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 × 3) crates/db/src/encoding/v2/values/property/canonical_number.rs:16— crates/db/src/encoding/v2/values/property/canonical_number.rs:16-25 | crates/db/src/encoding/v2/values/property/property_value.rs:262-271 | crates/planner/src/analysis/scalar/values.rs:220-229 — before extracting anything, compare `crates/db/src/encoding/v2/values/property/canonical_number.rs` and `crates/db/src/encoding/v2/values/property/property_value.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/values/property/canonical_number.rs:16` 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 × 3) crates/db/src/execution/interpreter/stream/aggregate.rs:63— crates/db/src/execution/interpreter/stream/aggregate.rs:63-72 | crates/db/src/execution/interpreter/stream/aggregate.rs:107-116 | crates/db/src/execution/interpreter/stream/aggregate.rs:155-164 — 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/db/src/execution/interpreter/stream/aggregate.rs:63` it does not close everything it opens, so those exact lines 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/planner/src/planning/envelope/write_contract.rs:68— crates/planner/src/planning/envelope/write_contract.rs:68-77 | crates/planner/src/planning/selected/native/context_usage.rs:68-77 | crates/planner/src/planning/selected/native/context_usage.rs:324-333 — before extracting anything, compare `crates/planner/src/planning/envelope/write_contract.rs` and `crates/planner/src/planning/selected/native/context_usage.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/planner/src/planning/envelope/write_contract.rs:103— crates/planner/src/planning/envelope/write_contract.rs:103-112 | crates/planner/src/planning/selected/native/context_usage.rs:104-113 | crates/planner/src/planning/selected/native/context_usage.rs:352-361 — before extracting anything, compare `crates/planner/src/planning/envelope/write_contract.rs` and `crates/planner/src/planning/selected/native/context_usage.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) crates/db/src/search/vector/spaces/simple.rs:243— crates/db/src/search/vector/spaces/simple.rs:243-252 | crates/db/src/search/vector/spaces/simple.rs:259-268 | crates/db/src/search/vector/spaces/simple.rs:275-284 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/search/vector/spaces/simple.rs:243` it does not close everything it opens, so those exact lines 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/ast/src/nesting.rs:219— crates/ast/src/nesting.rs:219-227 | crates/planner/src/planning/envelope/write_contract.rs:50-58 | crates/planner/src/planning/selected/native/context_usage.rs:50-58 — before extracting anything, compare `crates/planner/src/planning/envelope/write_contract.rs` and `crates/planner/src/planning/selected/native/context_usage.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) crates/ast/src/nesting.rs:250— crates/ast/src/nesting.rs:250-258 | crates/planner/src/planning/envelope/write_contract.rs:101-109 | crates/planner/src/planning/selected/native/context_usage.rs:102-110 — before extracting anything, compare `crates/planner/src/planning/envelope/write_contract.rs` and `crates/planner/src/planning/selected/native/context_usage.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/planner/src/planning/envelope/write_contract.rs:99` calls `Some` and `crates/ast/src/nesting.rs:249` 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/db/src/config/definition_differences.rs:157— crates/db/src/config/definition_differences.rs:157-165 | crates/db/src/config/definition_differences.rs:182-190 | crates/db/src/config/definition_differences.rs:233-241 — 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 `existing` to `&ValidatedSecondaryIndexDefinition` in one and `&ValidatedVectorIndexDefinition` 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 × 3) crates/planner/src/exec/lowering/costing.rs:189— crates/planner/src/exec/lowering/costing.rs:189-197 | crates/planner/src/exec/lowering/costing.rs:374-382 | crates/planner/src/exec/lowering/costing.rs:498-506 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/exec/lowering/costing.rs:189` 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/db/src/index_lifecycle_testing.rs:1186— crates/db/src/index_lifecycle_testing.rs:1186-1194 | crates/db/src/index_lifecycle_testing.rs:1312-1320 | crates/db/src/index_lifecycle_testing.rs:1353-1363 — 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/db/src/index_lifecycle_testing.rs:1186` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 3) crates/cli/src/local_runtime.rs:1072— crates/cli/src/local_runtime.rs:1072-1080 | crates/cli/src/local_runtime.rs:1090-1098 | crates/cli/src/local_runtime.rs:1116-1124 — 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/ast/src/nesting.rs:40— crates/ast/src/nesting.rs:40-47 | crates/db/src/execution/interpreter/stream/filter.rs:321-328 | crates/planner/src/cost/profile/residual.rs:83-90 — 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/ast/src/nesting.rs:40` it does not close everything it opens, so those exact lines 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/db/src/execution/interpreter/access/membership.rs:122— crates/db/src/execution/interpreter/access/membership.rs:122-129 | crates/db/src/index_lifecycle/vector.rs:286-293 | crates/planner/src/analysis/index_atoms/equality.rs:157-164 — 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/db/src/execution/interpreter/access/membership.rs:122` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) crates/db/src/execution/interpreter/pull/branch.rs:148— crates/db/src/execution/interpreter/pull/branch.rs:148-155 | crates/db/src/execution/interpreter/pull/mod.rs:224-231 | crates/planner/src/diagnostics/analyze.rs:923-930 — before extracting anything, compare `crates/db/src/execution/interpreter/pull/branch.rs` and `crates/db/src/execution/interpreter/pull/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.
Duplicated block (8 lines × 3) crates/planner/src/analysis/index_atoms/candidate.rs:70— crates/planner/src/analysis/index_atoms/candidate.rs:70-77 | crates/planner/src/analysis/labels.rs:103-110 | crates/planner/src/analysis/labels.rs:136-143 — before extracting anything, compare `crates/planner/src/analysis/index_atoms/candidate.rs` and `crates/planner/src/analysis/labels.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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) crates/db/src/migrations/startup/bootstrap.rs:123— crates/db/src/migrations/startup/bootstrap.rs:123-130 | crates/db/src/migrations/startup/bootstrap.rs:186-193 | crates/db/src/migrations/startup/bootstrap.rs:262-269 — 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/db/src/index_lifecycle_testing/contracts.rs:3473— crates/db/src/index_lifecycle_testing/contracts.rs:3473-3480 | crates/db/src/index_lifecycle_testing/contracts.rs:3498-3512 | crates/db/src/index_lifecycle_testing/contracts.rs:3960-3968 — 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/db/src/index_lifecycle_testing/contracts.rs:3473` it begins part-way through the construct above it, so those 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: DbConfig (LCOM4 15) crates/db/src/config/db.rs:184— DbConfig's methods fall into 15 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 15 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: Highlight (LCOM4 7) crates/cli/src/output/json.rs:45— Highlight'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: VectorIndexDefinition (LCOM4 6) crates/db/src/config/indexes.rs:230— VectorIndexDefinition'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: IndexOperationQueueTuning (LCOM4 5) crates/db/src/config/index_operation_queue.rs:184— IndexOperationQueueTuning's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: SearchParams (LCOM4 5) crates/db/src/search/vector/mod.rs:363— SearchParams's methods fall into 5 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 5 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: StorageCostProfile (LCOM4 4) crates/planner/src/cost/profile.rs:32— StorageCostProfile'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.
Duplicated block (6 lines × 2 locations) sdks/typescript/scripts/parity/generate-fixtures.ts:669— sdks/typescript/scripts/parity/generate-fixtures.ts:669 · sdks/typescript/scripts/parity/generate-fixtures.ts:691 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (6 lines × 2 locations) sdks/typescript/scripts/parity/run-embedded-parity.ts:310— sdks/typescript/scripts/parity/run-embedded-parity.ts:310 · sdks/typescript/scripts/parity/run-helix.ts:386 — 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 (6 lines × 2 locations) sdks/typescript/src/dsl.ts:2192— sdks/typescript/src/dsl.ts:2192 · sdks/typescript/src/dsl.ts:2199 — 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 (6 lines × 2 locations) sdks/typescript/src/dsl.ts:2240— sdks/typescript/src/dsl.ts:2240 · sdks/typescript/src/dsl.ts:2246 — 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 (6 lines × 2 locations) sdks/typescript/src/dsl.ts:2369— sdks/typescript/src/dsl.ts:2369 · sdks/typescript/src/dsl.ts:2375 — 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 (6 lines × 2 locations) sdks/typescript/src/index.ts:585— sdks/typescript/src/index.ts:585 · sdks/typescript/src/index.ts:687 — 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.
Parser::expr_inner (cognitive 111) crates/cypher/src/parser.rs:562— Parser::expr_inner has cognitive complexity 111 (threshold 15). Drivers by points: if/else 49 (92 pts), loops 4 (9 pts), boolean chains 8, match/switch 1 (2 pts) (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.
Parser::pattern (cognitive 54) crates/cypher/src/parser.rs:394— Parser::pattern has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20 (42 pts), boolean chains 7, loops 2 (5 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.
Parser::value (cognitive 54) tools/opencypher-tck/src/values.rs:158— Parser::value has cognitive complexity 54 (threshold 15). Drivers by points: if/else 20 (37 pts), loops 4 (10 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::statement (cognitive 48) crates/cypher/src/parser.rs:141— Parser::statement has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (36 pts), loops 3 (7 pts), match/switch 1 (4 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.
Parser::project (cognitive 27) crates/cypher/src/parser.rs:273— Parser::project has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (22 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.
helix_cli::commands::chef::launch_claude_streaming (cognitive 37) crates/cli/src/commands/chef.rs:1942— helix_cli::commands::chef::launch_claude_streaming has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (22 pts), match/switch 4 (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.
helix_cli::commands::cloud::service_credential::run (cognitive 20) crates/cli/src/commands/cloud/service_credential.rs:10— helix_cli::commands::cloud::service_credential::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (4 pts), boolean chains 2, loops 1 (2 pts) (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.
helix_cli::commands::status::run (cognitive 19) crates/cli/src/commands/status.rs:49— helix_cli::commands::status::run has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 2 (5 pts), loops 3 (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.
helix_cli::commands::cloud::database::run (cognitive 17) crates/cli/src/commands/cloud/database.rs:10— helix_cli::commands::cloud::database::run has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 3 (6 pts), loops 1 (2 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
helix_cli::commands::doctor::render (cognitive 17) crates/cli/src/commands/doctor.rs:563— helix_cli::commands::doctor::render has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 3 (5 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.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×5
Edited copy of a member (27 corresponding lines) crates/db/src/execution/interpreter/storage.rs:332— crates/db/src/execution/interpreter/storage.rs:332-358 | crates/db/src/execution/interpreter/storage.rs:364-390 — 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/db/src/execution/interpreter/pull/count.rs:33— crates/db/src/execution/interpreter/pull/count.rs:33-59 | crates/db/src/execution/interpreter/pull/count.rs:65-91 — 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/db/src/encoding/v2/values/indexes/equality/mod.rs:287— crates/db/src/encoding/v2/values/indexes/equality/mod.rs:287-313 | crates/db/src/encoding/v2/values/indexes/range.rs:62-88 — 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/db/src/encoding/v2/keys/indexes/secondary.rs:32— crates/db/src/encoding/v2/keys/indexes/secondary.rs:32-59 | crates/db/src/encoding/v2/keys/managed_index.rs:342-368 — 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/planner/src/rules/access/window/edge.rs:48— crates/planner/src/rules/access/window/edge.rs:48-74 | crates/planner/src/rules/access/window/node.rs:48-74 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (25 corresponding lines) · ×5
Edited copy of a member (25 corresponding lines) crates/db/src/search/vector/cache/registry.rs:1057— crates/db/src/search/vector/cache/registry.rs:1057-1083 | crates/db/src/search/vector/cache/registry.rs:1094-1118 — 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/db/src/index_lifecycle/text/driver.rs:640— crates/db/src/index_lifecycle/text/driver.rs:640-664 | crates/db/src/index_lifecycle/vector/driver.rs:1067-1091 — 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/db/src/search/mod.rs:726— crates/db/src/search/mod.rs:726-751 | crates/db/src/search/mod.rs:2321-2345 — 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/db/src/index_lifecycle/work.rs:420— crates/db/src/index_lifecycle/work.rs:420-444 | crates/db/src/index_lifecycle/work.rs:457-485 — 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/db/src/error.rs:867— crates/db/src/error.rs:867-896 | crates/db/src/search/vector/mod.rs:981-1005 — 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 (14 corresponding lines) · ×5
Edited copy of a member (14 corresponding lines) crates/planner/src/rules/physical_contracts/access/pipeline.rs:17— crates/planner/src/rules/physical_contracts/access/pipeline.rs:17-30 | crates/planner/src/rules/physical_contracts/access/pipeline.rs:99-114 — 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/db/src/migrations/indexes/equality_bitmap.rs:753— crates/db/src/migrations/indexes/equality_bitmap.rs:753-766 | crates/db/src/migrations/tenant/envelope.rs:198-211 — 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/planner/src/ir/access/edge/analysis.rs:40— crates/planner/src/ir/access/edge/analysis.rs:40-53 | crates/planner/src/ir/access/node/analysis.rs:49-62 — 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/db/src/search/mod.rs:95— crates/db/src/search/mod.rs:95-108 | crates/db/src/search/mod.rs:137-150 — 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/db/src/search/mod.rs:645— crates/db/src/search/mod.rs:645-658 | crates/db/src/search/mod.rs:697-710 — 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.
D4 · Code Duplication· Edited copy of a member (6 corresponding lines) · ×5
Edited copy of a member (6 corresponding lines) sdks/python/src/helixdb/graph.py:399— sdks/python/src/helixdb/graph.py:399-404 | sdks/python/src/helixdb/graph.py:419-426 — 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/planner/src/rules/core/exploration/pipeline.rs:87— crates/planner/src/rules/core/exploration/pipeline.rs:87-92 | crates/planner/src/rules/stream/window/rule.rs:27-32 — These two members are one piece of code written twice and then edited apart: 6 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (6 corresponding lines) crates/ast/src/traversal.rs:1918— crates/ast/src/traversal.rs:1918-1923 | crates/ast/src/value.rs:61-68 — 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/planner/src/ir/access/edge/source.rs:148— crates/planner/src/ir/access/edge/source.rs:148-153 | crates/planner/src/ir/access/node/source.rs:150-155 — 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/db/src/encoding/v2/values/indexes/equality/mod.rs:458— crates/db/src/encoding/v2/values/indexes/equality/mod.rs:458-463 | crates/db/src/merge_operator.rs:138-144 — 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.
Duplicated block (24 lines × 2) crates/db/src/encoding/v2/keys/indexes/range/edge.rs:204— crates/db/src/encoding/v2/keys/indexes/range/edge.rs:204-227 | crates/db/src/encoding/v2/keys/indexes/range/node.rs:29-52 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/range/edge.rs` and `crates/db/src/encoding/v2/keys/indexes/range/node.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 81 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (24 lines × 2) crates/db/src/migrations/vector_retirement.rs:496— crates/db/src/migrations/vector_retirement.rs:496-519 | crates/db/src/migrations/vector_retirement.rs:898-921 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/migrations/vector_retirement.rs:496` it begins part-way through the construct above it, so those exact lines 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/planner/src/diagnostics/analyze.rs:1275— crates/planner/src/diagnostics/analyze.rs:1275-1298 | crates/planner/src/ir/expr/validation.rs:35-58 — 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/planner/src/diagnostics/analyze.rs:1275` it does not close everything it opens, so those exact lines 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/planner/src/exec/count.rs:1261— crates/planner/src/exec/count.rs:1261-1284 | crates/planner/src/exec/count.rs:1325-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.
Duplicated block (24 lines × 2) crates/planner/src/rules/access/sets/contradiction/edge.rs:29— crates/planner/src/rules/access/sets/contradiction/edge.rs:29-52 | crates/planner/src/rules/access/sets/contradiction/node.rs:29-52 — before extracting anything, compare `crates/planner/src/rules/access/sets/contradiction/edge.rs` and `crates/planner/src/rules/access/sets/contradiction/node.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 68 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 `left` to `&ir::EdgeAccessPlan` in one and `&ir::NodeAccessPlan` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (20 lines × 2) crates/db/src/encoding/v2/keys/indexes/label.rs:46— crates/db/src/encoding/v2/keys/indexes/label.rs:46-65 | crates/db/src/encoding/v2/keys/indexes/label.rs:153-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 `crates/db/src/encoding/v2/keys/indexes/label.rs:46` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) crates/db/src/execution/interpreter/access/indexes.rs:852— crates/db/src/execution/interpreter/access/indexes.rs:852-871 | crates/db/src/execution/interpreter/access/range.rs:346-365 — 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 (20 lines × 2) crates/db/src/execution/interpreter/count.rs:2306— crates/db/src/execution/interpreter/count.rs:2306-2325 | crates/planner/src/rules/cardinality.rs:2172-2191 — before extracting anything, compare `crates/db/src/execution/interpreter/count.rs` and `crates/planner/src/rules/cardinality.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/count.rs:2306` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) crates/db/src/migrations/mod.rs:3473— crates/db/src/migrations/mod.rs:3473-3492 | crates/db/src/migrations/mod.rs:3583-3602 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/migrations/mod.rs:3473` 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 lines × 2) crates/db/src/search/vector/spaces/simple_avx.rs:266— crates/db/src/search/vector/spaces/simple_avx.rs:266-285 | crates/db/src/search/vector/spaces/simple_avx.rs:304-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 `crates/db/src/search/vector/spaces/simple_avx.rs:266` 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/ast/src/nesting.rs:42— crates/ast/src/nesting.rs:42-60 | crates/planner/src/cost/profile/residual.rs:85-103 — 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/ast/src/nesting.rs:42` it does not close everything it opens, so those exact lines 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/db/src/encoding/v2/keys/indexes/property.rs:210— crates/db/src/encoding/v2/keys/indexes/property.rs:210-228 | crates/db/src/encoding/v2/keys/indexes/property.rs:275-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/encoding/v2/keys/indexes/property.rs:210` 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) crates/db/src/encoding/v2/keys/indexes/vector/items.rs:107— crates/db/src/encoding/v2/keys/indexes/vector/items.rs:107-125 | crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs:105-123 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/vector/items.rs` and `crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 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/db/src/encoding/v2/keys/indexes/vector/items.rs:107` 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/db/src/execution/interpreter/mutation/edge.rs:333— crates/db/src/execution/interpreter/mutation/edge.rs:333-351 | crates/db/src/execution/interpreter/mutation/node.rs:287-305 — before extracting anything, compare `crates/db/src/execution/interpreter/mutation/edge.rs` and `crates/db/src/execution/interpreter/mutation/node.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/mutation/edge.rs:333` 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) crates/db/src/search/vector/spaces/simple_avx.rs:55— crates/db/src/search/vector/spaces/simple_avx.rs:55-73 | crates/db/src/search/vector/spaces/simple_avx.rs:168-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/search/vector/spaces/simple_avx.rs:55` 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) crates/ast/src/testing/variants.rs:725— crates/ast/src/testing/variants.rs:725-743 | crates/planner/src/planning/envelope/root_kind.rs:79-96 — before extracting anything, compare `crates/ast/src/testing/variants.rs` and `crates/planner/src/planning/envelope/root_kind.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/planner/src/planning/envelope/root_kind.rs:78` calls `Some` and `crates/ast/src/testing/variants.rs:724` 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 (18–19 lines × 2) crates/db/src/encoding/v2/keys/indexes/vector/items.rs:81— crates/db/src/encoding/v2/keys/indexes/vector/items.rs:81-99 | crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs:81-98 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/vector/items.rs` and `crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18–19 lines × 2) crates/db/src/index_lifecycle/secondary/exact.rs:526— crates/db/src/index_lifecycle/secondary/exact.rs:526-544 | crates/db/src/index_lifecycle/secondary/exact/ordered.rs:193-210 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (18–19 lines × 2) crates/db/src/merge_operator.rs:333— crates/db/src/merge_operator.rs:333-350 | crates/db/src/merge_operator.rs:362-380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/merge_operator.rs:333` 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) crates/db/src/search/vector/hnsw/search.rs:479— crates/db/src/search/vector/hnsw/search.rs:479-497 | crates/db/src/search/vector/hnsw/search.rs:1039-1056 — both copies are in the same file, so extract the block into 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/db-testkit/src/model.rs:972— crates/db-testkit/src/model.rs:972-988 | crates/db-testkit/src/model.rs:995-1011 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db-testkit/src/model.rs:972` 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/db/src/index_lifecycle/text/active_batch.rs:919— crates/db/src/index_lifecycle/text/active_batch.rs:919-935 | crates/db/src/index_lifecycle/text/active_batch.rs:944-960 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/text/active_batch.rs:919` it does not close everything it opens, so those exact lines 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/db/src/index_lifecycle/text/serving.rs:216— crates/db/src/index_lifecycle/text/serving.rs:216-232 | crates/db/src/index_lifecycle/text/serving.rs:302-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 `crates/db/src/index_lifecycle/text/serving.rs:216` it begins part-way through the construct above it, so those exact lines 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/db/src/index_lifecycle/worker.rs:751— crates/db/src/index_lifecycle/worker.rs:751-767 | crates/db/src/index_lifecycle/worker.rs:820-836 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/worker.rs:751` it begins part-way through the construct above it, so those exact lines 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/value-semantics/src/lib.rs:93— crates/value-semantics/src/lib.rs:93-109 | crates/value-semantics/src/lib.rs:117-133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/value-semantics/src/lib.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 (12 lines × 3) crates/db/src/encoding/v2/keys/indexes/vector/metadata.rs:40— crates/db/src/encoding/v2/keys/indexes/vector/metadata.rs:40-52 | crates/db/src/encoding/v2/keys/indexes/vector/storage_prefixes.rs:133-145 | crates/db/src/encoding/v2/legacy/vector/transaction_guard.rs:40-51 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/vector/metadata.rs` and `crates/db/src/encoding/v2/legacy/vector/transaction_guard.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/keys/indexes/vector/metadata.rs:40` it begins part-way through the construct above it, so those 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/db/src/index_lifecycle/queue/publication.rs:1020— crates/db/src/index_lifecycle/queue/publication.rs:1020-1031 | crates/db/src/index_lifecycle/queue/publication.rs:1288-1299 | crates/db/src/index_lifecycle/queue/publication.rs:1831-1842 — 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/db/src/index_lifecycle/queue/publication.rs:1020` it does not close everything it opens, so those exact lines 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/db/src/index_lifecycle/text/validation.rs:438— crates/db/src/index_lifecycle/text/validation.rs:438-449 | crates/db/src/index_lifecycle/text/validation.rs:643-654 | crates/db/src/index_lifecycle/text/validation.rs:887-898 — 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/db/src/index_lifecycle/text/validation.rs:438` it does not close everything it opens, so those 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, `crates/db/src/index_lifecycle/text/validation.rs:435` calls `push` and `crates/db/src/index_lifecycle/text/validation.rs:641` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 3) crates/db/src/search/vector/hnsw/restricted.rs:815— crates/db/src/search/vector/hnsw/restricted.rs:815-826 | crates/db/src/search/vector/hnsw/search.rs:1083-1094 | crates/db/src/search/vector/hnsw/search.rs:1168-1179 — 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 (12 lines × 3) crates/planner/src/planning/envelope/write_contract.rs:89— crates/planner/src/planning/envelope/write_contract.rs:89-100 | crates/planner/src/planning/selected/native/context_usage.rs:90-101 | crates/planner/src/planning/selected/native/context_usage.rs:340-351 — before extracting anything, compare `crates/planner/src/planning/envelope/write_contract.rs` and `crates/planner/src/planning/selected/native/context_usage.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 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) crates/db/src/execution/interpreter/access/search/input.rs:116— crates/db/src/execution/interpreter/access/search/input.rs:116-124 | crates/db/src/execution/interpreter/reserved/sack.rs:106-115 — 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–10 lines × 2) crates/db/src/index_lifecycle/secondary.rs:5084— crates/db/src/index_lifecycle/secondary.rs:5084-5092 | crates/db/src/index_lifecycle/vector/driver.rs:4142-4151 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary.rs` and `crates/db/src/index_lifecycle/vector/driver.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/secondary.rs:5084` 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–10 lines × 2) crates/db/src/index_lifecycle/secondary.rs:5107— crates/db/src/index_lifecycle/secondary.rs:5107-5115 | crates/db/src/index_lifecycle/vector/driver.rs:4168-4177 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary.rs` and `crates/db/src/index_lifecycle/vector/driver.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 91 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/secondary.rs:5107` 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–10 lines × 2) crates/db/src/lib.rs:2261— crates/db/src/lib.rs:2261-2270 | crates/db/src/lib.rs:2312-2320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/lib.rs:2261` it begins part-way through the construct above it, so those 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–10 lines × 2) crates/db/src/search/vector/spaces/simple_sse.rs:29— crates/db/src/search/vector/spaces/simple_sse.rs:29-37 | crates/db/src/search/vector/spaces/simple_sse.rs:81-90 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/spaces/simple_sse.rs:29` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Off the main sequence: helix-graph-algorithms — helix-graph-algorithms: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: helix-metrics — helix-metrics: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: helix-value-semantics — helix-value-semantics: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
Off the main sequence: helix-ast — helix-ast: abstractness 0.14, instability 0.10, distance 0.76 — zone of pain — concrete and depended on by 9 project(s), so it's rigid to change.
Off the main sequence: helix-planner — helix-planner: abstractness 0.03, instability 0.25, distance 0.72 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
VectorIndex::search_layer0_with_simhash (cyclomatic 100) crates/db/src/search/vector/hnsw/search.rs:267— VectorIndex::search_layer0_with_simhash has cyclomatic complexity 100 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VectorIndex::restricted_filter_aware_search (cyclomatic 41) crates/db/src/search/vector/hnsw/restricted.rs:1148— VectorIndex::restricted_filter_aware_search 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.
VectorIndex::load_uncached_items_for_layer (cyclomatic 26) crates/db/src/search/vector/hnsw/index.rs:1067— VectorIndex::load_uncached_items_for_layer 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.
VectorIndex::relink_neighbor (cyclomatic 17) crates/db/src/search/vector/hnsw/mutation/mod.rs:2162— VectorIndex::relink_neighbor 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.
Parser::expr_inner (cyclomatic 56) crates/cypher/src/parser.rs:562— Parser::expr_inner has cyclomatic complexity 56 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Parser::value (cyclomatic 29) tools/opencypher-tck/src/values.rs:158— Parser::value 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.
Parser::pattern (cyclomatic 28) crates/cypher/src/parser.rs:394— Parser::pattern 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.
Parser::statement (cyclomatic 25) crates/cypher/src/parser.rs:141— Parser::statement 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.
Translator::expr_at_depth (cyclomatic 46) crates/cypher/src/sql/expr.rs:68— Translator::expr_at_depth has cyclomatic complexity 46 (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.
Translator::select (cyclomatic 45) crates/cypher/src/sql/select.rs:209— Translator::select 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.
Translator::function (cyclomatic 39) crates/cypher/src/sql/expr.rs:646— Translator::function has cyclomatic complexity 39 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Translator::role (cyclomatic 20) crates/cypher/src/sql/dml.rs:412— Translator::role has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
helix_opencypher_tck::runner::steps (cyclomatic 34) tools/opencypher-tck/src/runner.rs:105— helix_opencypher_tck::runner::steps 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.
helix_opencypher_tck::values::wire (cyclomatic 24) tools/opencypher-tck/src/values.rs:257— helix_opencypher_tck::values::wire 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.
helix_opencypher_tck::run (cyclomatic 20) tools/opencypher-tck/src/main.rs:20— helix_opencypher_tck::run 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.
helix_opencypher_tck::gate::verify (cyclomatic 20) tools/opencypher-tck/src/gate.rs:42— helix_opencypher_tck::gate::verify 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.
helix_cypher::bind::bind_clauses (cognitive 185) crates/cypher/src/bind.rs:82— helix_cypher::bind::bind_clauses has cognitive complexity 185 (threshold 15). Drivers by points: if/else 37 (120 pts), match/switch 8 (30 pts), loops 6 (19 pts), boolean chains 16 (nesting depth added 118). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_cypher::lexer::lex (cognitive 134) crates/cypher/src/lexer.rs:35— helix_cypher::lexer::lex has cognitive complexity 134 (threshold 15). Drivers by points: if/else 37 (94 pts), match/switch 4 (14 pts), boolean chains 13, loops 5 (13 pts) (nesting depth added 75). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_cypher::bind::aggregation::split_projection_with (cognitive 40) crates/cypher/src/bind/aggregation.rs:20— helix_cypher::bind::aggregation::split_projection_with has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (27 pts), match/switch 3 (9 pts), boolean chains 2, loops 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_cypher::parser::number_value (cognitive 18) crates/cypher/src/parser.rs:889— helix_cypher::parser::number_value has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
Translator::select (cognitive 52) crates/cypher/src/sql/select.rs:209— Translator::select has cognitive complexity 52 (threshold 15). Drivers by points: if/else 19 (26 pts), boolean chains 17, match/switch 4 (5 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.
Translator::expr_at_depth (cognitive 26) crates/cypher/src/sql/expr.rs:68— Translator::expr_at_depth has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 8 (16 pts), if/else 4 (7 pts), boolean chains 3 (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Translator::function (cognitive 21) crates/cypher/src/sql/expr.rs:646— Translator::function has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 4 (7 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Translator::join (cognitive 20) crates/cypher/src/sql/tables.rs:708— Translator::join has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 3 (5 pts), loops 1 (2 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.
Graph::spring_layout (cognitive 29) crates/graph-algorithms/src/algorithms/layout.rs:53— Graph::spring_layout has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 7 (12 pts), boolean chains 1, 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.
Graph::with_attributes (cognitive 26) crates/graph-algorithms/src/model.rs:438— Graph::with_attributes has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 5 (6 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Graph::enumerate_cycles_from (cognitive 25) crates/graph-algorithms/src/algorithms/cycles.rs:93— Graph::enumerate_cycles_from has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (4 pts), boolean chains 2, 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.
Graph::compose (cognitive 16) crates/graph-algorithms/src/transform.rs:169— Graph::compose has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 2 (4 pts), loops 2, 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.
D4 · Code Duplication· Edited copy of a member (28 corresponding lines) · ×4
Edited copy of a member (28 corresponding lines) sdks/rust/src/lib.rs:433— sdks/rust/src/lib.rs:433-461 | sdks/rust/src/lib.rs:466-493 — 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/planner/src/exec/lowering/contracts/access/cardinality.rs:43— crates/planner/src/exec/lowering/contracts/access/cardinality.rs:43-70 | crates/planner/src/ir/access/edge/analysis.rs:7-38 — 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/planner/src/ir/access/edge/analysis.rs:108— crates/planner/src/ir/access/edge/analysis.rs:108-135 | crates/planner/src/ir/access/node/analysis.rs:117-144 — 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/planner/src/rules/access/sets/range/edge.rs:63— crates/planner/src/rules/access/sets/range/edge.rs:63-90 | crates/planner/src/rules/access/sets/range/node.rs:63-90 — These two members are one piece of code written twice and then edited apart: 28 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (21 corresponding lines) · ×4
Edited copy of a member (21 corresponding lines) crates/planner/src/rules/access/sets/subsumption/edge.rs:5— crates/planner/src/rules/access/sets/subsumption/edge.rs:5-25 | crates/planner/src/rules/access/sets/subsumption/node.rs:5-25 — 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/db/src/encoding/v2/values/indexes/equality/mod.rs:520— crates/db/src/encoding/v2/values/indexes/equality/mod.rs:520-541 | crates/db/src/query_resources/bitmap.rs:211-231 — 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/ast/src/query.rs:873— crates/ast/src/query.rs:873-893 | crates/ast/src/query.rs:1093-1113 — 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/cli/src/prompts.rs:224— crates/cli/src/prompts.rs:224-249 | crates/cli/src/prompts.rs:251-271 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 17+ corresponding lines) · ×4
Edited copies of one member (4 members, 17+ corresponding lines) crates/db/src/migrations/indexes/equality_bitmap.rs:725— crates/db/src/migrations/indexes/equality_bitmap.rs:725-741 | crates/db/src/migrations/tenant/envelope.rs:71-89 | crates/db/src/migrations/tenant/envelope.rs:125-141 | crates/db/src/migrations/tenant/envelope.rs:161-177 — 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) crates/planner/src/rules/access/filter/rules.rs:106— crates/planner/src/rules/access/filter/rules.rs:106-127 | crates/planner/src/rules/access/pipeline/implementation.rs:27-46 | crates/planner/src/rules/access/window/rule/implementation.rs:30-46 | crates/planner/src/rules/root/pipeline.rs:28-46 — 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) sdks/python/src/helixdb/async_client.py:161— sdks/python/src/helixdb/async_client.py:161-177 | sdks/python/src/helixdb/async_client.py:186-202 | REDACTED:57-73 | REDACTED:79-95 — 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) crates/planner/src/rules/stream/implementation/terminals.rs:31— crates/planner/src/rules/stream/implementation/terminals.rs:31-47 | crates/planner/src/rules/stream/implementation/terminals.rs:71-87 | crates/planner/src/rules/stream/implementation/terminals.rs:111-127 | crates/planner/src/rules/stream/implementation/terminals.rs:152-168 — 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.
Duplicated block (25 lines × 2) crates/ast/src/testing/variants.rs:678— crates/ast/src/testing/variants.rs:678-702 | crates/planner/src/planning/envelope/root_kind.rs:27-51 — before extracting anything, compare `crates/ast/src/testing/variants.rs` and `crates/planner/src/planning/envelope/root_kind.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/planner/src/planning/envelope/root_kind.rs:53` calls `Some` and `crates/ast/src/testing/variants.rs:703` 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 (25 lines × 2) crates/db/src/execution/interpreter/access/indexes.rs:319— crates/db/src/execution/interpreter/access/indexes.rs:319-343 | crates/db/src/execution/interpreter/access/indexes.rs:396-420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/access/indexes.rs:319` it begins part-way through the construct above it, so those 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 (25 lines × 2) crates/db/src/search/text/mod.rs:1216— crates/db/src/search/text/mod.rs:1216-1240 | crates/db/src/search/text/mod.rs:1246-1270 — both copies are in the same file, so extract the 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 (25 lines × 2) crates/db/src/search/vector/hnsw/mutation/mod.rs:2217— crates/db/src/search/vector/hnsw/mutation/mod.rs:2217-2241 | crates/db/src/search/vector/hnsw/mutation/mod.rs:2271-2295 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/hnsw/mutation/mod.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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/db/src/search/vector/hnsw/mutation/mod.rs:2242` calls `as_deref`, `unwrap_or`, `as_slice` and `crates/db/src/search/vector/hnsw/mutation/mod.rs:2296` 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 (23 lines × 2) crates/db/src/encoding/v2/keys/indexes/vector/reverse_edges.rs:33— crates/db/src/encoding/v2/keys/indexes/vector/reverse_edges.rs:33-55 | crates/db/src/encoding/v2/keys/indexes/vector/reverse_edges.rs:119-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/keys/indexes/vector/reverse_edges.rs:33` it begins part-way through the construct above it, so those exact lines 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/db/src/index_lifecycle_testing.rs:1162— crates/db/src/index_lifecycle_testing.rs:1162-1184 | crates/db/src/index_lifecycle_testing.rs:1288-1310 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle_testing.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 (23 lines × 2) crates/db/src/index_lifecycle_testing/contracts/all_index_validation.rs:293— crates/db/src/index_lifecycle_testing/contracts/all_index_validation.rs:293-315 | crates/db/src/index_lifecycle_testing/contracts/all_index_validation.rs:319-341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle_testing/contracts/all_index_validation.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 (23 lines × 2) crates/db/src/search/vector/hnsw/restricted.rs:1085— crates/db/src/search/vector/hnsw/restricted.rs:1085-1107 | crates/db/src/search/vector/hnsw/restricted.rs:1111-1133 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) crates/db/src/index_lifecycle/vector/driver.rs:1935— crates/db/src/index_lifecycle/vector/driver.rs:1935-1956 | crates/db/src/index_lifecycle/vector/driver.rs:3714-3735 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/vector/driver.rs:1935` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/db/src/index_lifecycle/vector/driver.rs:3736` calls `Some`, `try_new`, `map_err` and `crates/db/src/index_lifecycle/vector/driver.rs:1957` 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 (22 lines × 2) crates/db/src/search/vector/spaces/simple_avx.rs:109— crates/db/src/search/vector/spaces/simple_avx.rs:109-130 | crates/db/src/search/vector/spaces/simple_avx.rs:223-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/spaces/simple_avx.rs:109` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) crates/planner/src/rules/cardinality.rs:513— crates/planner/src/rules/cardinality.rs:513-534 | crates/planner/src/rules/cardinality.rs:629-650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/rules/cardinality.rs:513` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) sdks/python/scripts/run_embedded_parity.py:52— sdks/python/scripts/run_embedded_parity.py:52-73 | sdks/python/scripts/run_embedded_parity.py:165-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. Read the line range as the matched WINDOW rather than a finished unit: at `sdks/python/scripts/run_embedded_parity.py:52` it does not close everything it opens, so those 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 (21 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:4891— crates/db/src/index_lifecycle_testing/contracts.rs:4891-4911 | crates/db/src/index_lifecycle_testing/contracts/all_index_validation.rs:1112-1132 — 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/db/src/index_lifecycle_testing/contracts.rs:4891` 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/db/src/search/mod.rs:2687— crates/db/src/search/mod.rs:2687-2707 | crates/db/src/search/mod.rs:2709-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (21 lines × 2) crates/planner/src/planning/envelope/write_contract.rs:53— crates/planner/src/planning/envelope/write_contract.rs:53-73 | crates/planner/src/planning/selected/native/context_usage.rs:53-73 — before extracting anything, compare `crates/planner/src/planning/envelope/write_contract.rs` and `crates/planner/src/planning/selected/native/context_usage.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) crates/planner/src/rules/cardinality.rs:862— crates/planner/src/rules/cardinality.rs:862-882 | crates/planner/src/rules/cardinality.rs:955-975 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/planner/src/rules/cardinality.rs:862` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) crates/db/src/index_lifecycle/outbox.rs:1248— crates/db/src/index_lifecycle/outbox.rs:1248-1257 | crates/db/src/index_lifecycle/outbox.rs:1272-1282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/outbox.rs:1272` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. 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/db/src/index_lifecycle/text/manifest.rs:57— crates/db/src/index_lifecycle/text/manifest.rs:57-67 | crates/db/src/index_lifecycle/text/validation.rs:181-190 — 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/db/src/index_lifecycle/text/manifest.rs:57` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 2) crates/db/src/migrations/vector_properties.rs:168— crates/db/src/migrations/vector_properties.rs:168-178 | crates/db/src/migrations/vector_retirement.rs:431-440 — before extracting anything, compare `crates/db/src/migrations/vector_properties.rs` and `crates/db/src/migrations/vector_retirement.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/migrations/vector_properties.rs:168` it does not close everything it opens, so those 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–11 lines × 2) crates/db/src/search/vector/hnsw/restricted.rs:1353— crates/db/src/search/vector/hnsw/restricted.rs:1353-1363 | crates/db/src/search/vector/hnsw/restricted.rs:1392-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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/search/vector/hnsw/restricted.rs:1353` it begins part-way through the construct above it, so those exact lines 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 locations) bindings/uniffi/smoke-node.mjs:154— bindings/uniffi/smoke-node.mjs:154 · bindings/uniffi/smoke-node.mjs:174 — 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 (9 lines × 2 locations) sdks/typescript/scripts/parity/run-embedded-parity.ts:317— sdks/typescript/scripts/parity/run-embedded-parity.ts:317 · sdks/typescript/scripts/parity/run-helix.ts:391 — 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 (9 lines × 2 locations) sdks/typescript/src/dsl.ts:521— sdks/typescript/src/dsl.ts:521 · sdks/typescript/src/dsl.ts:551 — 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 (9 lines × 2 locations) sdks/typescript/src/dsl.ts:1086— sdks/typescript/src/dsl.ts:1086 · sdks/typescript/src/dsl.ts:1098 — 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.
helix_cypher::bind::bind_clauses (cyclomatic 74) crates/cypher/src/bind.rs:82— helix_cypher::bind::bind_clauses 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.
helix_cypher::lexer::lex (cyclomatic 58) crates/cypher/src/lexer.rs:35— helix_cypher::lexer::lex has cyclomatic complexity 58 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
helix_cypher::bind::aggregation::split_projection_with (cyclomatic 17) crates/cypher/src/bind/aggregation.rs:20— helix_cypher::bind::aggregation::split_projection_with 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.
VectorRows::validate_simhash_directory (cyclomatic 49) crates/db/src/search/vector/storage/mod.rs:1256— VectorRows::validate_simhash_directory has cyclomatic complexity 49 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VectorRows::validate_legacy_physical (cyclomatic 34) crates/db/src/search/vector/storage/mod.rs:1004— VectorRows::validate_legacy_physical 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.
VectorRows::backfill_missing_simhash_directory (cyclomatic 22) crates/db/src/search/vector/storage/mod.rs:1600— VectorRows::backfill_missing_simhash_directory 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.
helix_cli::main (cyclomatic 37) crates/cli/src/main.rs:578— helix_cli::main has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
helix_cli::commands::cloud::database::run (cyclomatic 18) crates/cli/src/commands/cloud/database.rs:10— helix_cli::commands::cloud::database::run 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.
helix_cli::commands::doctor::render (cyclomatic 16) crates/cli/src/commands/doctor.rs:563— helix_cli::commands::doctor::render 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.
VectorRows::validate_simhash_directory (cognitive 110) crates/db/src/search/vector/storage/mod.rs:1256— VectorRows::validate_simhash_directory has cognitive complexity 110 (threshold 15). Drivers by points: if/else 37 (91 pts), match/switch 8 (17 pts), boolean chains 1, loops 1 (nesting depth added 63). 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.
VectorRows::validate_legacy_physical (cognitive 67) crates/db/src/search/vector/storage/mod.rs:1004— VectorRows::validate_legacy_physical has cognitive complexity 67 (threshold 15). Drivers by points: if/else 19 (45 pts), match/switch 9 (18 pts), boolean chains 3, loops 1 (nesting depth added 35). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorRows::backfill_missing_simhash_directory (cognitive 37) crates/db/src/search/vector/storage/mod.rs:1600— VectorRows::backfill_missing_simhash_directory has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (28 pts), match/switch 4 (6 pts), boolean chains 2, 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.
TooManyFields: SeedRuleSet crates/planner/src/rules/registry.rs:15— TooManyFields — 52 stored fields beside 3 methods. The bar is 30 stored fields; this is 22 over it, 1.73× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: LegacyVectorIndexConfig crates/db/src/encoding/v2/legacy/vector/metadata.rs:14— TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× 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: SearchStats crates/db/src/search/vector/mod.rs:581— TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× 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 copies of one member (3 members, 17+ corresponding lines) · ×3
Edited copies of one member (3 members, 17+ corresponding lines) crates/db/src/merge_operator.rs:934— crates/db/src/merge_operator.rs:934-950 | crates/db/src/merge_operator.rs:957-978 | crates/db/src/merge_operator.rs:985-1016 — 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/db/src/execution/interpreter/access/search/input.rs:111— crates/db/src/execution/interpreter/access/search/input.rs:111-129 | crates/db/src/execution/interpreter/reserved/sack.rs:102-118 | crates/db/src/execution/interpreter/stream/aggregate.rs:195-211 — 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/cli/src/local_runtime.rs:1068— crates/cli/src/local_runtime.rs:1068-1084 | crates/cli/src/local_runtime.rs:1086-1102 | crates/cli/src/local_runtime.rs:1112-1128 — 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, 9+ corresponding lines) · ×3
Edited copies of one member (4 members, 9+ corresponding lines) crates/db/src/config/cache.rs:1167— crates/db/src/config/cache.rs:1167-1175 | crates/db/src/config/cache.rs:1178-1186 | crates/db/src/config/cache.rs:1189-1197 | crates/db/src/config/cache.rs:1200-1210 — 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/db/src/encoding/v2/values/property/property_value.rs:346— crates/db/src/encoding/v2/values/property/property_value.rs:346-354 | crates/db/src/encoding/v2/values/property/property_value.rs:356-364 | crates/db/src/encoding/v2/values/property/property_value.rs:366-374 | crates/db/src/encoding/v2/values/property/property_value.rs:381-391 — 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/planner/src/ir/bounds/search.rs:123— crates/planner/src/ir/bounds/search.rs:123-131 | crates/planner/src/ir/bounds/stream/bound.rs:127-135 | crates/planner/src/ir/input/property.rs:59-67 | crates/planner/src/ir/input/search/expr.rs:72-80 — 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.
Duplicated block (29 lines × 2) crates/db/src/index_lifecycle/repository.rs:200— crates/db/src/index_lifecycle/repository.rs:200-228 | crates/db/src/migrations/startup/bootstrap.rs:347-375 — before extracting anything, compare `crates/db/src/index_lifecycle/repository.rs` and `crates/db/src/migrations/startup/bootstrap.rs` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/repository.rs:200` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 (29 lines × 2) crates/planner/src/exec/lowering/costing.rs:334— crates/planner/src/exec/lowering/costing.rs:334-362 | crates/planner/src/exec/lowering/costing.rs:458-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/exec/lowering/costing.rs:334` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) crates/planner/src/planning/envelope/write_contract.rs:78— crates/planner/src/planning/envelope/write_contract.rs:78-106 | crates/planner/src/planning/selected/native/context_usage.rs:79-107 — before extracting anything, compare `crates/planner/src/planning/envelope/write_contract.rs` and `crates/planner/src/planning/selected/native/context_usage.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16–17 lines × 2) crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs:29— crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs:29-44 | crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs:93-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/encoding/v2/keys/indexes/vector/simhash.rs:29` it begins part-way through the construct above it, so those exact lines 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/db/src/execution/interpreter/mutation/edge.rs:394— crates/db/src/execution/interpreter/mutation/edge.rs:394-409 | crates/db/src/execution/interpreter/mutation/node.rs:340-356 — before extracting anything, compare `crates/db/src/execution/interpreter/mutation/edge.rs` and `crates/db/src/execution/interpreter/mutation/node.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/mutation/edge.rs:394` 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–17 lines × 2) crates/db/src/execution/interpreter/mutation/rows.rs:298— crates/db/src/execution/interpreter/mutation/rows.rs:298-313 | crates/db/src/execution/interpreter/mutation/rows.rs:344-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/mutation/rows.rs:298` it does not close everything it opens, so those exact lines 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) crates/db/src/execution/interpreter/count.rs:321— crates/db/src/execution/interpreter/count.rs:321-331 | crates/db/src/execution/interpreter/count.rs:1064-1075 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/count.rs:1064` it begins part-way through the construct above it, so those 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) crates/db/src/execution/interpreter/count.rs:345— crates/db/src/execution/interpreter/count.rs:345-355 | crates/db/src/execution/interpreter/count.rs:1093-1104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/execution/interpreter/count.rs:1093` it begins part-way through the construct above it, so those 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) crates/db/src/search/mod.rs:1001— crates/db/src/search/mod.rs:1001-1011 | crates/db/src/search/mod.rs:2378-2389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/mod.rs:1001` it does not close everything it opens, so those 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–9 lines × 2) crates/ast-arena-derive/src/expand.rs:229— crates/ast-arena-derive/src/expand.rs:229-236 | crates/ast-arena-derive/src/expand.rs:421-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ast-arena-derive/src/expand.rs:421` it begins part-way through the construct above it, so those exact lines 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/db/src/encoding/v2/keys/indexes/prefix.rs:94— crates/db/src/encoding/v2/keys/indexes/prefix.rs:94-102 | crates/db/src/encoding/v2/keys/indexes/prefix.rs:106-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/encoding/v2/keys/indexes/prefix.rs:94` it does not close everything it opens, so those exact lines 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/db/src/search/text/mod.rs:1284— crates/db/src/search/text/mod.rs:1284-1292 | crates/planner/src/analysis/labels.rs:322-329 — 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–8 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:2586— crates/db/src/index_lifecycle_testing/contracts.rs:2586-2593 | crates/db/src/index_lifecycle_testing/contracts.rs:2730-2736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) crates/planner/src/exec/access/edge.rs:297— crates/planner/src/exec/access/edge.rs:297-304 | crates/planner/src/exec/access/node.rs:454-460 — 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/planner/src/exec/access/edge.rs:297` 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 (7–8 lines × 2) sdks/python/scripts/run_embedded_parity.py:267— sdks/python/scripts/run_embedded_parity.py:267-274 | sdks/python/scripts/run_server_parity.py:362-368 — 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 `sdks/python/scripts/run_embedded_parity.py:267` it begins part-way through the construct above it, so those exact lines 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 × 4) crates/ast/src/nesting.rs:252— crates/ast/src/nesting.rs:252-258 | crates/planner/src/planning/envelope/write_contract.rs:103-109 | crates/planner/src/planning/selected/native/context_usage.rs:104-110 | crates/planner/src/planning/selected/native/context_usage.rs:352-358 — before extracting anything, compare `crates/planner/src/planning/envelope/write_contract.rs` and `crates/planner/src/planning/selected/native/context_usage.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/planner/src/planning/selected/native/context_usage.rs:350` calls `Some` and `crates/ast/src/nesting.rs:251` 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) crates/db/src/execution/interpreter/mod.rs:394— crates/db/src/execution/interpreter/mod.rs:394-400 | crates/db/src/execution/interpreter/pull/branch.rs:143-149 | crates/db/src/execution/interpreter/pull/mod.rs:219-225 | crates/db/src/execution/interpreter/scheduler.rs:436-442 — before extracting anything, compare `crates/db/src/execution/interpreter/pull/branch.rs` and `crates/db/src/execution/interpreter/pull/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.
Duplicated block (7 lines × 4) crates/db/src/encoding/v2/keys/graph.rs:119— crates/db/src/encoding/v2/keys/graph.rs:119-125 | crates/db/src/encoding/v2/keys/graph.rs:190-198 | crates/db/src/encoding/v2/keys/graph.rs:270-276 | crates/db/src/encoding/v2/legacy/edge_property_pair.rs:42-49 — before extracting anything, compare `crates/db/src/encoding/v2/keys/graph.rs` and `crates/db/src/encoding/v2/legacy/edge_property_pair.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/keys/graph.rs:190` it does not close everything it opens, so those 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 × 3) crates/db/src/index_lifecycle/secondary.rs:5158— crates/db/src/index_lifecycle/secondary.rs:5158-5164 | crates/db/src/index_lifecycle/text/driver.rs:2914-2920 | crates/db/src/index_lifecycle/vector/driver.rs:4215-4221 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary.rs` and `crates/db/src/index_lifecycle/text/driver.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/secondary.rs:5158` it begins part-way through the construct above it, so those exact lines 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/db/src/index_lifecycle/secondary.rs:5183— crates/db/src/index_lifecycle/secondary.rs:5183-5189 | crates/db/src/index_lifecycle/text/driver.rs:2942-2948 | crates/db/src/index_lifecycle/vector/driver.rs:4239-4245 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary.rs` and `crates/db/src/index_lifecycle/text/driver.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) crates/db/src/index_lifecycle/text/driver.rs:929— crates/db/src/index_lifecycle/text/driver.rs:929-935 | crates/db/src/index_lifecycle/text/driver.rs:1196-1202 | crates/db/src/index_lifecycle/text/driver.rs:1583-1589 — 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.
Outbound HTTP without resilience crates/cli/src/commands/cypher.rs:59— `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/cli/src/commands/query.rs:136— `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 REDACTED:408— `urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Binder::expression (cyclomatic 68) crates/cypher/src/bind.rs:930— Binder::expression has cyclomatic complexity 68 (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.
Binder::pattern (cyclomatic 26) crates/cypher/src/bind.rs:760— Binder::pattern 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.
Evaluation::function (cyclomatic 65) crates/planner/src/relational/evaluation.rs:486— Evaluation::function has cyclomatic complexity 65 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Evaluation::eval (cyclomatic 51) crates/planner/src/relational/evaluation.rs:84— Evaluation::eval has cyclomatic complexity 51 (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.
RuleSchedule::compile_applicability (cyclomatic 31) crates/planner/src/optimizer/driver/schedule/compile.rs:13— RuleSchedule::compile_applicability has cyclomatic complexity 31 (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.
RuleSchedule::rules_for_expr (cyclomatic 30) crates/planner/src/optimizer/driver/schedule/routing.rs:14— RuleSchedule::rules_for_expr 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.
IndexOperationProgress::cursors_are_valid (cyclomatic 21) crates/db/src/index_lifecycle/operation.rs:587— IndexOperationProgress::cursors_are_valid 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.
IndexOperationProgress::try_map_cursors (cyclomatic 20) crates/db/src/index_lifecycle/operation.rs:667— IndexOperationProgress::try_map_cursors has cyclomatic complexity 20 (threshold 15). Of this number, 19 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Graph::with_attributes (cyclomatic 18) crates/graph-algorithms/src/model.rs:438— Graph::with_attributes 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.
Graph::spring_layout (cyclomatic 16) crates/graph-algorithms/src/algorithms/layout.rs:53— Graph::spring_layout 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.
ExecutableDagBuilder::push_selected_stream_pipeline_op (cyclomatic 17) crates/planner/src/exec/selected/lowering/access/pipeline.rs:4— ExecutableDagBuilder::push_selected_stream_pipeline_op 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.
ExecutableDagBuilder::push_selected_range_pipeline (cyclomatic 16) crates/planner/src/exec/selected/lowering/access/stream/pipeline.rs:121— ExecutableDagBuilder::push_selected_range_pipeline 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.
Evaluation::function (cognitive 72) crates/planner/src/relational/evaluation.rs:486— Evaluation::function has cognitive complexity 72 (threshold 15). Drivers by points: if/else 19 (35 pts), match/switch 18 (35 pts), loops 1 (2 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.
Evaluation::eval (cognitive 48) crates/planner/src/relational/evaluation.rs:84— Evaluation::eval has cognitive complexity 48 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 8 (17 pts), loops 4 (8 pts) (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.
RuleSchedule::rules_for_expr (cognitive 58) crates/planner/src/optimizer/driver/schedule/routing.rs:14— RuleSchedule::rules_for_expr has cognitive complexity 58 (threshold 15). Drivers by points: if/else 38 (57 pts), match/switch 1 (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.
RuleSchedule::compile_applicability (cognitive 21) crates/planner/src/optimizer/driver/schedule/compile.rs:13— RuleSchedule::compile_applicability has cognitive complexity 21 (threshold 15). Drivers by points: loops 7 (19 pts), match/switch 1 (2 pts) (nesting depth added 13). 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.
Binder::expression (cognitive 49) crates/cypher/src/bind.rs:930— Binder::expression has cognitive complexity 49 (threshold 15). Drivers by points: if/else 15 (33 pts), match/switch 5 (10 pts), boolean chains 6 (nesting depth added 23). 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.
Binder::pattern (cognitive 44) crates/cypher/src/bind.rs:760— Binder::pattern has cognitive complexity 44 (threshold 15). Drivers by points: if/else 12 (29 pts), boolean chains 10, loops 3 (5 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HelixDB::run_configured_vector_memory_warm (cognitive 26) crates/db/src/lib.rs:3418— HelixDB::run_configured_vector_memory_warm has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 5 (8 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HelixDB::run_configured_startup_cache_warm (cognitive 20) crates/db/src/lib.rs:3637— HelixDB::run_configured_startup_cache_warm has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (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.
helix_ast::query::check_json_depth (cognitive 23) crates/ast/src/query.rs:410— helix_ast::query::check_json_depth has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_ast::query::validate_json_value (cognitive 17) crates/ast/src/query.rs:1295— helix_ast::query::validate_json_value has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 3 (6 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexOperationProgress::cursors_are_valid (cognitive 18) crates/db/src/index_lifecycle/operation.rs:587— IndexOperationProgress::cursors_are_valid has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 8 (16 pts), boolean chains 2 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
IndexOperationProgress::try_map_cursors (cognitive 17) crates/db/src/index_lifecycle/operation.rs:667— IndexOperationProgress::try_map_cursors has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 8 (16 pts), if/else 1 (nesting depth added 8). Of this number, 16 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RowPipeline::cost (cognitive 18) crates/planner/src/relational/pipeline.rs:182— RowPipeline::cost has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 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.
RowPipeline::new (cognitive 16) crates/planner/src/relational/pipeline.rs:115— RowPipeline::new has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Near-duplicate member pair (44 shared lines) crates/planner/src/rules/cardinality.rs:1465— crates/planner/src/rules/cardinality.rs:1465-1536 | crates/planner/src/rules/cardinality.rs:1542-1613 — These two members are variants of one another: 44 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (44 shared lines) crates/db/src/execution/interpreter/count.rs:2273— crates/db/src/execution/interpreter/count.rs:2273-2325 | crates/planner/src/rules/cardinality.rs:2138-2193 — These two members are variants of one another: 44 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (6 members, 50+ identical tokens) crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:168— crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:168-207 | crates/db/src/encoding/v2/keys/indexes/vector/layer0.rs:17-56 | crates/db/src/encoding/v2/keys/indexes/vector/reverse_edges.rs:20-59 | crates/db/src/encoding/v2/keys/indexes/vector/reverse_edges.rs:106-157 | crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs:162-201 | crates/db/src/encoding/v2/keys/indexes/vector/upper_layers.rs:106-145 — 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/planner/src/exec/lowering/contracts/access/cardinality.rs:91— crates/planner/src/exec/lowering/contracts/access/cardinality.rs:91-108 | crates/planner/src/exec/selected/lowering/contracts/matching/access/source/edge.rs:17-94 | crates/planner/src/rules/access/sets/canonical/edge.rs:8-27 | crates/planner/src/rules/access/sets/canonical/edge.rs:60-77 | crates/planner/src/rules/access/sets/canonical/edge.rs:81-98 | crates/planner/src/rules/physical_contracts/access/source/edge.rs:12-38 — 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 (50 corresponding lines) · ×2
Edited copy of a member (50 corresponding lines) crates/db/src/search/vector/hnsw/mutation/mod.rs:608— crates/db/src/search/vector/hnsw/mutation/mod.rs:608-657 | crates/db/src/search/vector/hnsw/mutation/mod.rs:668-728 — 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.
Edited copy of a member (50 corresponding lines) crates/db/src/search/vector/hnsw/mutation/mod.rs:1156— crates/db/src/search/vector/hnsw/mutation/mod.rs:1156-1211 | crates/db/src/search/vector/hnsw/search.rs:175-224 — 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 (54 corresponding lines) · ×2
Edited copy of a member (54 corresponding lines) crates/db/src/execution/interpreter/count.rs:802— crates/db/src/execution/interpreter/count.rs:802-855 | crates/db/src/execution/interpreter/count.rs:863-916 — 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.
Edited copy of a member (54 corresponding lines) crates/db/src/execution/interpreter/storage.rs:205— crates/db/src/execution/interpreter/storage.rs:205-258 | crates/db/src/execution/interpreter/storage.rs:272-325 — 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 (45 corresponding lines) · ×2
Edited copy of a member (45 corresponding lines) crates/db/src/execution/interpreter/count.rs:635— crates/db/src/execution/interpreter/count.rs:635-688 | crates/db/src/execution/interpreter/count.rs:694-738 — 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) crates/planner/src/planning/selected/native/pipeline/ops/bounds.rs:11— crates/planner/src/planning/selected/native/pipeline/ops/bounds.rs:11-55 | crates/planner/src/planning/selected/native/pipeline/ops/variable.rs:11-60 — 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 (44 corresponding lines) · ×2
Edited copy of a member (44 corresponding lines) crates/planner/src/exec/lowering/secondary_set.rs:10— crates/planner/src/exec/lowering/secondary_set.rs:10-53 | crates/planner/src/exec/lowering/secondary_set.rs:57-100 — 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) crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:64— crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:64-107 | crates/planner/src/rules/access/sets/equality_range/intersection/node.rs:64-107 — 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 (35 corresponding lines) · ×2
Edited copy of a member (35 corresponding lines) sdks/python/src/helixdb/dsl.py:3753— sdks/python/src/helixdb/dsl.py:3753-3789 | sdks/python/src/helixdb/dsl.py:3902-3936 — 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/db/src/execution/interpreter/access/membership.rs:104— crates/db/src/execution/interpreter/access/membership.rs:104-139 | crates/planner/src/analysis/index_atoms/equality.rs:134-168 — 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 (29 corresponding lines) · ×2
Edited copy of a member (29 corresponding lines) crates/planner/src/rules/cardinality.rs:1788— crates/planner/src/rules/cardinality.rs:1788-1816 | crates/planner/src/rules/cardinality.rs:1822-1850 — 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/db/src/encoding/v2/values/lifecycle/entity_state.rs:34— crates/db/src/encoding/v2/values/lifecycle/entity_state.rs:34-66 | crates/db/src/encoding/v2/values/lifecycle/entity_state.rs:94-122 — 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 (51 corresponding lines) · ×2
Edited copy of a member (51 corresponding lines) crates/db/src/index_lifecycle_testing/contracts/all_index_validation.rs:551— crates/db/src/index_lifecycle_testing/contracts/all_index_validation.rs:551-601 | crates/db/src/index_lifecycle_testing/contracts/all_index_validation.rs:609-673 — 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/db/src/execution/interpreter/access/search/generation.rs:239— crates/db/src/execution/interpreter/access/search/generation.rs:239-289 | crates/db/src/execution/interpreter/access/search/storage.rs:271-326 — 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 (31 corresponding lines) · ×2
Edited copy of a member (31 corresponding lines) crates/planner/src/rules/access/order/direction/edge.rs:10— crates/planner/src/rules/access/order/direction/edge.rs:10-40 | crates/planner/src/rules/access/order/direction/node.rs:10-40 — 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/db/src/search/vector/storage/mod.rs:577— crates/db/src/search/vector/storage/mod.rs:577-609 | crates/db/src/search/vector/storage/mod.rs:614-644 — These two members are one piece of code written twice and then edited apart: 31 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 23+ corresponding lines) · ×2
Edited copies of one member (3 members, 23+ corresponding lines) crates/db/src/search/vector/spaces/simple.rs:117— crates/db/src/search/vector/spaces/simple.rs:117-141 | crates/db/src/search/vector/spaces/simple.rs:152-174 | crates/db/src/search/vector/spaces/simple.rs:202-226 — 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) crates/db/src/index_lifecycle/secondary.rs:5195— crates/db/src/index_lifecycle/secondary.rs:5195-5219 | crates/db/src/index_lifecycle/text/driver.rs:2955-2977 | crates/db/src/index_lifecycle/vector/driver.rs:4251-4273 — 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, 15+ corresponding lines) · ×2
Edited copies of one member (3 members, 15+ corresponding lines) crates/db/src/index_lifecycle/secondary.rs:5154— crates/db/src/index_lifecycle/secondary.rs:5154-5168 | crates/db/src/index_lifecycle/text/driver.rs:2910-2924 | crates/db/src/index_lifecycle/vector/driver.rs:4211-4225 — 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/db/src/search/vector/spaces/simple.rs:240— crates/db/src/search/vector/spaces/simple.rs:240-256 | crates/db/src/search/vector/spaces/simple.rs:258-272 | crates/db/src/search/vector/spaces/simple.rs:274-288 — 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, 13+ corresponding lines) · ×2
Edited copies of one member (3 members, 13+ corresponding lines) crates/planner/src/planning/selected/native/ordering.rs:19— crates/planner/src/planning/selected/native/ordering.rs:19-31 | crates/planner/src/planning/selected/native/projection/bindings.rs:11-28 | crates/planner/src/planning/selected/native/projection/items.rs:11-28 — 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/db/src/encoding/v2/values/indexes/text.rs:65— crates/db/src/encoding/v2/values/indexes/text.rs:65-78 | crates/db/src/encoding/v2/values/indexes/text.rs:178-190 | crates/db/src/encoding/v2/values/indexes/text.rs:204-216 — 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 (4 members, 16+ corresponding lines) · ×2
Edited copies of one member (4 members, 16+ corresponding lines) crates/planner/src/exec/access/edge.rs:161— crates/planner/src/exec/access/edge.rs:161-176 | crates/planner/src/exec/access/edge.rs:180-195 | crates/planner/src/exec/access/node.rs:275-297 | crates/planner/src/exec/access/node.rs:301-323 — 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.
Edited copies of one member (4 members, 16+ corresponding lines) crates/db/src/search/mod.rs:487— crates/db/src/search/mod.rs:487-504 | crates/db/src/search/mod.rs:1692-1709 | crates/db/src/search/mod.rs:1728-1745 | crates/db/src/search/mod.rs:1867-1882 — 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 (4 members, 7+ corresponding lines) · ×2
Edited copies of one member (4 members, 7+ corresponding lines) bindings/uniffi/src/helix_db.rs:215— bindings/uniffi/src/helix_db.rs:215-221 | bindings/uniffi/src/helix_db.rs:225-232 | bindings/uniffi/src/helix_db.rs:236-242 | bindings/uniffi/src/helix_db.rs:246-252 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
Edited copies of one member (4 members, 7+ corresponding lines) crates/server/src/grpc.rs:129— crates/server/src/grpc.rs:129-136 | crates/server/src/grpc.rs:141-147 | crates/server/src/grpc.rs:152-159 | crates/server/src/grpc.rs:164-170 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 7 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 8+ corresponding lines) · ×2
Edited copies of one member (4 members, 8+ corresponding lines) crates/db-testkit/src/model.rs:1177— crates/db-testkit/src/model.rs:1177-1184 | crates/db-testkit/src/model.rs:1189-1196 | crates/db/src/encoding/v2/values/property/property_value.rs:328-335 | crates/db/src/encoding/v2/values/property/property_value.rs:337-344 — 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.
Edited copies of one member (4 members, 8+ corresponding lines) crates/db/src/encoding/v2/values/indexes/text.rs:115— crates/db/src/encoding/v2/values/indexes/text.rs:115-124 | crates/db/src/encoding/v2/values/indexes/text.rs:166-174 | crates/db/src/encoding/v2/values/indexes/text.rs:192-200 | crates/db/src/encoding/v2/values/indexes/vector/generation.rs:15-22 — 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 copy of a member (5 corresponding lines) · ×2
Edited copy of a member (5 corresponding lines) crates/db/src/index_lifecycle/text/driver.rs:2932— crates/db/src/index_lifecycle/text/driver.rs:2932-2939 | crates/db/src/index_lifecycle/vector/driver.rs:4233-4237 — 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/db/src/encoding/v2/keys/graph.rs:218— crates/db/src/encoding/v2/keys/graph.rs:218-222 | crates/db/src/encoding/v2/legacy/edge_property_pair.rs:67-71 — 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 (17–18 lines × 2) crates/db/src/index_lifecycle/secondary/exact.rs:274— crates/db/src/index_lifecycle/secondary/exact.rs:274-290 | crates/db/src/index_lifecycle/secondary/exact/unique.rs:43-60 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary/exact.rs` and `crates/db/src/index_lifecycle/secondary/exact/unique.rs` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/secondary/exact.rs:274` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17–18 lines × 2) crates/db/src/index_lifecycle/secondary/exact.rs:295— crates/db/src/index_lifecycle/secondary/exact.rs:295-311 | crates/db/src/index_lifecycle/secondary/exact/unique.rs:65-82 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary/exact.rs` and `crates/db/src/index_lifecycle/secondary/exact/unique.rs` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/secondary/exact.rs:295` it begins part-way through the construct above it, so those 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 (15–16 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:3566— crates/db/src/index_lifecycle_testing/contracts.rs:3566-3581 | crates/db/src/index_lifecycle_testing/contracts.rs:3647-3661 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle_testing/contracts.rs:3566` it begins part-way through the construct above it, so those exact lines 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–16 lines × 2) crates/db/src/migrations/mod.rs:1865— crates/db/src/migrations/mod.rs:1865-1880 | crates/db/src/migrations/mod.rs:2104-2118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/migrations/mod.rs:1865` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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–15 lines × 2) crates/ast/src/testing/variants.rs:703— crates/ast/src/testing/variants.rs:703-717 | crates/planner/src/planning/envelope/root_kind.rs:54-67 — before extracting anything, compare `crates/ast/src/testing/variants.rs` and `crates/planner/src/planning/envelope/root_kind.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 2) crates/planner/src/planning/envelope/write_contract.rs:34— crates/planner/src/planning/envelope/write_contract.rs:34-47 | crates/planner/src/planning/selected/native/context_usage.rs:25-39 — before extracting anything, compare `crates/planner/src/planning/envelope/write_contract.rs` and `crates/planner/src/planning/selected/native/context_usage.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13–14 lines × 2) crates/cli/src/local_runtime.rs:409— crates/cli/src/local_runtime.rs:409-422 | crates/cli/src/local_runtime.rs:444-456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/cli/src/local_runtime.rs:409` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13–14 lines × 2) crates/db/src/search/vector/hnsw/index.rs:1091— crates/db/src/search/vector/hnsw/index.rs:1091-1103 | crates/db/src/search/vector/hnsw/index.rs:1166-1179 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/hnsw/index.rs:1091` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 2) crates/db/src/config/runtime_catalog.rs:15— crates/db/src/config/runtime_catalog.rs:15-26 | crates/db/src/config/runtime_catalog.rs:240-253 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–14 lines × 2) crates/db/src/index_lifecycle_testing.rs:920— crates/db/src/index_lifecycle_testing.rs:920-931 | crates/db/src/index_lifecycle_testing.rs:972-985 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle_testing.rs:920` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13 lines × 4) crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:195— crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:195-207 | crates/db/src/encoding/v2/keys/indexes/vector/layer0.rs:44-56 | crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs:189-201 | crates/db/src/encoding/v2/keys/indexes/vector/upper_layers.rs:133-145 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs` and `crates/db/src/encoding/v2/keys/indexes/vector/layer0.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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:195` 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 × 4) crates/db/src/migrations/vector_retirement.rs:368— crates/db/src/migrations/vector_retirement.rs:368-380 | crates/db/src/migrations/vector_retirement.rs:495-507 | crates/db/src/migrations/vector_retirement.rs:625-637 | crates/db/src/migrations/vector_retirement.rs:897-909 — 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/db/src/migrations/vector_retirement.rs:368` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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 × 4) crates/db/src/index_lifecycle/text/driver.rs:684— crates/db/src/index_lifecycle/text/driver.rs:684-695 | crates/db/src/index_lifecycle/text/driver.rs:710-721 | crates/db/src/index_lifecycle/text/driver.rs:727-739 | crates/db/src/index_lifecycle/text/driver.rs:744-755 — 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. 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 × 4) crates/planner/src/analysis/index_atoms/equality.rs:41— crates/planner/src/analysis/index_atoms/equality.rs:41-52 | crates/planner/src/analysis/labels.rs:97-109 | crates/planner/src/analysis/labels.rs:131-142 | crates/planner/src/analysis/labels.rs:271-282 — 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 `crates/planner/src/analysis/labels.rs:97` it begins part-way through the construct above it, so those exact lines 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 × 4) crates/planner/src/rules/access/sets/canonical/edge.rs:12— crates/planner/src/rules/access/sets/canonical/edge.rs:12-22 | crates/planner/src/rules/access/sets/canonical/edge.rs:63-73 | crates/planner/src/rules/access/sets/canonical/edge.rs:84-94 | crates/planner/src/rules/physical_contracts/access/source/edge.rs:19-29 — 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.
Duplicated block (11 lines × 4) crates/db/src/search/vector/storage/mod.rs:892— crates/db/src/search/vector/storage/mod.rs:892-902 | crates/db/src/search/vector/storage/mod.rs:925-935 | crates/db/src/search/vector/storage/mod.rs:947-957 | crates/db/src/search/vector/storage/mod.rs:976-986 — 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/db/src/search/vector/storage/mod.rs:892` 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 × 4) crates/db/src/migrations/vector_retirement.rs:262— crates/db/src/migrations/vector_retirement.rs:262-271 | crates/db/src/migrations/vector_retirement.rs:548-557 | crates/db/src/migrations/vector_retirement.rs:683-692 | crates/db/src/migrations/vector_retirement.rs:794-803 — 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/db/src/migrations/vector_retirement.rs:262` it does not close everything it opens, so those 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 × 4) crates/db/src/search/vector/storage/mod.rs:1365— crates/db/src/search/vector/storage/mod.rs:1365-1376 | crates/db/src/search/vector/storage/mod.rs:1426-1435 | crates/db/src/search/vector/storage/mod.rs:1500-1509 | crates/db/src/search/vector/storage/mod.rs:1551-1561 — 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/db/src/search/vector/storage/mod.rs:1365` it begins part-way through the construct above it, so those 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 × 5) crates/db-testkit/src/model.rs:1018— crates/db-testkit/src/model.rs:1018-1026 | crates/db/src/encoding/v2/values/property/canonical_number.rs:13-21 | crates/db/src/encoding/v2/values/property/property_value.rs:259-267 | crates/db/src/encoding/v2/values/property/property_value.rs:314-322 | crates/planner/src/analysis/scalar/values.rs:217-225 — before extracting anything, compare `crates/db/src/encoding/v2/values/property/canonical_number.rs` and `crates/db/src/encoding/v2/values/property/property_value.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 5) crates/db/src/encoding/v2/values/property/canonical_number.rs:14— crates/db/src/encoding/v2/values/property/canonical_number.rs:14-22 | crates/db/src/encoding/v2/values/property/property_value.rs:260-268 | crates/db/src/encoding/v2/values/property/property_value.rs:315-323 | crates/db/src/index_lifecycle/vector.rs:307-315 | crates/planner/src/analysis/scalar/values.rs:218-226 — before extracting anything, compare `crates/db/src/encoding/v2/values/property/canonical_number.rs` and `crates/db/src/encoding/v2/values/property/property_value.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) crates/planner/src/rules/access/sets/equality_range/intersection/mod.rs:13— crates/planner/src/rules/access/sets/equality_range/intersection/mod.rs:13-21 | crates/planner/src/rules/access/sets/equality_range/range_union/mod.rs:13-21 | crates/planner/src/rules/access/sets/range/mod.rs:12-20 | crates/planner/src/rules/access/sets/subsumption/mod.rs:17-25 — 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. 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 × 4) crates/db/src/search/vector/spaces/simple_avx.rs:31— crates/db/src/search/vector/spaces/simple_avx.rs:31-39 | crates/db/src/search/vector/spaces/simple_avx.rs:86-94 | crates/db/src/search/vector/spaces/simple_avx.rs:144-152 | crates/db/src/search/vector/spaces/simple_avx.rs:200-208 — 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/db/src/search/vector/spaces/simple_avx.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.
Duplicated block (8 lines × 4) crates/db/src/search/vector/storage/mod.rs:1356— crates/db/src/search/vector/storage/mod.rs:1356-1363 | crates/db/src/search/vector/storage/mod.rs:1417-1424 | crates/db/src/search/vector/storage/mod.rs:1491-1498 | crates/db/src/search/vector/storage/mod.rs:1542-1549 — 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/db/src/search/vector/storage/mod.rs:1356` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 4) crates/db/src/config/indexes.rs:664— crates/db/src/config/indexes.rs:664-671 | crates/db/src/config/indexes.rs:674-681 | crates/db/src/index_lifecycle/model.rs:408-415 | crates/db/src/index_lifecycle/model.rs:418-425 — 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.
Duplicated block (7 lines × 5) crates/db/src/encoding/v2/values/property/canonical_number.rs:16— crates/db/src/encoding/v2/values/property/canonical_number.rs:16-22 | crates/db/src/encoding/v2/values/property/property_value.rs:262-268 | crates/db/src/encoding/v2/values/property/property_value.rs:317-323 | crates/db/src/search/text/mod.rs:1342-1348 | crates/planner/src/analysis/scalar/values.rs:220-226 — before extracting anything, compare `crates/db/src/encoding/v2/values/property/canonical_number.rs` and `crates/db/src/encoding/v2/values/property/property_value.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 5) crates/db-testkit/src/lifecycle.rs:108— crates/db-testkit/src/lifecycle.rs:108-114 | crates/db/src/index_lifecycle/catalog.rs:115-121 | crates/db/src/index_lifecycle/catalog.rs:124-130 | crates/db/src/index_lifecycle/catalog.rs:133-139 | crates/db/src/index_lifecycle/catalog.rs:142-154 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 6) crates/db/src/migrations/vector_properties.rs:167— crates/db/src/migrations/vector_properties.rs:167-172 | crates/db/src/migrations/vector_retirement.rs:261-266 | crates/db/src/migrations/vector_retirement.rs:430-435 | crates/db/src/migrations/vector_retirement.rs:547-552 | crates/db/src/migrations/vector_retirement.rs:682-687 | crates/db/src/migrations/vector_retirement.rs:793-798 — before extracting anything, compare `crates/db/src/migrations/vector_properties.rs` and `crates/db/src/migrations/vector_retirement.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 6) crates/planner/src/rules/access/sets/rules/canonical.rs:26— crates/planner/src/rules/access/sets/rules/canonical.rs:26-31 | crates/planner/src/rules/access/sets/rules/contradiction.rs:26-31 | crates/planner/src/rules/access/sets/rules/equality_range.rs:26-31 | crates/planner/src/rules/access/sets/rules/equality_range.rs:55-60 | crates/planner/src/rules/access/sets/rules/range.rs:27-32 | crates/planner/src/rules/access/sets/rules/subsumption.rs:26-31 — there are 6 copies across 5 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (54 lines × 2) crates/planner/src/exec/lowering/access_leaf/edge.rs:45— crates/planner/src/exec/lowering/access_leaf/edge.rs:45-98 | crates/planner/src/exec/lowering/access_leaf/node.rs:45-98 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `plan` to `&'a ir::EdgeAccessPlan` in one and `&'a ir::NodeAccessPlan` 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 (54 lines × 2) crates/planner/src/ir/access/edge/analysis.rs:143— crates/planner/src/ir/access/edge/analysis.rs:143-196 | crates/planner/src/ir/access/node/analysis.rs:152-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. Note first that the copies are not typed on the same thing: the declarations holding them bind `subset` to `&EdgeAccessPlan` in one and `&NodeAccessPlan` 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.
R10 · Code Duplication· Duplicated block with local edits (42 matched lines × 2 locations) · ×2
Duplicated block with local edits (42 matched lines × 2 locations) sdks/typescript/scripts/parity/compare-json.ts:33— sdks/typescript/scripts/parity/compare-json.ts:33 · sdks/typescript/scripts/parity/run-helix.ts:339 — the two spans are one implementation copied and then locally edited — 414 tokens are still identical, in the same order in both files, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block with local edits (42 matched lines × 2 locations) sdks/typescript/scripts/parity/run-embedded-client.ts:93— sdks/typescript/scripts/parity/run-embedded-client.ts:93 · sdks/typescript/scripts/parity/run-helix.ts:260 — the two spans are one implementation copied and then locally edited — 456 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.
X2 · Cancellation propagation· Async function without AbortSignal · ×2
Async function without AbortSignal: execute sdks/typescript/src/index.ts:561— `execute` 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: execute sdks/typescript/src/index.ts:653— `execute` 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 })`.
Step.ToAST (cyclomatic 64) REDACTED:1461— Step.ToAST has cyclomatic complexity 64 (threshold 15). Of this number, 63 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Step.to_ast (cyclomatic 54) sdks/python/src/helixdb/dsl.py:2340— Step.to_ast has cyclomatic complexity 54 (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.
Query::new (cyclomatic 52) crates/planner/src/relational/query.rs:236— Query::new has cyclomatic complexity 52 (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.
RuleApplicability::matches (cyclomatic 46) crates/planner/src/rules/contracts/applicability/matching.rs:12— RuleApplicability::matches has cyclomatic complexity 46 (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.
helix.PropertyValueOf (cyclomatic 44) REDACTED:231— helix.PropertyValueOf has cyclomatic complexity 44 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function taking that case's concrete type, so the dispatch reads one line per case. These arms are selected by TYPE rather than by value, so there is no key a lookup table could be built on; where you own the matched types, giving them one shared interface method and calling that is the form a table would have taken, and where you do not, keep the cases — they stay explicit and reviewable.
Expr::fmt (cyclomatic 42) crates/cypher/src/print.rs:218— Expr::fmt has cyclomatic complexity 42 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
image_archive.inspect_archive (cyclomatic 40) docker-image/image_archive.py:162— image_archive.inspect_archive 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.
PreparedTextOperationStep::stage (cyclomatic 32) crates/db/src/index_lifecycle/text/driver.rs:425— PreparedTextOperationStep::stage 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.
VectorKey::parse_from_slice (cyclomatic 31) crates/db/src/encoding/v2/keys/indexes/vector/mod.rs:232— VectorKey::parse_from_slice has cyclomatic complexity 31 (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.
StorageCostProfileOverrides::apply_to (cyclomatic 30) crates/planner/src/cost/profile/overrides.rs:66— StorageCostProfileOverrides::apply_to 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.
graph._decode_tagged_identity (cyclomatic 28) sdks/python/src/helixdb/graph.py:1009— graph._decode_tagged_identity 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.
helix.normalizeTypedQueryValue (cyclomatic 27) REDACTED:3059— helix.normalizeTypedQueryValue 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.
PendingSelection::analyze_text (cyclomatic 26) crates/db/src/execution/interpreter/access/search/pending.rs:515— PendingSelection::analyze_text has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
GraphSelection.request (cyclomatic 25) sdks/go/graph.go:49— GraphSelection.request has cyclomatic complexity 25 (threshold 15). Of this number, 20 points are the body's own statements and 5 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.
Source::next (cyclomatic 24) crates/db/src/execution/interpreter/pull/source.rs:510— Source::next 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: Source::open (cyclomatic 33) 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.
Analyzer::analyze_access_leaf (cyclomatic 23) crates/planner/src/diagnostics/analyze.rs:289— Analyzer::analyze_access_leaf 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.
Accumulator::push_with_admission (cyclomatic 23) crates/planner/src/relational/aggregation.rs:110— Accumulator::push_with_admission 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.
InputWindow::for_initial_source (cyclomatic 23) crates/planner/src/relational/input_window.rs:50— InputWindow::for_initial_source 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.
Client.postStatement (cyclomatic 23) sdks/go/cypher.go:59— Client.postStatement 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.
HelixError.remote (cyclomatic 23) sdks/typescript/src/index.ts:135— HelixError.remote 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.
QueuePublisher::publish_vector (cyclomatic 22) crates/db/src/index_lifecycle/queue/publication.rs:1095— QueuePublisher::publish_vector 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.
OracleState::read_indexed (cyclomatic 22) crates/db-testkit/src/model.rs:653— OracleState::read_indexed 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.
GraphPatternOrder::schedule (cyclomatic 22) crates/planner/src/relational/graph_order.rs:246— GraphPatternOrder::schedule 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.
dsl.convertParamValue (cyclomatic 22) sdks/typescript/src/dsl.ts:2917— dsl.convertParamValue has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Step.toAst (cyclomatic 86) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
dsl.normalizeTypedQueryValue (cyclomatic 22) sdks/typescript/src/dsl.ts:2981— dsl.normalizeTypedQueryValue has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: Step.toAst (cyclomatic 86) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
helix_ast::nesting::within (cyclomatic 21) crates/ast/src/nesting.rs:26— helix_ast::nesting::within 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.
Branch::next (cyclomatic 21) crates/db/src/execution/interpreter/pull/branch.rs:30— Branch::next 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.
PropertyValue.from_value (cyclomatic 21) sdks/python/src/helixdb/dsl.py:403— PropertyValue.from_value 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.
helix.UnmarshalIndexOperationStatus (cyclomatic 21) REDACTED:1268— helix.UnmarshalIndexOperationStatus 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.
Literal::fmt (cyclomatic 20) crates/cypher/src/print.rs:590— Literal::fmt has cyclomatic complexity 20 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ExternalId::from_tagged_value (cyclomatic 20) crates/graph-algorithms/src/identity.rs:91— ExternalId::from_tagged_value 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.
helix.UnmarshalIndexDdlReceipt (cyclomatic 20) REDACTED:1163— helix.UnmarshalIndexDdlReceipt has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Client.Exec (cyclomatic 20) sdks/go/client.go:345— Client.Exec 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.
PropertyValue.from (cyclomatic 20) sdks/typescript/src/dsl.ts:417— PropertyValue.from 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. This is NOT this file's highest cyclomatic complexity: Step.toAst (cyclomatic 86) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
OperatorContract::derive (cyclomatic 19) crates/planner/src/relational/contracts.rs:81— OperatorContract::derive 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.
run_embedded_parity.main (cyclomatic 19) sdks/python/scripts/run_embedded_parity.py:51— run_embedded_parity.main has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Predicate.to_json (cyclomatic 19) sdks/python/src/helixdb/dsl.py:959— Predicate.to_json 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.
Repeat::next (cyclomatic 18) crates/db/src/execution/interpreter/pull/repeat.rs:50— Repeat::next 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.
Totality::predicate (cyclomatic 18) crates/planner/src/relational/planning.rs:1357— Totality::predicate 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.
dsl._convert_param_value (cyclomatic 18) sdks/python/src/helixdb/dsl.py:3752— dsl._convert_param_value 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.
image_archive.scan_archive_for_secrets (cyclomatic 18) docker-image/image_archive.py:323— image_archive.scan_archive_for_secrets 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.
helix_ast_arena_derive::mirror::mirror_type (cyclomatic 17) crates/ast-arena-derive/src/mirror.rs:31— helix_ast_arena_derive::mirror::mirror_type 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.
IndexPrefix::from_slice (cyclomatic 17) crates/db/src/encoding/v2/keys/indexes/prefix.rs:69— IndexPrefix::from_slice 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.
Probe::members (cyclomatic 17) crates/db/src/execution/interpreter/rows/lookup.rs:161— Probe::members 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.
Edit::apply (cyclomatic 17) crates/db/src/index_lifecycle/graph_mutation/map.rs:94— Edit::apply has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VectorMemoryStore::load_from_read_inner (cyclomatic 17) crates/db/src/search/vector/cache/store.rs:867— VectorMemoryStore::load_from_read_inner 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.
ExecPullCapability::of (cyclomatic 17) crates/planner/src/exec/pull/mod.rs:23— ExecPullCapability::of 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.
ExecProgram::derive (cyclomatic 17) crates/planner/src/exec/pull/mod.rs:164— ExecProgram::derive 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.
ScalarExpression::try_visit_pruned (cyclomatic 17) crates/planner/src/relational/expression.rs:486— ScalarExpression::try_visit_pruned has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RowPlan::explain (cyclomatic 17) crates/planner/src/relational/explain.rs:61— RowPlan::explain 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.
dsl._normalize_typed_query_value (cyclomatic 17) sdks/python/src/helixdb/dsl.py:3899— dsl._normalize_typed_query_value 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.
HelixConfig::validate (cyclomatic 16) crates/cli/src/config.rs:557— HelixConfig::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.
LookupCursor::next_batch (cyclomatic 16) crates/db/src/execution/interpreter/rows/lookup_cursor.rs:42— LookupCursor::next_batch 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.
OrderedRangeCursor::next (cyclomatic 16) crates/db/src/index_lifecycle/secondary/exact/ordered.rs:427— OrderedRangeCursor::next 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.
HelixDB::run_configured_vector_memory_warm (cyclomatic 16) crates/db/src/lib.rs:3418— HelixDB::run_configured_vector_memory_warm 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.
run_embedded_parity.async_main (cyclomatic 16) sdks/python/scripts/run_embedded_parity.py:162— run_embedded_parity.async_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.
dsl.parse_index_operation_status (cyclomatic 16) sdks/python/src/helixdb/dsl.py:1701— dsl.parse_index_operation_status 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.
GraphSelection.__post_init__ (cyclomatic 16) sdks/python/src/helixdb/graph.py:138— GraphSelection.__post_init__ 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.
BatchCondition.UnmarshalJSON (cyclomatic 16) REDACTED:2136— BatchCondition.UnmarshalJSON 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: Predicate.ast (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
dsl.stringifyEncoded (cyclomatic 16) sdks/typescript/src/dsl.ts:160— dsl.stringifyEncoded 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. This is NOT this file's highest cyclomatic complexity: Step.toAst (cyclomatic 86) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
dsl.parseIndexOperationStatus (cyclomatic 16) sdks/typescript/src/dsl.ts:1317— dsl.parseIndexOperationStatus 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. This is NOT this file's highest cyclomatic complexity: Step.toAst (cyclomatic 86) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
Query::new (cognitive 104) crates/planner/src/relational/query.rs:236— Query::new has cognitive complexity 104 (threshold 15). Drivers by points: if/else 15 (47 pts), loops 11 (34 pts), boolean chains 15, match/switch 3 (8 pts) (nesting depth added 60). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Step.to_ast (cognitive 56) sdks/python/src/helixdb/dsl.py:2340— Step.to_ast has cognitive complexity 56 (threshold 15). Drivers by points: if/else 50, ternaries 3 (6 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.
PreparedTextOperationStep::stage (cognitive 54) crates/db/src/index_lifecycle/text/driver.rs:425— PreparedTextOperationStep::stage has cognitive complexity 54 (threshold 15). Drivers by points: if/else 16 (37 pts), loops 6 (12 pts), match/switch 3 (4 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.
image_archive.inspect_archive (cognitive 52) docker-image/image_archive.py:162— image_archive.inspect_archive has cognitive complexity 52 (threshold 15). Drivers by points: if/else 26 (37 pts), boolean chains 7, loops 5 (6 pts), error handling 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.
Source::next (cognitive 49) crates/db/src/execution/interpreter/pull/source.rs:510— Source::next has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (32 pts), match/switch 5 (15 pts), boolean chains 1, loops 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BoundMatch::next_batch (cognitive 43) crates/db/src/execution/interpreter/rows/bound_match.rs:67— BoundMatch::next_batch has cognitive complexity 43 (threshold 15). Drivers by points: if/else 9 (31 pts), loops 3 (7 pts), match/switch 2 (5 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.
Expr::fmt (cognitive 42) crates/cypher/src/print.rs:218— Expr::fmt has cognitive complexity 42 (threshold 15). Drivers by points: if/else 15 (25 pts), boolean chains 12, match/switch 3 (5 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
GraphPatternOrder::schedule (cognitive 40) crates/planner/src/relational/graph_order.rs:246— GraphPatternOrder::schedule has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (28 pts), boolean chains 8, match/switch 1 (3 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Client.postStatement (cognitive 39) sdks/go/cypher.go:59— Client.postStatement has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (36 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Branch::next (cognitive 38) crates/db/src/execution/interpreter/pull/branch.rs:30— Branch::next has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 2 (5 pts), boolean chains 3, match/switch 2 (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.
Repeat::next (cognitive 38) crates/db/src/execution/interpreter/pull/repeat.rs:50— Repeat::next has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 2 (5 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.
image_archive.scan_archive_for_secrets (cognitive 38) docker-image/image_archive.py:323— image_archive.scan_archive_for_secrets has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 6 (11 pts), error handling 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.
NodeCursor::next_batch (cognitive 37) crates/db/src/execution/interpreter/rows/scan.rs:133— NodeCursor::next_batch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 4 (9 pts), match/switch 1 (2 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.
generate-llms.build (cognitive 35) docs/scripts/generate-llms.mjs:116— generate-llms.build has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 6 (10 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.
PendingSelection::analyze_text (cognitive 34) crates/db/src/execution/interpreter/access/search/pending.rs:515— PendingSelection::analyze_text has cognitive complexity 34 (threshold 15). Drivers by points: match/switch 8 (16 pts), if/else 9 (15 pts), loops 2, boolean chains 1 (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
NodeMatch::next_batch (cognitive 34) crates/db/src/execution/interpreter/rows/correlated.rs:107— NodeMatch::next_batch has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 4 (11 pts), match/switch 2 (5 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
run_embedded_parity.main (cognitive 34) sdks/python/scripts/run_embedded_parity.py:51— run_embedded_parity.main has cognitive complexity 34 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (8 pts), error handling 2 (5 pts), boolean chains 3 (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.
helix.PropertyValueOf (cognitive 34) REDACTED:231— helix.PropertyValueOf has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 6 (13 pts), boolean chains 2, match/switch 1 (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.
OrderedRangeCursor::next (cognitive 33) crates/db/src/index_lifecycle/secondary/exact/ordered.rs:427— OrderedRangeCursor::next has cognitive complexity 33 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (3 pts), match/switch 2 (3 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.
InputWindow::for_initial_source (cognitive 33) crates/planner/src/relational/input_window.rs:50— InputWindow::for_initial_source has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 6, match/switch 3 (5 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.
RuleApplicability::matches (cognitive 33) crates/planner/src/rules/contracts/applicability/matching.rs:12— RuleApplicability::matches has cognitive complexity 33 (threshold 15). Drivers by points: match/switch 22 (33 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
VectorMemoryStore::load_from_read_inner (cognitive 32) crates/db/src/search/vector/cache/store.rs:867— VectorMemoryStore::load_from_read_inner has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 5 (14 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OracleState::read_indexed (cognitive 32) crates/db-testkit/src/model.rs:653— OracleState::read_indexed has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 3 (4 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
graph._decode_tagged_identity (cognitive 31) sdks/python/src/helixdb/graph.py:1009— graph._decode_tagged_identity has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (20 pts), boolean chains 10, ternaries 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.
StorageCostProfileOverrides::apply_to (cognitive 29) crates/planner/src/cost/profile/overrides.rs:66— StorageCostProfileOverrides::apply_to has cognitive complexity 29 (threshold 15). Drivers by points: if/else 29. 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.
ExecProgram::derive (cognitive 29) crates/planner/src/exec/pull/mod.rs:164— ExecProgram::derive has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 7 (12 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.
helix.normalizeTypedQueryValue (cognitive 29) REDACTED:3059— helix.normalizeTypedQueryValue has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (23 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BatchCondition.UnmarshalJSON (cognitive 29) REDACTED:2136— BatchCondition.UnmarshalJSON has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (26 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dsl.quoteUnsafeIntegerTokens (cognitive 28) sdks/typescript/src/dsl.ts:97— dsl.quoteUnsafeIntegerTokens has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HelixError.remote (cognitive 28) sdks/typescript/src/index.ts:135— HelixError.remote has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 9, ternaries 4 (8 pts), error handling 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExecutableDagBuilder::push_selected_range_pipeline (cognitive 27) crates/planner/src/exec/selected/lowering/access/stream/pipeline.rs:121— ExecutableDagBuilder::push_selected_range_pipeline has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 2 (5 pts), boolean chains 2, loops 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.
GraphSelection.request (cognitive 27) sdks/go/graph.go:49— GraphSelection.request has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 7, loops 3, match/switch 1 (nesting depth added 4). Of this number, 23 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LookupCursor::next_batch (cognitive 26) crates/db/src/execution/interpreter/rows/lookup_cursor.rs:42— LookupCursor::next_batch has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 6 (15 pts), loops 3 (9 pts), if/else 1 (2 pts) (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SecondaryMutationRuntime::flush (cognitive 26) crates/db/src/index_lifecycle/secondary.rs:514— SecondaryMutationRuntime::flush has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (4 pts), match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LegacyVectorRetirementCatalog::load (cognitive 26) crates/db/src/migrations/vector_retirement.rs:68— LegacyVectorRetirementCatalog::load has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2, 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.
helix.UnmarshalIndexDdlReceipt (cognitive 26) REDACTED:1163— helix.UnmarshalIndexDdlReceipt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (25 pts), match/switch 1 (nesting depth added 9). Of this number, 22 points are the body's own statements and 4 belong to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Step.ToAST (cognitive 26) REDACTED:1461— Step.ToAST has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (25 pts), match/switch 1 (nesting depth added 12). Of this number, 25 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RangeScan::resolve_group (cognitive 25) crates/db/src/index_lifecycle/secondary/exact/ordered.rs:126— RangeScan::resolve_group has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (20 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
helix_graph_algorithms::algorithms::leiden::refine_connected (cognitive 25) crates/graph-algorithms/src/algorithms/leiden.rs:164— helix_graph_algorithms::algorithms::leiden::refine_connected has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 3 (5 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.
run_embedded_parity.async_main (cognitive 25) sdks/python/scripts/run_embedded_parity.py:162— run_embedded_parity.async_main has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4 (6 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Client.Exec (cognitive 24) sdks/go/client.go:345— Client.Exec has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (20 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
generate-llms-full.build (cognitive 24) docs/scripts/generate-llms-full.mjs:94— generate-llms-full.build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 3 (11 pts), loops 4 (9 pts), ternaries 1 (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.
run-helix.runCypherHttpSuite (cognitive 24) sdks/typescript/scripts/parity/run-helix.ts:90— run-helix.runCypherHttpSuite has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (7 pts), ternaries 1 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorKey::parse_from_slice (cognitive 23) crates/db/src/encoding/v2/keys/indexes/vector/mod.rs:232— VectorKey::parse_from_slice has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 5 (10 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.
PropertyValue.from_value (cognitive 23) sdks/python/src/helixdb/dsl.py:403— PropertyValue.from_value has cognitive complexity 23 (threshold 15). Drivers by points: if/else 18 (21 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
paritycypher.RunEmbedded (cognitive 23) sdks/go/internal/paritycypher/run.go:111— paritycypher.RunEmbedded has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (21 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.
PropertyValue.from (cognitive 23) sdks/typescript/src/dsl.ts:417— PropertyValue.from has cognitive complexity 23 (threshold 15). Drivers by points: if/else 17 (20 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Edit::apply (cognitive 22) crates/db/src/index_lifecycle/graph_mutation/map.rs:94— Edit::apply has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 4, loops 3 (4 pts), match/switch 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueuePublisher::publish_vector (cognitive 22) crates/db/src/index_lifecycle/queue/publication.rs:1095— QueuePublisher::publish_vector has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (16 pts), match/switch 4, 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.
GraphModel::apply_inner (cognitive 22) crates/db-testkit/src/model.rs:179— GraphModel::apply_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 3 (6 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ReplayTrace::validate (cognitive 22) crates/db-testkit/src/trace.rs:213— ReplayTrace::validate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LevelGraph::local_move_observed (cognitive 22) crates/graph-algorithms/src/algorithms/louvain.rs:158— LevelGraph::local_move_observed has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 5 (10 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.
OperatorContract::derive (cognitive 22) crates/planner/src/relational/contracts.rs:81— OperatorContract::derive has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 2 (4 pts), boolean chains 3, loops 1 (2 pts) (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.
dsl._convert_param_value (cognitive 22) sdks/python/src/helixdb/dsl.py:3752— dsl._convert_param_value has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (20 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.
Cursor::new (cognitive 21) crates/db/src/execution/interpreter/access/edge_candidates.rs:148— Cursor::new has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 3 (6 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.
IndexOperationBacklog::reserve (cognitive 21) crates/db/src/index_lifecycle/queue/backlog.rs:363— IndexOperationBacklog::reserve has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4, boolean chains 3, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SecondaryIndexDriver::prepare_step (cognitive 21) crates/db/src/index_lifecycle/secondary.rs:1162— SecondaryIndexDriver::prepare_step has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 4 (6 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.
NormalizedPlannerCase::complete (cognitive 21) crates/db-testkit/src/planner_domain.rs:400— NormalizedPlannerCase::complete has cognitive complexity 21 (threshold 15). Drivers by points: loops 6 (21 pts) (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.
helix_metrics::cli::spool::cleanup_obsolete (cognitive 21) crates/metrics/src/cli/spool.rs:95— helix_metrics::cli::spool::cleanup_obsolete has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (5 pts), boolean chains 3 (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.
Accumulator::push_with_admission (cognitive 21) crates/planner/src/relational/aggregation.rs:110— Accumulator::push_with_admission has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), match/switch 7, boolean chains 2 (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.
dsl._normalize_typed_query_value (cognitive 21) sdks/python/src/helixdb/dsl.py:3899— dsl._normalize_typed_query_value has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (20 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.
dsl.convertParamValue (cognitive 21) sdks/typescript/src/dsl.ts:2917— dsl.convertParamValue has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), ternaries 2 (5 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PropertyIndexKey::encoded_len (cognitive 19) crates/db/src/encoding/v2/keys/indexes/property.rs:204— PropertyIndexKey::encoded_len has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 4 (7 pts) (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.
ProbeCursor::next_batch (cognitive 19) crates/db/src/execution/interpreter/rows/hash_probe.rs:31— ProbeCursor::next_batch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 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.
GraphSelection.__post_init__ (cognitive 19) sdks/python/src/helixdb/graph.py:138— GraphSelection.__post_init__ has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 5, 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.
dsl.stringifyEncoded (cognitive 19) sdks/typescript/src/dsl.ts:160— dsl.stringifyEncoded has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 4 (5 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.
dsl.normalizeTypedQueryValue (cognitive 19) sdks/typescript/src/dsl.ts:2981— dsl.normalizeTypedQueryValue has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 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.
Clause::fmt (cognitive 18) crates/cypher/src/print.rs:37— Clause::fmt has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ScanCache::extend (cognitive 18) crates/db/src/execution/interpreter/rows/cross_product.rs:170— ScanCache::extend has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (6 pts), match/switch 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.
ExpansionStack::next_batch (cognitive 18) crates/db/src/execution/interpreter/rows/expansion_stack.rs:201— ExpansionStack::next_batch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 3 (7 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.
HashJoinTable::build_batches (cognitive 18) crates/db/src/execution/interpreter/rows/joins.rs:48— HashJoinTable::build_batches 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.
Bitmap::combine (cognitive 18) crates/db/src/query_resources/bitmap.rs:151— Bitmap::combine has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimHasherRegistry::get (cognitive 18) crates/db/src/search/vector/simhash/registry.rs:159— SimHasherRegistry::get has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 3 (6 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.
ExecPullCapability::of (cognitive 18) crates/planner/src/exec/pull/mod.rs:23— ExecPullCapability::of has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 6 (12 pts), if/else 4 (6 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Predicate.to_json (cognitive 18) sdks/python/src/helixdb/dsl.py:959— Predicate.to_json has cognitive complexity 18 (threshold 15). Drivers by points: if/else 18. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HelixConfig::validate (cognitive 17) crates/cli/src/config.rs:557— HelixConfig::validate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 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.
Requirements::insert (cognitive 17) crates/db/src/execution/interpreter/rows/requirements.rs:27— Requirements::insert has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (13 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.
FtsCache::cleanup_disk (cognitive 17) crates/db/src/search/text/cache.rs:961— FtsCache::cleanup_disk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Memo::from_groups (cognitive 17) crates/planner/src/memo/store/serialization.rs:12— Memo::from_groups has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (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.
RowPlan::explain (cognitive 17) crates/planner/src/relational/explain.rs:61— RowPlan::explain has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (12 pts), match/switch 2 (3 pts), boolean chains 2 (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.
dsl.parse_index_operation_status (cognitive 17) sdks/python/src/helixdb/dsl.py:1701— dsl.parse_index_operation_status has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), boolean chains 3 (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.
QueryExecutionRequest.execute (cognitive 17) sdks/typescript/src/index.ts:561— QueryExecutionRequest.execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (6 pts), error handling 4 (5 pts), ternaries 2 (4 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.
LocalRuntime::ensure_image (cognitive 16) crates/cli/src/local_runtime.rs:768— LocalRuntime::ensure_image has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (10 pts), if/else 4 (5 pts), loops 1 (nesting depth added 5). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
EdgeRangeIndexKey::parse_from_slice (cognitive 16) crates/db/src/encoding/v2/keys/indexes/range/edge.rs:128— EdgeRangeIndexKey::parse_from_slice has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (2 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (GlobalEdgeRangeIndexKey::parse_from_slice) 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.
GlobalEdgeRangeIndexKey::parse_from_slice (cognitive 16) crates/db/src/encoding/v2/keys/indexes/range/edge.rs:341— GlobalEdgeRangeIndexKey::parse_from_slice has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 1 (2 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (EdgeRangeIndexKey::parse_from_slice) 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.
MutationIndexCatalog::load (cognitive 16) crates/db/src/index_lifecycle/mutation_catalog.rs:322— MutationIndexCatalog::load has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 3 (6 pts), loops 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
QueuedMutationCollector::collect (cognitive 16) crates/db/src/index_lifecycle/queue/producer.rs:214— QueuedMutationCollector::collect has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 3 (7 pts), 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.
StagedQueueWrites::reserve (cognitive 16) crates/db/src/index_lifecycle/queue/producer.rs:109— StagedQueueWrites::reserve has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Near-duplicate member family (6 members, 28 shared lines) · ×1
Near-duplicate member family (6 members, 28 shared lines) crates/db/src/migrations/vector_properties.rs:145— crates/db/src/migrations/vector_properties.rs:145-301 | crates/db/src/migrations/vector_retirement.rs:253-404 | crates/db/src/migrations/vector_retirement.rs:413-531 | crates/db/src/migrations/vector_retirement.rs:539-665 | crates/db/src/migrations/vector_retirement.rs:674-776 | crates/db/src/migrations/vector_retirement.rs:785-935 — These 6 members are variants of one another: a block of 28 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 36 shared lines) · ×1
Near-duplicate member family (4 members, 36 shared lines) crates/db/src/migrations/vector_retirement.rs:253— crates/db/src/migrations/vector_retirement.rs:253-404 | crates/db/src/migrations/vector_retirement.rs:413-531 | crates/db/src/migrations/vector_retirement.rs:539-665 | crates/db/src/migrations/vector_retirement.rs:785-935 — These 4 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 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, 34 shared lines) · ×1
Near-duplicate member family (4 members, 34 shared lines) crates/db/src/migrations/vector_retirement.rs:253— crates/db/src/migrations/vector_retirement.rs:253-404 | crates/db/src/migrations/vector_retirement.rs:539-665 | crates/db/src/migrations/vector_retirement.rs:674-776 | crates/db/src/migrations/vector_retirement.rs:785-935 — These 4 members are variants of one another: a block of 34 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, 33 shared lines) · ×1
Near-duplicate member family (3 members, 33 shared lines) crates/db/src/index_lifecycle/text/validation.rs:245— crates/db/src/index_lifecycle/text/validation.rs:245-495 | crates/db/src/index_lifecycle/text/validation.rs:505-690 | crates/db/src/index_lifecycle/text/validation.rs:699-939 — These 3 members are variants of one another: a block of 33 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 (67 shared lines) crates/ast/src/testing/variants.rs:653— crates/ast/src/testing/variants.rs:653-744 | crates/planner/src/planning/envelope/root_kind.rs:12-98 — These two members are variants of one another: 67 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 (66 shared lines) crates/planner/src/exec/lowering/costing.rs:258— crates/planner/src/exec/lowering/costing.rs:258-404 | crates/planner/src/exec/lowering/costing.rs:409-528 — These two members are variants of one another: 66 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 (62 shared lines) crates/db/src/index_lifecycle/queue/publication.rs:1099— crates/db/src/index_lifecycle/queue/publication.rs:1099-1363 | crates/db/src/index_lifecycle/queue/publication.rs:1693-1875 — These two members are variants of one another: 62 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 (60 shared lines) crates/db/src/index_lifecycle_testing.rs:1161— crates/db/src/index_lifecycle_testing.rs:1161-1273 | crates/db/src/index_lifecycle_testing.rs:1287-1458 — These two members are variants of one another: 60 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 (52 shared lines) crates/db/src/execution/interpreter/access/indexes.rs:289— crates/db/src/execution/interpreter/access/indexes.rs:289-357 | crates/db/src/execution/interpreter/access/indexes.rs:366-434 — These two members are variants of one another: 52 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 (34 shared lines) crates/db/src/search/mod.rs:1563— crates/db/src/search/mod.rs:1563-1603 | crates/db/src/search/mod.rs:1633-1673 — These two members are variants of one another: 34 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 (27 shared lines) crates/planner/src/exec/access/edge.rs:278— crates/planner/src/exec/access/edge.rs:278-324 | crates/planner/src/exec/access/node.rs:427-488 — These two members are variants of one another: 27 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) · ×1
Members sharing a duplicated core (11 members, 50+ identical tokens) crates/db/src/encoding/v2/keys/graph.rs:30— crates/db/src/encoding/v2/keys/graph.rs:30-57 | crates/db/src/encoding/v2/keys/graph.rs:101-128 | crates/db/src/encoding/v2/keys/graph.rs:172-202 | crates/db/src/encoding/v2/keys/graph.rs:252-279 | crates/db/src/encoding/v2/keys/graph.rs:322-349 | crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:103-182 | crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:249-293 | crates/db/src/encoding/v2/keys/indexes/equality/node.rs:58-107 | crates/db/src/encoding/v2/keys/indexes/label.rs:39-79 | crates/db/src/encoding/v2/keys/indexes/label.rs:142-195 | crates/db/src/encoding/v2/legacy/edge_property_pair.rs:25-53 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) crates/db/src/search/vector/spaces/simple_avx.rs:21— crates/db/src/search/vector/spaces/simple_avx.rs:21-73 | crates/db/src/search/vector/spaces/simple_avx.rs:76-130 | crates/db/src/search/vector/spaces/simple_avx.rs:134-186 | crates/db/src/search/vector/spaces/simple_avx.rs:190-244 | crates/db/src/search/vector/spaces/simple_neon.rs:12-54 | crates/db/src/search/vector/spaces/simple_neon.rs:58-91 | crates/db/src/search/vector/spaces/simple_sse.rs:19-68 | crates/db/src/search/vector/spaces/simple_sse.rs:71-125 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/planner/src/exec/lowering/contracts/access/cardinality.rs:72— crates/planner/src/exec/lowering/contracts/access/cardinality.rs:72-89 | crates/planner/src/exec/selected/lowering/contracts/matching/access/source/node.rs:17-94 | crates/planner/src/rules/access/sets/canonical/node.rs:8-27 | crates/planner/src/rules/access/sets/canonical/node.rs:60-77 | crates/planner/src/rules/access/sets/canonical/node.rs:81-98 | crates/planner/src/rules/cardinality.rs:1246-1305 | crates/planner/src/rules/physical_contracts/access/source/node.rs:12-38 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (5 members, 50+ identical tokens) crates/ast/src/nesting.rs:26— crates/ast/src/nesting.rs:26-133 | crates/db/src/execution/interpreter/stream/filter.rs:319-357 | crates/planner/src/cost/profile/residual.rs:71-119 | crates/planner/src/diagnostics/analyze.rs:1272-1317 | crates/planner/src/ir/expr/validation.rs:34-84 — 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 (132 corresponding lines) · ×1
Edited copy of a member (132 corresponding lines) crates/db/src/execution/interpreter/access/secondary_set.rs:515— crates/db/src/execution/interpreter/access/secondary_set.rs:515-676 | crates/db/src/execution/interpreter/access/secondary_set.rs:683-814 — These two members are one piece of code written twice and then edited apart: 132 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (111 corresponding lines) · ×1
Edited copy of a member (111 corresponding lines) crates/planner/src/rules/cardinality.rs:424— crates/planner/src/rules/cardinality.rs:424-534 | crates/planner/src/rules/cardinality.rs:540-650 — These two members are one piece of code written twice and then edited apart: 111 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) crates/planner/src/relational/expression.rs:362— crates/planner/src/relational/expression.rs:362-439 | crates/planner/src/relational/expression.rs:571-638 — 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 (70 corresponding lines) · ×1
Edited copy of a member (70 corresponding lines) crates/planner/src/rules/physical_contracts/access/source/edge.rs:57— crates/planner/src/rules/physical_contracts/access/source/edge.rs:57-126 | crates/planner/src/rules/physical_contracts/access/source/node.rs:57-129 — 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 (77 corresponding lines) · ×1
Edited copy of a member (77 corresponding lines) crates/db/src/encoding/v2/keys/indexes/range/edge.rs:128— crates/db/src/encoding/v2/keys/indexes/range/edge.rs:128-243 | crates/db/src/encoding/v2/keys/indexes/range/edge.rs:341-417 — 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 copies of one member (3 members, 81+ corresponding lines) · ×1
Edited copies of one member (3 members, 81+ corresponding lines) crates/db/src/search/mod.rs:1031— crates/db/src/search/mod.rs:1031-1111 | crates/db/src/search/mod.rs:2412-2522 | crates/db/src/search/mod.rs:2544-2732 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 81 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 (61 corresponding lines) · ×1
Edited copy of a member (61 corresponding lines) crates/planner/src/diagnostics/analyze.rs:438— crates/planner/src/diagnostics/analyze.rs:438-507 | crates/planner/src/diagnostics/analyze.rs:509-569 — These two members are one piece of code written twice and then edited apart: 61 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (53 corresponding lines) · ×1
Edited copy of a member (53 corresponding lines) crates/planner/src/exec/lowering/costing.rs:35— crates/planner/src/exec/lowering/costing.rs:35-87 | crates/planner/src/exec/lowering/costing.rs:92-144 — These two members are one piece of code written twice and then edited apart: 53 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (73 corresponding lines) · ×1
Edited copy of a member (73 corresponding lines) crates/db/src/migrations/vector_simhash_directory.rs:538— crates/db/src/migrations/vector_simhash_directory.rs:538-610 | crates/db/src/migrations/vector_simhash_directory.rs:743-825 — These two members are one piece of code written twice and then edited apart: 73 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (56 corresponding lines) · ×1
Edited copy of a member (56 corresponding lines) crates/planner/src/rules/access/pipeline/mod.rs:71— crates/planner/src/rules/access/pipeline/mod.rs:71-126 | crates/planner/src/rules/root/stream_access.rs:41-111 — These two members are one piece of code written twice and then edited apart: 56 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (58 corresponding lines) · ×1
Edited copy of a member (58 corresponding lines) crates/db/src/index_lifecycle/secondary.rs:3211— crates/db/src/index_lifecycle/secondary.rs:3211-3277 | crates/db/src/index_lifecycle/vector/driver.rs:1913-1970 — 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 (59 corresponding lines) · ×1
Edited copy of a member (59 corresponding lines) crates/planner/src/exec/lowering/secondary_set.rs:244— crates/planner/src/exec/lowering/secondary_set.rs:244-302 | crates/planner/src/exec/lowering/secondary_set.rs:306-364 — 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 (95 corresponding lines) · ×1
Edited copy of a member (95 corresponding lines) crates/server/src/diagnostics/mod.rs:345— crates/server/src/diagnostics/mod.rs:345-439 | crates/server/src/diagnostics/mod.rs:558-656 — These two members are one piece of code written twice and then edited apart: 95 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (52 corresponding lines) · ×1
Edited copy of a member (52 corresponding lines) crates/planner/src/exec/count.rs:1234— crates/planner/src/exec/count.rs:1234-1287 | crates/planner/src/exec/count.rs:1301-1352 — 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 (62 corresponding lines) · ×1
Edited copy of a member (62 corresponding lines) crates/planner/src/exec/selected/lowering/access/leaf.rs:31— crates/planner/src/exec/selected/lowering/access/leaf.rs:31-92 | crates/planner/src/exec/selected/lowering/access/leaf.rs:120-181 — 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 (38 corresponding lines) · ×1
Edited copy of a member (38 corresponding lines) crates/planner/src/rules/cardinality.rs:1702— crates/planner/src/rules/cardinality.rs:1702-1739 | crates/planner/src/rules/cardinality.rs:1745-1782 — 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 (36 corresponding lines) · ×1
Edited copy of a member (36 corresponding lines) crates/planner/src/rules/access/order/satisfaction.rs:61— crates/planner/src/rules/access/order/satisfaction.rs:61-96 | crates/planner/src/rules/access/order/satisfaction.rs:101-136 — 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 (42 corresponding lines) · ×1
Edited copy of a member (42 corresponding lines) crates/graph-algorithms/src/algorithms/centrality.rs:148— crates/graph-algorithms/src/algorithms/centrality.rs:148-189 | crates/graph-algorithms/src/algorithms/centrality.rs:195-241 — These two members are one piece of code written twice and then edited apart: 42 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (43 corresponding lines) · ×1
Edited copy of a member (43 corresponding lines) crates/db/src/search/vector/cache/store.rs:352— crates/db/src/search/vector/cache/store.rs:352-400 | crates/db/src/search/vector/cache/store.rs:415-457 — 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 (65 corresponding lines) · ×1
Edited copy of a member (65 corresponding lines) crates/db/src/index_lifecycle_testing/contracts.rs:4224— crates/db/src/index_lifecycle_testing/contracts.rs:4224-4298 | crates/db/src/index_lifecycle_testing/contracts.rs:4324-4388 — These two members are one piece of code written twice and then edited apart: 65 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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 (48 corresponding lines) · ×1
Edited copy of a member (48 corresponding lines) crates/db/src/index_lifecycle/repository.rs:183— crates/db/src/index_lifecycle/repository.rs:183-236 | crates/db/src/migrations/startup/bootstrap.rs:330-377 — These two members are one piece of code written twice and then edited apart: 48 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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) · ×1
Edited copy of a member (55 corresponding lines) crates/db/src/execution/interpreter/access/restricted_text.rs:85— crates/db/src/execution/interpreter/access/restricted_text.rs:85-142 | crates/db/src/execution/interpreter/access/restricted_vector.rs:71-125 — 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 (46 corresponding lines) · ×1
Edited copy of a member (46 corresponding lines) crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:82— crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:82-129 | crates/db/src/encoding/v2/keys/indexes/vector/upper_layers.rs:22-67 — 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 (37 corresponding lines) · ×1
Edited copy of a member (37 corresponding lines) crates/planner/src/exec/lowering/contracts/access/cardinality.rs:5— crates/planner/src/exec/lowering/contracts/access/cardinality.rs:5-41 | crates/planner/src/ir/access/node/analysis.rs:7-47 — 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 (4 members, 31+ corresponding lines) · ×1
Edited copies of one member (4 members, 31+ corresponding lines) crates/db/src/search/vector/spaces/simple_avx.rs:252— crates/db/src/search/vector/spaces/simple_avx.rs:252-285 | crates/db/src/search/vector/spaces/simple_avx.rs:290-323 | crates/db/src/search/vector/spaces/simple_neon.rs:97-128 | crates/db/src/search/vector/spaces/simple_sse.rs:134-164 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 31 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copy of a member (30 corresponding lines) · ×1
Edited copy of a member (30 corresponding lines) crates/planner/src/analysis/index_atoms/equality.rs:32— crates/planner/src/analysis/index_atoms/equality.rs:32-61 | crates/planner/src/analysis/labels.rs:121-152 — 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, 33+ corresponding lines) · ×1
Edited copies of one member (3 members, 33+ corresponding lines) crates/db/src/encoding/v2/keys/indexes/vector/metadata.rs:27— crates/db/src/encoding/v2/keys/indexes/vector/metadata.rs:27-65 | crates/db/src/encoding/v2/keys/indexes/vector/storage_prefixes.rs:120-152 | crates/db/src/encoding/v2/legacy/vector/transaction_guard.rs:27-63 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 33 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 (5 members, 41+ corresponding lines) · ×1
Edited copies of one member (5 members, 41+ corresponding lines) crates/db/src/execution/interpreter/access/indexes.rs:439— crates/db/src/execution/interpreter/access/indexes.rs:439-485 | crates/db/src/execution/interpreter/access/indexes.rs:539-589 | crates/db/src/execution/interpreter/access/indexes.rs:595-645 | crates/db/src/execution/interpreter/access/indexes.rs:651-705 | crates/db/src/execution/interpreter/access/indexes.rs:710-750 — These 5 members are one piece of code written 5 times and then edited apart: every two of them correspond over at least 41 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 copy of a member (41 corresponding lines) · ×1
Edited copy of a member (41 corresponding lines) crates/db/src/search/mod.rs:2061— crates/db/src/search/mod.rs:2061-2101 | crates/db/src/search/mod.rs:2157-2197 — 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, 27+ corresponding lines) · ×1
Edited copies of one member (3 members, 27+ corresponding lines) crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:16— crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:16-48 | crates/db/src/encoding/v2/keys/indexes/vector/storage_prefixes.rs:180-206 | crates/db/src/encoding/v2/keys/indexes/vector/storage_prefixes.rs:233-259 — 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 (3 members, 25+ corresponding lines) · ×1
Edited copies of one member (3 members, 25+ corresponding lines) crates/db/src/encoding/v2/values/adjacency/mod.rs:357— crates/db/src/encoding/v2/values/adjacency/mod.rs:357-385 | crates/db/src/encoding/v2/values/adjacency/mod.rs:391-415 | crates/db/src/encoding/v2/values/adjacency/mod.rs:422-450 — 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, 22+ corresponding lines) · ×1
Edited copies of one member (3 members, 22+ corresponding lines) crates/db/src/search/text/mod.rs:1646— crates/db/src/search/text/mod.rs:1646-1668 | crates/db/src/search/text/mod.rs:1673-1694 | crates/db/src/search/text/mod.rs:1699-1725 — 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, 19+ corresponding lines) · ×1
Edited copies of one member (3 members, 19+ corresponding lines) crates/db/src/encoding/v2/keys/indexes/range/edge.rs:251— crates/db/src/encoding/v2/keys/indexes/range/edge.rs:251-270 | crates/db/src/encoding/v2/keys/indexes/range/edge.rs:419-437 | crates/db/src/encoding/v2/keys/indexes/range/node.rs:213-231 — 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, 18+ corresponding lines) · ×1
Edited copies of one member (3 members, 18+ corresponding lines) crates/planner/src/ir/bounds/stream/bound.rs:198— crates/planner/src/ir/bounds/stream/bound.rs:198-215 | crates/planner/src/ir/input/search/text.rs:93-112 | crates/planner/src/ir/input/search/vector.rs:198-215 — 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, 19+ corresponding lines) · ×1
Edited copies of one member (4 members, 19+ corresponding lines) crates/planner/src/planning/search/access/edge.rs:18— crates/planner/src/planning/search/access/edge.rs:18-36 | crates/planner/src/planning/search/access/edge.rs:46-64 | crates/planner/src/planning/search/access/node.rs:18-36 | crates/planner/src/planning/search/access/node.rs:46-64 — These 4 members are one piece of code written 4 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 4 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/db-testkit/src/model.rs:1013— crates/db-testkit/src/model.rs:1013-1029 | crates/db/src/encoding/v2/values/property/canonical_number.rs:8-25 | crates/db/src/encoding/v2/values/property/property_value.rs:254-271 | crates/db/src/encoding/v2/values/property/property_value.rs:309-326 | crates/db/src/index_lifecycle/vector.rs:301-320 | crates/planner/src/analysis/scalar/values.rs:212-229 — 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 (4 members, 15+ corresponding lines) · ×1
Edited copies of one member (4 members, 15+ corresponding lines) REDACTED:2348— REDACTED:2348-2365 | REDACTED:2402-2416 | REDACTED:2844-2861 | REDACTED:2922-2936 — 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 (5 members, 18+ corresponding lines) · ×1
Edited copies of one member (5 members, 18+ corresponding lines) crates/db/src/index_lifecycle/secondary.rs:5075— crates/db/src/index_lifecycle/secondary.rs:5075-5092 | crates/db/src/index_lifecycle/secondary.rs:5098-5115 | crates/db/src/index_lifecycle/vector/driver.rs:4131-4151 | crates/db/src/index_lifecycle/vector/driver.rs:4157-4177 | crates/db/src/index_lifecycle/vector/driver.rs:4184-4205 — 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 (3 members, 14+ corresponding lines) · ×1
Edited copies of one member (3 members, 14+ corresponding lines) crates/planner/src/planning/selected/native/scoped/entry/recursive.rs:41— crates/planner/src/planning/selected/native/scoped/entry/recursive.rs:41-55 | crates/planner/src/planning/selected/native/scoped/entry/recursive.rs:61-74 | crates/planner/src/planning/selected/native/scoped/entry/recursive.rs:80-93 — 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) · ×1
Edited copies of one member (3 members, 12+ corresponding lines) crates/planner/src/planning/selected/native/root/lower.rs:90— crates/planner/src/planning/selected/native/root/lower.rs:90-101 | crates/planner/src/planning/selected/native/root_stream/ast/access_pipeline.rs:13-29 | crates/planner/src/planning/selected/native/scoped/root_stream/access_pipeline.rs:15-31 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 12+ corresponding lines) · ×1
Edited copies of one member (4 members, 12+ corresponding lines) crates/planner/src/rules/physical_contracts/root_stream/contract.rs:49— crates/planner/src/rules/physical_contracts/root_stream/contract.rs:49-60 | crates/planner/src/rules/physical_contracts/root_stream/contract.rs:70-81 | crates/planner/src/rules/physical_contracts/root_stream/contract.rs:91-102 | crates/planner/src/rules/physical_contracts/root_stream/contract.rs:112-123 — These 4 members are one piece of code written 4 times and then edited apart: every two of them correspond over at least 12 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 4 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 9+ corresponding lines) · ×1
Edited copies of one member (3 members, 9+ corresponding lines) crates/db/src/index_lifecycle/secondary.rs:5233— crates/db/src/index_lifecycle/secondary.rs:5233-5243 | crates/db/src/index_lifecycle/text/driver.rs:2980-2988 | crates/db/src/index_lifecycle/vector/driver.rs:4287-4295 — These 3 members are one piece of code written 3 times and then edited apart: every two of them correspond over at least 9 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 3 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (3 members, 11+ corresponding lines) · ×1
Edited copies of one member (3 members, 11+ corresponding lines) crates/db/src/search/vector/parameters.rs:58— crates/db/src/search/vector/parameters.rs:58-68 | crates/db/src/search/vector/parameters.rs:82-92 | crates/db/src/search/vector/parameters.rs:122-132 — 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 (5 members, 17+ corresponding lines) · ×1
Edited copies of one member (5 members, 17+ corresponding lines) crates/db/src/index_lifecycle/operation.rs:1239— crates/db/src/index_lifecycle/operation.rs:1239-1255 | crates/db/src/index_lifecycle/operation.rs:1261-1279 | crates/db/src/index_lifecycle/operation.rs:1310-1326 | crates/db/src/index_lifecycle/operation.rs:1333-1349 | crates/db/src/index_lifecycle/operation.rs:1379-1397 — These 5 members are one piece of code written 5 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 5 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (4 members, 10+ corresponding lines) · ×1
Edited copies of one member (4 members, 10+ corresponding lines) crates/planner/src/ir/index/range/bounds/bound.rs:29— crates/planner/src/ir/index/range/bounds/bound.rs:29-38 | crates/planner/src/ir/index/range/bounds/bound.rs:40-49 | crates/planner/src/ir/index/range/bounds/bound.rs:51-60 | crates/planner/src/ir/index/range/bounds/bound.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.
D4 · Code Duplication· Edited copies of one member (6 members, 8+ corresponding lines) · ×1
Edited copies of one member (6 members, 8+ corresponding lines) crates/planner/src/ir/batch.rs:112— crates/planner/src/ir/batch.rs:112-119 | crates/planner/src/ir/contracts/element_ids.rs:96-103 | crates/planner/src/ir/order.rs:97-104 | crates/planner/src/ir/projection/binding.rs:130-137 | crates/planner/src/ir/projection/item.rs:185-192 | crates/planner/src/ir/projection/property.rs:89-96 — These 6 members are one piece of code written 6 times and then edited apart: every two of them correspond over at least 8 lines, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below: the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain. Factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Left alone, the next edit has to be made 6 times and the copies will drift further apart.
D4 · Code Duplication· Edited copies of one member (5 members, 9+ corresponding lines) · ×1
Edited copies of one member (5 members, 9+ corresponding lines) crates/planner/src/exec/returns.rs:105— crates/planner/src/exec/returns.rs:105-115 | crates/planner/src/ir/batch.rs:82-90 | crates/planner/src/ir/contracts/element_ids.rs:37-45 | crates/planner/src/ir/order.rs:57-67 | crates/planner/src/ir/projection/property.rs:57-67 — 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 copy of a member (4 corresponding lines) · ×1
Edited copy of a member (4 corresponding lines) crates/planner/src/logical/access/pipeline/candidates.rs:26— crates/planner/src/logical/access/pipeline/candidates.rs:26-29 | crates/planner/src/logical/pure.rs:117-120 — 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.
D4 · Code Duplication· Edited copy of a member (3 corresponding lines) · ×1
Edited copy of a member (3 corresponding lines) crates/db/src/index_lifecycle/text/manifest.rs:522— crates/db/src/index_lifecycle/text/manifest.rs:522-524 | crates/db/src/index_lifecycle/text/validation.rs:1095-1097 — These two members are one piece of code written twice and then edited apart: 3 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport 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, 4+ corresponding lines) · ×1
Edited copies of one member (3 members, 4+ corresponding lines) crates/planner/src/ir/index/equality.rs:199— crates/planner/src/ir/index/equality.rs:199-202 | crates/planner/src/ir/index/search.rs:165-168 | crates/planner/src/ir/input/search/vector.rs:113-116 — 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.
D4 · Code Duplication· Edited copies of one member (4 members, 4+ corresponding lines) · ×1
Edited copies of one member (4 members, 4+ corresponding lines) crates/planner/src/ir/contracts/non_empty_string.rs:150— crates/planner/src/ir/contracts/non_empty_string.rs:150-153 | crates/planner/src/ir/index/range/value.rs:146-149 | crates/planner/src/logical/access/pipeline/canonical.rs:45-48 | crates/planner/src/rules/contracts/id.rs:101-104 — These 4 members are one piece of code written 4 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 4 times and the copies will drift further apart.
Duplicated block (31 lines × 2) crates/db/src/search/vector/hnsw/mutation/mod.rs:609— crates/db/src/search/vector/hnsw/mutation/mod.rs:609-639 | crates/db/src/search/vector/hnsw/mutation/mod.rs:669-699 — both copies are in the same file, so extract the block into 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/db/src/migrations/vector_scale.rs:436— crates/db/src/migrations/vector_scale.rs:436-463 | crates/db/src/migrations/vector_scale.rs:583-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/db/src/migrations/vector_scale.rs:436` it begins part-way through the construct above it, so those exact lines 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 lines × 2) crates/db/src/migrations/indexes/equality_bitmap.rs:406— crates/db/src/migrations/indexes/equality_bitmap.rs:406-432 | crates/db/src/migrations/indexes/equality_bitmap.rs:455-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/migrations/indexes/equality_bitmap.rs:406` it does not close everything it opens, so those 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/db/src/migrations/indexes/equality_bitmap.rs:482` calls `Ok`, `is_empty` and `crates/db/src/migrations/indexes/equality_bitmap.rs:433` 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 (25–26 lines × 2) crates/db/src/index_lifecycle/text/driver.rs:1849— crates/db/src/index_lifecycle/text/driver.rs:1849-1874 | crates/db/src/index_lifecycle/text/driver.rs:2094-2118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/text/driver.rs:1849` it does not close everything it opens, so those 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, `crates/db/src/index_lifecycle/text/driver.rs:2093` calls `requires_creation` and `crates/db/src/index_lifecycle/text/driver.rs:1848` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (24–25 lines × 2) crates/db/src/encoding/v2/keys/indexes/vector/metadata.rs:28— crates/db/src/encoding/v2/keys/indexes/vector/metadata.rs:28-52 | crates/db/src/encoding/v2/legacy/vector/transaction_guard.rs:28-51 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/vector/metadata.rs` and `crates/db/src/encoding/v2/legacy/vector/transaction_guard.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (22–24 lines × 2) crates/db/src/index_lifecycle_testing.rs:313— crates/db/src/index_lifecycle_testing.rs:313-334 | crates/db/src/index_lifecycle_testing.rs:858-881 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. 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 (20–23 lines × 2) crates/db/src/search/vector/hnsw/search.rs:394— crates/db/src/search/vector/hnsw/search.rs:394-413 | crates/db/src/search/vector/hnsw/search.rs:437-459 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/hnsw/search.rs:394` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (32 lines × 2) crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:76— crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:76-107 | crates/planner/src/rules/access/sets/equality_range/intersection/node.rs:76-107 — before extracting anything, compare `crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs` and `crates/planner/src/rules/access/sets/equality_range/intersection/node.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 54 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/planner/src/rules/access/sets/equality_range/intersection/edge.rs:76` 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–21 lines × 3) crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:108— crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:108-128 | crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:251-267 | crates/db/src/encoding/v2/keys/indexes/equality/node.rs:60-78 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/equality/edge.rs` and `crates/db/src/encoding/v2/keys/indexes/equality/node.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–20 lines × 2) crates/ast/src/testing/variants.rs:654— crates/ast/src/testing/variants.rs:654-673 | crates/planner/src/planning/envelope/root_kind.rs:13-22 — before extracting anything, compare `crates/ast/src/testing/variants.rs` and `crates/planner/src/planning/envelope/root_kind.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/ast/src/testing/variants.rs:654` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18–20 lines × 2) crates/planner/src/planning/index_ddl/create.rs:18— crates/planner/src/planning/index_ddl/create.rs:18-37 | crates/planner/src/planning/index_ddl/drop.rs:16-33 — 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/planner/src/planning/index_ddl/create.rs:18` it does not close everything it opens, so those 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–19 lines × 3) crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:17— crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:17-35 | crates/db/src/encoding/v2/keys/indexes/vector/items.rs:17-34 | crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs:17-34 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs` and `crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16–19 lines × 2) crates/db/src/encoding/v2/keys/indexes/vector/items.rs:29— crates/db/src/encoding/v2/keys/indexes/vector/items.rs:29-44 | crates/db/src/encoding/v2/keys/indexes/vector/items.rs:93-111 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/encoding/v2/keys/indexes/vector/items.rs:29` it begins part-way through the construct above it, so those exact lines 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) crates/db/src/index_lifecycle/secondary.rs:5196— crates/db/src/index_lifecycle/secondary.rs:5196-5213 | crates/db/src/index_lifecycle/text/driver.rs:2956-2973 | crates/db/src/index_lifecycle/vector/driver.rs:4252-4269 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary.rs` and `crates/db/src/index_lifecycle/text/driver.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/secondary.rs:5196` it does not close everything it opens, so those exact lines 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/db/src/encoding/v2/values/indexes/equality/mod.rs:291— crates/db/src/encoding/v2/values/indexes/equality/mod.rs:291-308 | crates/db/src/encoding/v2/values/indexes/range.rs:66-83 — 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/db/src/encoding/v2/values/indexes/equality/mod.rs:291` it begins part-way through the construct above it, so those 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–18 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:3474— crates/db/src/index_lifecycle_testing/contracts.rs:3474-3485 | crates/db/src/index_lifecycle_testing/contracts.rs:3500-3517 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle_testing/contracts.rs:3474` it begins part-way through the construct above it, so those exact lines 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/db/src/encoding/v2/keys/indexes/equality/edge.rs:279— crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:279-293 | crates/db/src/encoding/v2/keys/indexes/equality/node.rs:91-107 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/equality/edge.rs` and `crates/db/src/encoding/v2/keys/indexes/equality/node.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 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/db/src/encoding/v2/keys/indexes/equality/edge.rs:279` 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–17 lines × 2) crates/db/src/index_lifecycle/secondary.rs:2071— crates/db/src/index_lifecycle/secondary.rs:2071-2087 | crates/db/src/index_lifecycle/secondary.rs:2597-2610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/index_lifecycle/secondary.rs:2071` it begins part-way through the construct above it, so those exact lines 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–16 lines × 5) crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:109— crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:109-124 | crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:251-265 | crates/db/src/encoding/v2/keys/indexes/equality/node.rs:60-74 | crates/db/src/encoding/v2/keys/indexes/label.rs:41-55 | crates/db/src/encoding/v2/keys/indexes/label.rs:147-162 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/equality/edge.rs` and `crates/db/src/encoding/v2/keys/indexes/equality/node.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 69 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13–16 lines × 4) crates/db/src/search/vector/spaces/simple_avx.rs:55— crates/db/src/search/vector/spaces/simple_avx.rs:55-67 | crates/db/src/search/vector/spaces/simple_avx.rs:110-125 | crates/db/src/search/vector/spaces/simple_avx.rs:168-180 | crates/db/src/search/vector/spaces/simple_avx.rs:224-239 — 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/db/src/search/vector/spaces/simple_avx.rs:55` it begins part-way through the construct above it, so those exact lines 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 × 3) crates/db/src/execution/interpreter/mod.rs:386— crates/db/src/execution/interpreter/mod.rs:386-401 | crates/db/src/execution/interpreter/pull/branch.rs:135-150 | crates/db/src/execution/interpreter/pull/mod.rs:211-226 — before extracting anything, compare `crates/db/src/execution/interpreter/pull/branch.rs` and `crates/db/src/execution/interpreter/pull/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.
Duplicated block (14–16 lines × 2) crates/db/src/encoding/v2/keys/indexes/range/edge.rs:219— crates/db/src/encoding/v2/keys/indexes/range/edge.rs:219-234 | crates/db/src/encoding/v2/keys/indexes/range/edge.rs:401-414 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/keys/indexes/range/edge.rs:219` it begins part-way through the construct above it, so those exact lines 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–16 lines × 2) crates/db/src/search/vector/hnsw/index.rs:1381— crates/db/src/search/vector/hnsw/index.rs:1381-1393 | crates/db/src/search/vector/hnsw/index.rs:1448-1463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/hnsw/index.rs:1381` it begins part-way through the construct above it, so those exact lines 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 × 6) crates/db/src/migrations/vector_properties.rs:282— crates/db/src/migrations/vector_properties.rs:282-296 | crates/db/src/migrations/vector_retirement.rs:388-400 | crates/db/src/migrations/vector_retirement.rs:515-527 | crates/db/src/migrations/vector_retirement.rs:649-661 | crates/db/src/migrations/vector_retirement.rs:758-771 | crates/db/src/migrations/vector_retirement.rs:917-930 — before extracting anything, compare `crates/db/src/migrations/vector_properties.rs` and `crates/db/src/migrations/vector_retirement.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/migrations/vector_properties.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. 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 (15 lines × 5) crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:169— crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:169-183 | crates/db/src/encoding/v2/keys/indexes/vector/layer0.rs:18-32 | crates/db/src/encoding/v2/keys/indexes/vector/reverse_edges.rs:21-35 | crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs:163-177 | crates/db/src/encoding/v2/keys/indexes/vector/upper_layers.rs:107-121 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs` and `crates/db/src/encoding/v2/keys/indexes/vector/layer0.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 (28–30 lines × 3) crates/db/src/index_lifecycle/secondary/exact.rs:95— crates/db/src/index_lifecycle/secondary/exact.rs:95-124 | crates/db/src/index_lifecycle/secondary/exact.rs:277-304 | crates/db/src/index_lifecycle/secondary/exact/unique.rs:47-74 — before extracting anything, compare `crates/db/src/index_lifecycle/secondary/exact.rs` and `crates/db/src/index_lifecycle/secondary/exact/unique.rs` as WHOLE FILES: this scan already matched 3 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. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/index_lifecycle/secondary/exact.rs:95` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/db/src/index_lifecycle/secondary/exact.rs:125` calls `encode`, `definition_lane`, `clone` and `crates/db/src/index_lifecycle/secondary/exact.rs:305` 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 × 2) crates/db/src/search/vector/spaces/simple_sse.rs:50— crates/db/src/search/vector/spaces/simple_sse.rs:50-62 | crates/db/src/search/vector/spaces/simple_sse.rs:106-120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/spaces/simple_sse.rs:50` it begins part-way through the construct above it, so those exact lines 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 × 6) crates/db/src/encoding/v2/keys/graph.rs:33— crates/db/src/encoding/v2/keys/graph.rs:33-46 | crates/db/src/encoding/v2/keys/graph.rs:104-117 | crates/db/src/encoding/v2/keys/graph.rs:175-188 | crates/db/src/encoding/v2/keys/graph.rs:255-268 | crates/db/src/encoding/v2/keys/graph.rs:325-338 | crates/db/src/encoding/v2/legacy/edge_property_pair.rs:28-41 — before extracting anything, compare `crates/db/src/encoding/v2/keys/graph.rs` and `crates/db/src/encoding/v2/legacy/edge_property_pair.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/keys/graph.rs:33` it begins part-way through the construct above it, so those exact lines 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/db/src/search/vector/storage/mod.rs:919— crates/db/src/search/vector/storage/mod.rs:919-932 | crates/db/src/search/vector/storage/mod.rs:941-954 | crates/db/src/search/vector/storage/mod.rs:970-983 — 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/db/src/search/vector/storage/mod.rs:919` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11–14 lines × 2) crates/db/src/execution/interpreter/rows/mod.rs:258— crates/db/src/execution/interpreter/rows/mod.rs:258-268 | crates/db/src/execution/interpreter/rows/mod.rs:301-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 `crates/db/src/execution/interpreter/rows/mod.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. 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) crates/db/src/migrations/vector_retirement.rs:496— crates/db/src/migrations/vector_retirement.rs:496-508 | crates/db/src/migrations/vector_retirement.rs:626-638 | crates/db/src/migrations/vector_retirement.rs:898-910 — 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/db/src/migrations/vector_retirement.rs:496` it begins part-way through the construct above it, so those exact lines 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) crates/db/src/encoding/v2/keys/indexes/range/edge.rs:371— crates/db/src/encoding/v2/keys/indexes/range/edge.rs:371-382 | crates/db/src/encoding/v2/keys/indexes/range/node.rs:185-197 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/range/edge.rs` and `crates/db/src/encoding/v2/keys/indexes/range/node.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 81 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/db/src/encoding/v2/keys/indexes/range/edge.rs:371` it begins part-way through the construct above it, so those exact lines 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–13 lines × 2) crates/db/src/search/vector/storage/mod.rs:1500— crates/db/src/search/vector/storage/mod.rs:1500-1509 | crates/db/src/search/vector/storage/mod.rs:1551-1563 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/vector/storage/mod.rs:1500` it begins part-way through the construct above it, so those 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 (12 lines × 4) crates/db/src/execution/interpreter/mutation/edge.rs:279— crates/db/src/execution/interpreter/mutation/edge.rs:279-290 | crates/db/src/execution/interpreter/mutation/edge.rs:343-354 | crates/db/src/execution/interpreter/mutation/node.rs:220-231 | crates/db/src/execution/interpreter/mutation/node.rs:297-308 — before extracting anything, compare `crates/db/src/execution/interpreter/mutation/edge.rs` and `crates/db/src/execution/interpreter/mutation/node.rs` as WHOLE FILES: this scan already matched 4 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. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/execution/interpreter/mutation/edge.rs:279` it does not close everything it opens, so those exact lines 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–12 lines × 2) crates/planner/src/relational/planning.rs:263— crates/planner/src/relational/planning.rs:263-274 | crates/planner/src/relational/planning.rs:718-727 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 5) crates/planner/src/rules/access/sets/canonical/node.rs:12— crates/planner/src/rules/access/sets/canonical/node.rs:12-22 | crates/planner/src/rules/access/sets/canonical/node.rs:63-73 | crates/planner/src/rules/access/sets/canonical/node.rs:84-94 | crates/planner/src/rules/cardinality.rs:1292-1302 | crates/planner/src/rules/physical_contracts/access/source/node.rs:19-29 — there are 5 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9–11 lines × 4) crates/db/src/search/mod.rs:1218— crates/db/src/search/mod.rs:1218-1228 | crates/db/src/search/mod.rs:1247-1257 | crates/db/src/search/mod.rs:1291-1299 | crates/db/src/search/mod.rs:1356-1364 — 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/db/src/search/mod.rs:1218` 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–11 lines × 3) crates/ast/src/nesting.rs:119— crates/ast/src/nesting.rs:119-127 | crates/db/src/search/text/mod.rs:1337-1347 | crates/planner/src/ir/index/equality.rs:177-186 — 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–11 lines × 3) crates/db/src/index_lifecycle/text/validation.rs:451— crates/db/src/index_lifecycle/text/validation.rs:451-461 | crates/db/src/index_lifecycle/text/validation.rs:656-665 | crates/db/src/index_lifecycle/text/validation.rs:900-909 — 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/db/src/index_lifecycle/text/validation.rs:451` 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 × 2) crates/db/src/encoding/v2/keys/indexes/range/edge.rs:342— crates/db/src/encoding/v2/keys/indexes/range/edge.rs:342-350 | crates/db/src/encoding/v2/keys/indexes/range/node.rs:153-163 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/range/edge.rs` and `crates/db/src/encoding/v2/keys/indexes/range/node.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 81 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 × 2) crates/graph-algorithms/src/algorithms/centrality.rs:158— crates/graph-algorithms/src/algorithms/centrality.rs:158-165 | crates/graph-algorithms/src/algorithms/centrality.rs:202-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/graph-algorithms/src/algorithms/centrality.rs:158` it does not close everything it opens, so those 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/graph-algorithms/src/algorithms/centrality.rs:156` calls `saturating_sub` and `crates/graph-algorithms/src/algorithms/centrality.rs:201` 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 × 11) crates/db/src/encoding/v2/keys/graph.rs:32— crates/db/src/encoding/v2/keys/graph.rs:32-40 | crates/db/src/encoding/v2/keys/graph.rs:103-111 | crates/db/src/encoding/v2/keys/graph.rs:174-182 | crates/db/src/encoding/v2/keys/graph.rs:254-262 | crates/db/src/encoding/v2/keys/graph.rs:324-332 | crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:110-118 | crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:251-259 | crates/db/src/encoding/v2/keys/indexes/equality/node.rs:60-68 | crates/db/src/encoding/v2/keys/indexes/label.rs:41-49 | crates/db/src/encoding/v2/keys/indexes/label.rs:148-156 | crates/db/src/encoding/v2/legacy/edge_property_pair.rs:27-35 — before extracting anything, compare `crates/db/src/encoding/v2/keys/graph.rs` and `crates/db/src/encoding/v2/legacy/edge_property_pair.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/encoding/v2/keys/graph.rs:32` it does not close everything it opens, so those exact lines 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 × 6) crates/db-testkit/src/model.rs:1018— crates/db-testkit/src/model.rs:1018-1026 | crates/db/src/encoding/v2/values/property/canonical_number.rs:13-21 | crates/db/src/encoding/v2/values/property/property_value.rs:259-267 | crates/db/src/encoding/v2/values/property/property_value.rs:314-322 | crates/db/src/index_lifecycle/vector.rs:307-314 | crates/planner/src/analysis/scalar/values.rs:217-225 — before extracting anything, compare `crates/db/src/encoding/v2/values/property/canonical_number.rs` and `crates/db/src/encoding/v2/values/property/property_value.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7–8 lines × 6) crates/planner/src/exec/lowering/contracts/access/cardinality.rs:76— crates/planner/src/exec/lowering/contracts/access/cardinality.rs:76-83 | crates/planner/src/rules/access/sets/canonical/node.rs:15-21 | crates/planner/src/rules/access/sets/canonical/node.rs:66-72 | crates/planner/src/rules/access/sets/canonical/node.rs:87-93 | crates/planner/src/rules/cardinality.rs:1295-1301 | crates/planner/src/rules/physical_contracts/access/source/node.rs:22-28 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/planner/src/exec/lowering/contracts/access/cardinality.rs:84` calls `Intersect`, `Union` and `crates/planner/src/rules/physical_contracts/access/source/node.rs:29` 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–8 lines × 5) crates/planner/src/exec/lowering/contracts/access/cardinality.rs:95— crates/planner/src/exec/lowering/contracts/access/cardinality.rs:95-102 | crates/planner/src/rules/access/sets/canonical/edge.rs:15-21 | crates/planner/src/rules/access/sets/canonical/edge.rs:66-72 | crates/planner/src/rules/access/sets/canonical/edge.rs:87-93 | crates/planner/src/rules/physical_contracts/access/source/edge.rs:22-28 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `crates/planner/src/exec/lowering/contracts/access/cardinality.rs:103` calls `Intersect`, `Union` and `crates/planner/src/rules/physical_contracts/access/source/edge.rs:29` 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–8 lines × 3) crates/planner/src/planning/envelope/write_contract.rs:42— crates/planner/src/planning/envelope/write_contract.rs:42-48 | crates/planner/src/planning/selected/native/context_usage.rs:34-40 | crates/planner/src/planning/selected/native/context_usage.rs:225-232 — before extracting anything, compare `crates/planner/src/planning/envelope/write_contract.rs` and `crates/planner/src/planning/selected/native/context_usage.rs` as WHOLE FILES: this scan already matched 12 separate duplicated blocks between them, totalling at least 148 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `crates/planner/src/planning/selected/native/context_usage.rs:224` calls `Ok`, `unbound` and `crates/planner/src/planning/envelope/write_contract.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.
Duplicated block (3–8 lines × 8) crates/db/src/search/vector/spaces/simple_avx.rs:31— crates/db/src/search/vector/spaces/simple_avx.rs:31-33 | crates/db/src/search/vector/spaces/simple_avx.rs:86-88 | crates/db/src/search/vector/spaces/simple_avx.rs:144-146 | crates/db/src/search/vector/spaces/simple_avx.rs:200-202 | crates/db/src/search/vector/spaces/simple_neon.rs:20-27 | crates/db/src/search/vector/spaces/simple_neon.rs:66-73 | crates/db/src/search/vector/spaces/simple_sse.rs:29-31 | crates/db/src/search/vector/spaces/simple_sse.rs:81-83 — there are 8 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 8 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/db/src/search/vector/spaces/simple_neon.rs:20` it does not close everything it opens, so those 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/db/src/search/vector/spaces/simple_neon.rs:19` calls `left`, `values`, `as_ptr` and `crates/db/src/search/vector/spaces/simple_avx.rs:31` 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 (4–7 lines × 4) crates/db/src/index_lifecycle/scope_gate.rs:307— crates/db/src/index_lifecycle/scope_gate.rs:307-313 | crates/db/src/index_lifecycle/scope_gate.rs:318-321 | crates/db/src/index_lifecycle/scope_gate.rs:344-350 | crates/db/src/index_lifecycle/scope_gate.rs:358-364 — 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/db/src/index_lifecycle/scope_gate.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 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/db/src/index_lifecycle/scope_gate.rs:305` calls `unwrap_or_else`, `Some`, `get` and `crates/db/src/index_lifecycle/scope_gate.rs:318` 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 (3–7 lines × 3) crates/db/src/migrations/vector_simhash_directory.rs:541— crates/db/src/migrations/vector_simhash_directory.rs:541-547 | crates/db/src/migrations/vector_simhash_directory.rs:628-630 | crates/db/src/migrations/vector_simhash_directory.rs:746-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/db/src/migrations/vector_simhash_directory.rs:541` it does not close everything it opens, so those 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/db/src/migrations/vector_simhash_directory.rs:540` calls `begin` and `crates/db/src/migrations/vector_simhash_directory.rs:628` 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 (51 lines × 2) crates/planner/src/exec/lowering/access_leaf/edge.rs:101— crates/planner/src/exec/lowering/access_leaf/edge.rs:101-151 | crates/planner/src/exec/lowering/access_leaf/node.rs:101-151 — 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 (35 lines × 2) crates/planner/src/exec/selected/index_ddl.rs:31— crates/planner/src/exec/selected/index_ddl.rs:31-65 | crates/planner/src/exec/selected/mutation/root.rs:26-60 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `crates/planner/src/exec/selected/index_ddl.rs:31` it begins part-way through the construct above it, so those 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 `plan` to `ir::IndexDdlPlan` in one and `SelectedMutationPlan` 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 × 10) crates/db/src/encoding/v2/keys/indexes/equality/scans.rs:28— crates/db/src/encoding/v2/keys/indexes/equality/scans.rs:28-32 | crates/db/src/encoding/v2/keys/indexes/equality/scans.rs:89-93 | crates/db/src/encoding/v2/keys/indexes/equality/scans.rs:178-182 | crates/db/src/encoding/v2/keys/indexes/label.rs:363-367 | crates/db/src/encoding/v2/keys/indexes/label.rs:407-411 | crates/db/src/encoding/v2/keys/indexes/range/scans.rs:29-33 | crates/db/src/encoding/v2/keys/indexes/range/scans.rs:142-146 | crates/db/src/encoding/v2/keys/indexes/range/scans.rs:259-263 | crates/db/src/encoding/v2/keys/indexes/vector/mod.rs:226-230 | crates/db/src/encoding/v2/keys/metadata.rs:65-69 — there are 10 copies across 5 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 10 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 5) crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:222— crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs:222-227 | crates/db/src/encoding/v2/keys/indexes/vector/layer0.rs:71-76 | crates/db/src/encoding/v2/keys/indexes/vector/reverse_edges.rs:74-79 | crates/db/src/encoding/v2/keys/indexes/vector/simhash.rs:215-220 | crates/db/src/encoding/v2/keys/indexes/vector/upper_layers.rs:159-164 — before extracting anything, compare `crates/db/src/encoding/v2/keys/indexes/vector/entry_candidates.rs` and `crates/db/src/encoding/v2/keys/indexes/vector/layer0.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 (20–21 lines × 2) crates/db/src/search/text/split.rs:373— crates/db/src/search/text/split.rs:373-393 | crates/db/src/search/text/split.rs:509-528 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/db/src/search/text/split.rs:373` it does not close everything it opens, so those exact lines 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) crates/db/src/migrations/vector_retirement.rs:364— crates/db/src/migrations/vector_retirement.rs:364-373 | crates/db/src/migrations/vector_retirement.rs:491-500 | crates/db/src/migrations/vector_retirement.rs:621-630 | crates/db/src/migrations/vector_retirement.rs:736-745 | crates/db/src/migrations/vector_retirement.rs:893-902 — 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/db/src/migrations/vector_retirement.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. 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) crates/db/src/migrations/vector_properties.rs:259— crates/db/src/migrations/vector_properties.rs:259-267 | crates/db/src/migrations/vector_retirement.rs:364-372 | crates/db/src/migrations/vector_retirement.rs:491-499 | crates/db/src/migrations/vector_retirement.rs:621-629 | crates/db/src/migrations/vector_retirement.rs:736-744 | crates/db/src/migrations/vector_retirement.rs:893-901 — before extracting anything, compare `crates/db/src/migrations/vector_properties.rs` and `crates/db/src/migrations/vector_retirement.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `crates/db/src/migrations/vector_properties.rs:259` it begins part-way through the construct above it, so those exact lines 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/db/src/execution/interpreter/pull/poll.rs:265— crates/db/src/execution/interpreter/pull/poll.rs:265-269 | crates/db/src/execution/interpreter/pull/poll.rs:300-305 | crates/db/src/execution/interpreter/pull/poll.rs:393-397 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. 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–12 lines × 4) sdks/python/scripts/run_embedded_parity.py:302— sdks/python/scripts/run_embedded_parity.py:302-313 | sdks/python/scripts/run_embedded_parity.py:335-346 | sdks/python/scripts/run_server_parity.py:407-416 | sdks/python/scripts/run_server_parity.py:425-434 — 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 `sdks/python/scripts/run_embedded_parity.py:302` it begins part-way through the construct above it, so those 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.
End-of-life runtime: Rust 1.97 rust-toolchain.toml:1— rust-toolchain.toml declares Rust 1.97 as this project's toolchain file, and Rust 1.97, superseded by 1.98 on 2026-08-20 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-08-20 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
Duplicated block (49 lines × 2 locations) sdks/typescript/src/dsl.ts:2601— sdks/typescript/src/dsl.ts:2601 · sdks/typescript/src/dsl.ts:2670 — 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 (26 lines × 2 locations) sdks/typescript/src/dsl.ts:2099— sdks/typescript/src/dsl.ts:2099 · sdks/typescript/src/dsl.ts:2137 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2 locations) sdks/typescript/src/dsl.ts:495— sdks/typescript/src/dsl.ts:495 · sdks/typescript/src/dsl.ts:526 — 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 (19 lines × 2 locations) sdks/typescript/src/dsl.ts:2000— sdks/typescript/src/dsl.ts:2000 · sdks/typescript/src/dsl.ts:2028 — 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 (16 lines × 2 locations) sdks/typescript/src/dsl.ts:2579— sdks/typescript/src/dsl.ts:2579 · sdks/typescript/src/dsl.ts:2646 — 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) sdks/typescript/src/index.ts:376— sdks/typescript/src/index.ts:376 · sdks/typescript/src/index.ts:392 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2 locations) sdks/typescript/src/dsl.ts:2062— sdks/typescript/src/dsl.ts:2062 · sdks/typescript/src/dsl.ts:2172 — 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 (12 lines × 2 locations) sdks/typescript/src/dsl.ts:1106— sdks/typescript/src/dsl.ts:1106 · sdks/typescript/src/dsl.ts:1121 — both copies are in the same file, so extract the block into 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 locations) sdks/typescript/src/dsl.ts:2923— sdks/typescript/src/dsl.ts:2923 · sdks/typescript/src/dsl.ts:2988 — 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 (8 lines × 2 locations) sdks/typescript/scripts/parity/generate-fixtures.ts:492— sdks/typescript/scripts/parity/generate-fixtures.ts:492 · sdks/typescript/scripts/parity/generate-fixtures.ts:522 — all 2 copies are in the same file, and the CITED SPAN is a run of DECLARATIONS inside a construct — the members of a type, or the entries of an object or array literal — with no statement anywhere in it. Do not read this as an extract-a-helper row: nothing here executes, so there is no call site, and a call expression cannot stand where a member declaration or a literal's entry was. What repeats is a SHAPE, and which shape decides the move. Where the copies declare the same members, the repetition is a missing common ancestor: give it a base type, an interface both extend, a generic instantiated twice, or — where the copies are a literal's entries rather than a type's members — one shared constant each site spreads or refers to, so the set is written once. Where they declare DIFFERENT members and only the form is shared — a decorator and its options, an annotation, a registration table's keys — the form is prescribed by a framework or a schema rather than copied, and the only collapse available is to generate the declarations from that schema; where you do not own the generator, this is the cost of the framework and there is nothing to extract. Check which of the two it is before acting: these copies still drift apart the first time only one of them is edited, which is why the repetition is reported, but the sentence to act on is not the same in both cases.
Duplicated block (7 lines × 2 locations) sdks/typescript/scripts/edge-drop-regression.ts:23— sdks/typescript/scripts/edge-drop-regression.ts:23 · sdks/typescript/scripts/edge-drop-regression.ts:38 — 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 (7 lines × 3 locations) sdks/typescript/src/dsl.ts:717— sdks/typescript/src/dsl.ts:717 · sdks/typescript/src/dsl.ts:724 · sdks/typescript/src/dsl.ts:734 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (6 lines × 10 locations) sdks/typescript/src/dsl.ts:2261— sdks/typescript/src/dsl.ts:2261 · sdks/typescript/src/dsl.ts:2267 · sdks/typescript/src/dsl.ts:2273 · sdks/typescript/src/dsl.ts:2282 · +6 more site(s) not listed — all 10 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 (6 lines × 4 locations) sdks/typescript/src/dsl.ts:2270— sdks/typescript/src/dsl.ts:2270 · sdks/typescript/src/dsl.ts:2372 · sdks/typescript/src/dsl.ts:2378 · sdks/typescript/src/dsl.ts:2390 — all 4 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 (6 lines × 3 locations) sdks/typescript/src/dsl.ts:2312— sdks/typescript/src/dsl.ts:2312 · sdks/typescript/src/dsl.ts:2318 · sdks/typescript/src/dsl.ts:2336 — all 3 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (5 lines × 2 locations) sdks/typescript/scripts/parity/generate-fixtures.ts:758— sdks/typescript/scripts/parity/generate-fixtures.ts:758 · sdks/typescript/scripts/parity/generate-fixtures.ts:778 — 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.
Complex function remote (cyclomatic 25, cognitive 31) sdks/typescript/src/index.ts:135— remote has cyclomatic complexity 25 and cognitive complexity 31; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function convertParamValue (cyclomatic 23, cognitive 22) sdks/typescript/src/dsl.ts:2917— convertParamValue has cyclomatic complexity 23 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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 normalizeTypedQueryValue (cyclomatic 22, cognitive 20) sdks/typescript/src/dsl.ts:2981— normalizeTypedQueryValue has cyclomatic complexity 22 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.
R2 · Cyclomatic Complexity· Complex function from (cyclomatic 19, cognitive 22) · ×1
Complex function from (cyclomatic 19, cognitive 22) sdks/typescript/src/dsl.ts:417— from has cyclomatic complexity 19 and cognitive complexity 22; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function quoteUnsafeIntegerTokens (cyclomatic 16, cognitive 29) sdks/typescript/src/dsl.ts:97— quoteUnsafeIntegerTokens has cyclomatic complexity 16 and cognitive complexity 29; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function stringifyEncoded (cyclomatic 16, cognitive 19) sdks/typescript/src/dsl.ts:160— stringifyEncoded has cyclomatic complexity 16 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 parseIndexOperationStatus (cyclomatic 16, cognitive 16) sdks/typescript/src/dsl.ts:1317— parseIndexOperationStatus has cyclomatic complexity 16 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function constructor (cyclomatic 14, cognitive 16) sdks/typescript/src/graph.ts:46— constructor has cyclomatic complexity 14 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function encode (cyclomatic 12, cognitive 14) sdks/typescript/src/dsl.ts:10— encode has cyclomatic complexity 12 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 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 execute (cyclomatic 12, cognitive 14) sdks/typescript/src/index.ts:653— execute has cyclomatic complexity 12 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 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 12, cognitive 10) sdks/typescript/scripts/parity/cypher-results.ts:80— (anonymous) has cyclomatic complexity 12 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 (top-level) (cyclomatic 11, cognitive 16) REDACTED:2— (top-level) has cyclomatic complexity 11 and cognitive complexity 16; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
sdks/typescript/src/dsl.ts: 3144 lines of code sdks/typescript/src/dsl.ts:1— sdks/typescript/src/dsl.ts has 3144 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· sdks/typescript/scripts/parity/generate-fixtures.ts · ×1
sdks/typescript/scripts/parity/generate-fixtures.ts: 1286 lines of code sdks/typescript/scripts/parity/generate-fixtures.ts:1— sdks/typescript/scripts/parity/generate-fixtures.ts has 1286 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· sdks/typescript/src/index.ts · ×1
sdks/typescript/src/index.ts: 666 lines of code sdks/typescript/src/index.ts:1— sdks/typescript/src/index.ts has 666 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 (~145 LoC) sdks/typescript/scripts/parity/run-embedded-client.ts— no import path from any entry point (16 application, 4 tooling, 11 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) sdks/typescript/scripts/edge-drop-regression.ts— no import path from any entry point (16 application, 4 tooling, 11 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 'koffi' — Declared in sdks/typescript/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Duplicated predicate sdks/typescript/scripts/parity/run-embedded-client.ts:135— `(normalized.kind === "accepted" || normalized.kind === "existing_operation") && "operation_id" in normalized` appears character-identically in 2 files — sdks/typescript/scripts/parity/run-embedded-client.ts, sdks/typescript/scripts/parity/run-helix.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sdks/typescript/scripts/parity/run-embedded-client.ts:122— `(object.kind === "accepted" || object.kind === "existing_operation") && typeof object.operation_id === "string"` appears character-identically in 2 files — sdks/typescript/scripts/parity/run-embedded-client.ts, sdks/typescript/scripts/parity/run-helix.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sdks/typescript/scripts/parity/compare-json.ts:81— `entry.isFile() && entry.name.endsWith(".json")` appears character-identically in 4 files — sdks/typescript/scripts/parity/compare-json.ts, sdks/typescript/scripts/parity/cypher-results.ts, sdks/typescript/scripts/parity/run-embedded-parity.ts, sdks/typescript/scripts/parity/run-helix.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sdks/typescript/scripts/parity/compare-json.ts:39— `missingInCandidate.length || extraInCandidate.length` appears character-identically in 2 files — sdks/typescript/scripts/parity/compare-json.ts, sdks/typescript/scripts/parity/run-helix.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sdks/typescript/scripts/parity/run-embedded-parity.ts:311— `result.error === undefined && result.status === 0` appears character-identically in 2 files — sdks/typescript/scripts/parity/run-embedded-parity.ts, sdks/typescript/scripts/parity/run-helix.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sdks/typescript/scripts/parity/run-embedded-client.ts:107— `status !== "queued" && status !== "running"` appears character-identically in 2 files — sdks/typescript/scripts/parity/run-embedded-client.ts, sdks/typescript/scripts/parity/run-helix.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sdks/typescript/scripts/parity/run-embedded-client.ts:120— `value !== null && typeof value === "object"` appears character-identically in 2 files — sdks/typescript/scripts/parity/run-embedded-client.ts, sdks/typescript/scripts/parity/run-helix.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sdks/typescript/scripts/parity/cypher-results.ts:161— `value === null || typeof value !== "object"` appears character-identically in 4 files — sdks/typescript/scripts/parity/cypher-results.ts, sdks/typescript/scripts/parity/run-embedded-client.ts, sdks/typescript/scripts/parity/run-helix.ts, sdks/typescript/src/dsl.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate sdks/typescript/scripts/parity/run-embedded-client.ts:143— `value === null || typeof value !== "object" || !(field in value)` appears character-identically in 2 files — sdks/typescript/scripts/parity/run-embedded-client.ts, sdks/typescript/scripts/parity/run-helix.ts. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/db/src/execution/interpreter/rows/projection_chain.rs:222— `!aggregate && !distinct && ordering.is_empty()` appears character-identically in 2 files — crates/db/src/execution/interpreter/rows/projection_chain.rs, crates/planner/src/relational/pipeline.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/db/src/index_lifecycle/secondary.rs:2825— `applied.index_id != operation.index_id() || applied.generation != operation.generation() || entity.kind != definition.element_kind()` appears character-identically in 2 files — crates/db/src/index_lifecycle/secondary.rs, crates/db/src/index_lifecycle/vector/driver.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/planner/src/rules/access/sets/equality_range/range_union/edge.rs:60— `entry.key.label == key.label && entry.key.property == key.property && entry.range.contains_secondary_literal(value)` appears character-identically in 2 files — crates/planner/src/rules/access/sets/equality_range/range_union/edge.rs, crates/planner/src/rules/access/sets/equality_range/range_union/node.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:144— `equality_key.label != range_key.label || equality_key.property != range_key.property` appears character-identically in 2 files — crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs, crates/planner/src/rules/access/sets/equality_range/intersection/node.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:118— `equality_key.label == range_key.label && equality_key.property == range_key.property && (range.contains_secondary_literal(value) || range.ex…` appears character-identically in 2 files — crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs, crates/planner/src/rules/access/sets/equality_range/intersection/node.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/planner/src/rules/access/sets/contradiction/edge.rs:30— `is_statically_empty(left) || is_statically_empty(right)` appears character-identically in 2 files — crates/planner/src/rules/access/sets/contradiction/edge.rs, crates/planner/src/rules/access/sets/contradiction/node.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/db/src/index_lifecycle/secondary.rs:5084— `key.index_id != value.index_id || key.generation != value.generation || key.entity.kind != value.entity_kind || key.entity.id != value.entit…` appears character-identically in 2 files — crates/db/src/index_lifecycle/secondary.rs, crates/db/src/index_lifecycle/vector/driver.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/planner/src/rules/access/sets/contradiction/edge.rs:61— `left_key == right_key && left_value != right_value` appears character-identically in 2 files — crates/planner/src/rules/access/sets/contradiction/edge.rs, crates/planner/src/rules/access/sets/contradiction/node.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/planner/src/rules/access/sets/contradiction/edge.rs:47— `literal_equalities_conflict(left, right) || literal_equality_range_conflict(left, right) || literal_equality_range_conflict(right, left)` appears character-identically in 2 files — crates/planner/src/rules/access/sets/contradiction/edge.rs, crates/planner/src/rules/access/sets/contradiction/node.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/db/src/execution/interpreter/count.rs:751— `lookup.key != verification.key || lookup.value != verification.value` appears character-identically in 2 files — crates/db/src/execution/interpreter/count.rs, crates/planner/src/exec/count.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/db/src/search/vector/hnsw/mutation/mod.rs:301— `newly_admitted_neighbors.len() < LAYER0_NEIGHBOR_PREFETCH_MIN_TARGETS || remaining_prefetch_budget == 0` appears character-identically in 2 files — crates/db/src/search/vector/hnsw/mutation/mod.rs, crates/db/src/search/vector/hnsw/search.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/db/src/config/tests.rs:289— `options.cache_on_flush && options.cache_on_compaction` appears character-identically in 2 files — crates/db/src/config/tests.rs, crates/server/src/config.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/db/src/index_lifecycle/secondary.rs:4174— `property.name == "$label" && property.value.as_str() == Some(definition.label().as_str())` appears character-identically in 3 files — crates/db/src/index_lifecycle/secondary.rs, crates/db/src/index_lifecycle/text/projection.rs, crates/db/src/index_lifecycle/vector.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/planner/src/ir/access/edge/analysis.rs:174— `range_key.label == equality_key.label && range_key.property == equality_key.property && range.contains_secondary_literal(value)` appears character-identically in 2 files — crates/planner/src/ir/access/edge/analysis.rs, crates/planner/src/ir/access/node/analysis.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/planner/src/rules/access/sets/contradiction/edge.rs:74— `range_key.label == equality_key.label && range_key.property == equality_key.property && range.excludes_secondary_literal(value)` appears character-identically in 2 files — crates/planner/src/rules/access/sets/contradiction/edge.rs, crates/planner/src/rules/access/sets/contradiction/node.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate crates/db/src/index_lifecycle/secondary.rs:5160— `record.index_id() != operation.index_id() || record.identity() != operation.identity() || record.revision() != operation.index_record_revisi…` appears character-identically in 3 files — crates/db/src/index_lifecycle/secondary.rs, crates/db/src/index_lifecycle/text/driver.rs, crates/db/src/index_lifecycle/vector/driver.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.
Hand-rolled JSON/XML parsing via regex docs/scripts/check-docs.mjs:84— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex docs/scripts/check-docs.mjs:85— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Hand-rolled JSON/XML parsing via regex docs/scripts/check-docs.mjs:86— A regex whose pattern encodes JSON/XML syntax is parsing a structured format by hand — malformed or differently-typed content (e.g. `"amount": "5"` as a string) silently mis-parses instead of failing validation. This JavaScript/TypeScript code already uses a real parser in the same package; use it here too.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 171 significant file(s) lose their only recent owner: crates/db/src/search/vector/hnsw/mutation/mod.rs, crates/db/src/index_lifecycle/vector/driver.rs, crates/db/src/migrations/mod.rs, crates/db/src/search/text/mod.rs, crates/db/src/search/vector/storage/mod.rs, crates/db/src/search/vector/hnsw/index.rs, crates/db/src/index_lifecycle/outbox.rs, crates/db/src/search/text/cache.rs (+163 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 119 significant file(s) lose their only recent owner: crates/planner/src/relational/planning.rs, bindings/uniffi/src/graph.rs, crates/cypher/src/bind.rs, crates/planner/src/relational/evaluation.rs, crates/cypher/src/parser.rs, crates/db/src/execution/interpreter/rows/matches.rs, crates/db/src/execution/interpreter/rows/mod.rs, crates/ast-arena-derive/src/expand.rs (+111 more). Pair on, review, or document these before any departure.
D21 · Naming Consistency· `externalID` spells `ID` where 26 names in the project spell it `Id` · ×2
`externalID` spells `ID` where 26 names in the project spell it `Id` sdks/typescript/scripts/parity/generate-fixtures.ts:98— 26 of 28 names in project repository spell the token `Id` (26 of 28; unit: names in project repository containing `Id`). Peers: cypher-results.graphId (sdks/typescript/scripts/parity/cypher-results.ts:185); generate-fixtures.userProps(externalId) (sdks/typescript/scripts/parity/generate-fixtures.ts:74); sdks.typescript.src.dsl.NodeId (sdks/typescript/src/dsl.ts:229); sdks.typescript.src.dsl.EdgeId (sdks/typescript/src/dsl.ts:230); dsl.indexOperationId (sdks/typescript/src/dsl.ts:1234). Rename to `externalId`. [rule N6]
`externalID` spells `ID` where 26 names in the project spell it `Id` sdks/typescript/scripts/parity/generate-fixtures.ts:102— 26 of 28 names in project repository spell the token `Id` (26 of 28; unit: names in project repository containing `Id`). Peers: cypher-results.graphId (sdks/typescript/scripts/parity/cypher-results.ts:185); generate-fixtures.userProps(externalId) (sdks/typescript/scripts/parity/generate-fixtures.ts:74); sdks.typescript.src.dsl.NodeId (sdks/typescript/src/dsl.ts:229); sdks.typescript.src.dsl.EdgeId (sdks/typescript/src/dsl.ts:230); dsl.indexOperationId (sdks/typescript/src/dsl.ts:1234). Rename to `externalId`. [rule N6]
Thin authorization enforcement — Authorization rules exist but no route guard, auth middleware or handler that refuses a caller was found.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 4 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (295 single-owned of 966 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 966 of the 1495 production source files in this repository met that bar). They are anonymized user #3 (2 file(s)), anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: crates/graph-algorithms/src/algorithms/louvain.rs, crates/graph-algorithms/src/algorithms/cycles.rs, crates/graph-algorithms/src/algorithms/centrality.rs, crates/planner/src/ir/index_ddl.rs, crates/cli/src/host_actions.rs.
No ADRs found sdks/go/cmd/generate-parity-fixtures/main.go:1— No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`. ADRs are expected here because `sdks/go/cmd/generate-parity-fixtures/main.go` makes this repository a deployable product (line 1).
D21 · Naming Consistency· `QueryJson` spells `Json` where 38 names in the project spell it `JSON` · ×1
`QueryJson` spells `Json` where 38 names in the project spell it `JSON` sdks/go/client.go:111— 38 of 39 names in project github.com/helixdb/helix-db/sdks/go spell the token `JSON` (38 of 39; unit: names in project github.com/helixdb/helix-db/sdks/go containing `JSON`). Peers: main.readJSONResult (sdks/go/cmd/generate-parity-fixtures/main.go:256); PropertyValue.MarshalJSON (REDACTED:351); PropertyInput.MarshalJSON (REDACTED:402); NodeRef.MarshalJSON (REDACTED:428); EdgeRef.MarshalJSON (REDACTED:448). Rename to `QueryJSON`. [rule N6]
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 3 of 22 project(s) overshoot their size bounds, lowering Project Cohesion to 7.4/10. The most over is `crates/db` (252145 LoC, 502 module-visible types across 68 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 1 of 967 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 967 of the 1495 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: crates/db/src/search/vector/access/read_view.rs. Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
Orphaned file crates/db/src/search/vector/access/read_view.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 3/9 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `.`, `bindings/uniffi`, `bindings/uniffi-bindgen`, `crates/cli`, `sdks/go` and 1 more.
No dependency-update automation docs/package.json:10— `docs/package.json` 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 'workspacesRoot' · ×1
Unused export 'workspacesRoot' sdks/typescript/scripts/parity/paths.ts:15— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused private field '__readBatchBrand' · ×1
Unused private field '__readBatchBrand' sdks/typescript/src/dsl.ts:2584— Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
R7 · Dead Code· Unused private field '__writeBatchBrand' · ×1
Unused private field '__writeBatchBrand' sdks/typescript/src/dsl.ts:2651— Nothing in its class reads or assigns this private field (for a constructor parameter property: it is stored and never read), and no string key or test reaches it by name. Remove it, or use it where it was meant to take effect.
No app-layer HTTPS enforcement detected — This repository starts an HTTP server and nothing in its Rust source or committed `Rocket.toml` secures the transport: no TLS served (actix-web `bind_rustls`/`bind_openssl`, axum-server `bind_rustls` with a `RustlsConfig`, tonic `ServerTlsConfig`, a `TlsAcceptor`, Rocket's `[default.tls]`), no `Strict-Transport-Security` header, no `X-Forwarded-Proto` read from a TLS-terminating proxy — so its traffic may cross the network in clear text. (−2.0 on this card.) The server: `Server::builder()` (crates/server/src/grpc.rs:29).
No security response headers detected — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `Server::builder()` (crates/server/src/grpc.rs:29).
X2 · Cancellation propagation· Not all functions that make a request accept a context.Context or an AbortSignal · ×1
Not all functions that make a request accept a context.Context or an AbortSignal — Only 4/6 functions that make a cancellable request (fetch, axios, ky, ofetch, got, undici, node:http; net/http, net.Dial) accept a context.Context or an AbortSignal or pass one on, so a request keeps running after whatever wanted it has given up — a page navigated away from, a cancelled request, a shutdown, an expired deadline. Take a `signal` (Go: `ctx context.Context`) 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.
Null assertions (`!`) override strict null checking — ~1.7 `!` null assertions per 1k TypeScript source lines — 10 assertion(s) across the 5872 source line(s) of the 13 TypeScript file(s) read, which is the only code the operator asserts anything in (a `!` in a `.js` file is not this operator and was not counted, and one in a file whose null checking is off silences nothing). Densest: sdks/typescript/scripts/parity/run-helix.ts (6), sdks/typescript/src/dsl.ts (3), sdks/typescript/src/graph.ts (1). Each one tells the compiler to trust the author about null, suppressing the very diagnostic `strictNullChecks` exists to produce. Many are correct: each is a claim the checker could not verify, and it is wrong only where the value can in fact be missing, so review the densest places first.
Silent fallback default on Err crates/db/src/migrations/indexes/equality_bitmap.rs:394— `index_record_candidates` 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.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 2 file(s) — `REDACTED`, `sdks/typescript/src/dsl.ts` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a1db64-0067-7e6e-864f-865d3092e70d · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 167 · Warnings: 1815 · Recommendations: 67 — Appendix A · all findings · full markdown report.
Generated by the Canine Code Analyzer: deterministic code-health analysis. 14-11-2026 @ 18:48 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.