Public report of HelixDB/helix-db, published 27 October 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.10.5). 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, 27 October 2026, 22:22 UTC · Survey ID cd_e596f29cb7904fb8a215a0eba616a668
HelixDB/helix-db
Measured 27 October 2026, 22:18 UTC, at code version 2052f24
Regression: 1 dimension fell since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
Down 1 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: 433,070 lines of product code in 22 projects, tests not counted · Estimated rebuild effort: about 6.3 person-years · Weakest lens: Security and Compliance, 41
Findings by how serious they are
167 critical1537 serious57 minor
12 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks 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
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
27 October 2026, 22:18 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 Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works 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 ▸
84of 84 dimensions measured by tools.
1735of 1761 findings point to an exact file and line, so you can open each one in the code. The other 26 concern the repository as a whole, such as missing documentation.
84dimensions across 7 lenses, read from 433,070 lines of product code in 22 projects.
HelixDB/helix-db falls short of our standard for production, in part because it has packages with a known security hole. It scores 55 out of 100 and is rated Adequate, and all 167 of its critical findings are security problems.
Security and Compliance, at 41, is the weakest lens and counts most in the score. The best first step is checking access in every handler, worth about 8 points. Fixing the password or key in the code comes next, worth about 4 points. Raising Security and Compliance to 70 would lift the score to about 65.
145 pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Seven passwords or keys in the code's history and one in the code are open to anyone who can read the repository, and five known security holes in the packages the code depends on can be used by attackers. Replacing each exposed password or key, pinning each tool to an exact version and updating the vulnerable packages 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 433,070 lines, about €920,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.
Watchdog compares 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: 14 findings
These 14 critical or serious findings were in the previous survey, on 13 October 2026, and are gone from this one.
€310,000 to €1,500,000, for 5,103 to 16,188 hours of work, about 6.3 person-years for 3 to 12 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: 433,070 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: Watchdog prices 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 8 points · Medium effort · Access Controls
2
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
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 €920,000 to build again, about 6.3 person-years of work. Its weakest lens is Security and Compliance, at 41 (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 8 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
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.
1096 modules, with 3558 dependencies between them. 8 loops run through 265 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1056 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.execution.interpreter.count.literal uses db.query_resources, so a change to db.query_resources can break db.execution.interpreter.count.literal, while a change to db.execution.interpreter.count.literal can't break db.query_resources.
Position
Below the diagonal: db.execution.interpreter.count.literal 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.
db.index_lifecycle.model uses helix_ast.index, so a change to helix_ast.index can break db.index_lifecycle.model, while a change to db.index_lifecycle.model can't break helix_ast.index.
Position
Below the diagonal: db.index_lifecycle.model uses a module listed above it, which is the healthy direction.
15→23 helix_ast.query uses db.cypherpart of a loop✕
Connections
1 pair of types, where a type in helix_ast.query uses a type in db.cypher.
The types involved
helix_ast.query.QueryError → db.cypher.Error
Direction
helix_ast.query uses db.cypher, so a change to db.cypher can break helix_ast.query, while a change to helix_ast.query can't break db.cypher.
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_graph_algorithms.model uses helix_ast_arena_derive.model, so a change to helix_ast_arena_derive.model can break helix_graph_algorithms.model, while a change to helix_graph_algorithms.model can't break helix_ast_arena_derive.model.
Position
Below the diagonal: helix_graph_algorithms.model uses a module listed above it, which is the healthy direction.
helix_graph_algorithms.model uses helix_db_testkit.action, so a change to helix_db_testkit.action can break helix_graph_algorithms.model, while a change to helix_graph_algorithms.model can't break helix_db_testkit.action.
Position
Below the diagonal: helix_graph_algorithms.model uses a module listed above it, which is the healthy direction.
helix_graph_algorithms.model uses helix_planner.relational.query, so a change to helix_planner.relational.query can break helix_graph_algorithms.model, while a change to helix_graph_algorithms.model can't break helix_planner.relational.query.
Position
Below the diagonal: helix_graph_algorithms.model uses a module listed above it, which is the healthy direction.
helix_planner.catalog.property uses helix_ast.index, so a change to helix_ast.index can break helix_planner.catalog.property, while a change to helix_planner.catalog.property can't break helix_ast.index.
Position
Below the diagonal: helix_planner.catalog.property 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.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.logical.access.path uses helix_db_testkit.action, so a change to helix_db_testkit.action can break helix_planner.logical.access.path, while a change to helix_planner.logical.access.path can't break helix_db_testkit.action.
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.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.properties.delivered uses helix_db_testkit.action, so a change to helix_db_testkit.action can break helix_planner.properties.delivered, while a change to helix_planner.properties.delivered can't break helix_db_testkit.action.
Position
Below the diagonal: helix_planner.properties.delivered uses a module listed above it, which is the healthy direction.
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.cypher uses db.execution.interpreter.count.literal, so a change to db.execution.interpreter.count.literal can break db.cypher, while a change to db.cypher can't break db.execution.interpreter.count.literal.
Position
Below the diagonal: db.cypher 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_ast.value uses helix_ast.expr, so a change to helix_ast.expr can break helix_ast.value, while a change to helix_ast.value can't break helix_ast.expr.
Position
Below the diagonal: helix_ast.value uses a module listed above it, which is the healthy direction.
helix_ast.value uses helix_ast.query, so a change to helix_ast.query can break helix_ast.value, while a change to helix_ast.value can't break helix_ast.query.
Position
Below the diagonal: helix_ast.value 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.
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.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.
helix_planner.relational.value uses db.execution.interpreter.count.literal, so a change to db.execution.interpreter.count.literal can break helix_planner.relational.value, while a change to helix_planner.relational.value can't break db.execution.interpreter.count.literal.
Position
Below the diagonal: helix_planner.relational.value 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.
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_ast_arena_derive.model, so a change to helix_ast_arena_derive.model can break db.search.text, while a change to db.search.text can't break helix_ast_arena_derive.model.
Position
Below the diagonal: db.search.text uses a module listed above it, which is the healthy direction.
db.search.text uses helix_graph_algorithms.model, so a change to helix_graph_algorithms.model can break db.search.text, while a change to db.search.text can't break helix_graph_algorithms.model.
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 helix_ast.value, so a change to helix_ast.value can break db.search.text, while a change to db.search.text can't break helix_ast.value.
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.
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_ast.traversal uses helix_ast.index, so a change to helix_ast.index can break helix_ast.traversal, while a change to helix_ast.traversal can't break helix_ast.index.
Position
Below the diagonal: helix_ast.traversal uses a module listed above it, which is the healthy direction.
helix_ast.traversal uses helix_ast.value, so a change to helix_ast.value can break helix_ast.traversal, while a change to helix_ast.traversal can't break helix_ast.value.
Position
Below the diagonal: helix_ast.traversal 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.
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.
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.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.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.index_lifecycle.secondary uses helix_ast.value, so a change to helix_ast.value can break db.index_lifecycle.secondary, while a change to db.index_lifecycle.secondary can't break helix_ast.value.
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.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.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.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.
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 db.execution.interpreter.count.literal, so a change to db.execution.interpreter.count.literal can break helix_planner.relational.planning, while a change to helix_planner.relational.planning can't break db.execution.interpreter.count.literal.
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_ast.query, so a change to helix_ast.query can break helix_planner.relational.planning, while a change to helix_planner.relational.planning can't break helix_ast.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_ast.value, so a change to helix_ast.value can break helix_planner.relational.planning, while a change to helix_planner.relational.planning can't break helix_ast.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_arena_derive.model, so a change to helix_ast_arena_derive.model can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break helix_ast_arena_derive.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_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.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.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.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.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 helix_ast.value, so a change to helix_ast.value can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break helix_ast.value.
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.value, so a change to helix_planner.relational.value can break db.execution.interpreter.runtime_context, while a change to db.execution.interpreter.runtime_context can't break helix_planner.relational.value.
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_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.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.
At a glance — Code Health · 67% · 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
180
High / Critical
A03:2025 — Software Supply Chain Failures
59
High / Critical
A02:2025 — Security Misconfiguration
12
High / Critical
A07:2025 — Authentication Failures
9
High / Critical
Roadmap
First, enforce a protected-by-default authorization model by implementing global authentication guards with explicit public opt-outs. Second, secure server transport by enabling TLS and enforcing HTTPS with HSTS headers, either directly or via a terminating proxy. Third, immediately resolve all leaked secrets in REDACTED and historical files like REDACTED. Finally, update the Rust toolchain to address the end-of-life runtime warning.
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.
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 — 1537
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 — 57
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 12
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 84 of 84 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 84 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, 1735 of 1761 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT READ here — but this repository measures it: a coverage step in CI (`cargo llvm-cov`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.rs, .py, .ts), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or `coverage run -m pytest` then `coverage xml`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or `coverage run -m pytest` then `coverage xml`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 6 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 617 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs, .py, .ts) and this repository declares a Cargo test suite (repository root, 973 test files), but it was not re-run: its build outgrew the 7 GB scratch ceiling (7.126 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming 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. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and 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.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via REDACTED (REDACTED). docker build failed (exit 1) — ------ REDACTED:1 -------------------- 1 | >>> # syntax=docker/dockerfile:1.7 2 | 3 | ARG RUST_IMAGE=rust:1.97.1-bookworm -------------------- ERROR: failed to solve: failed to resolve source metadata for docker.io/docker/dockerfile:1.7: failed to do request: Head "https://registry-1.docker.io/v2/docker/dockerfile/manifests/1.7": Forbidden; runtime evidence skipped.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check 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 — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads 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 — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). 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.
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
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
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 is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
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: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
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.
185 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was db::execution::interpreter::pull::poll::step at 104. A further 64 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 88 — 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 88), 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 53), 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.
+ 81 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.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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.
+ 115 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.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 81 FunctionTooLong finding(s) in God Classes — start with mod.rs (14), contracts.rs (10), vector_retirement.rs (4). — One of this dimension's main actionable groups (81 warning-level).
Resolve the 75 FileTooLong finding(s) in God Classes — start with mod.rs (9), count.rs (2), driver.rs (2). — One of this dimension's main actionable groups (75 warning-level).
Resolve the 59 MethodTooLong finding(s) in God Classes — start with mod.rs (7), count.rs (6), search.rs (2). — One of this dimension's main actionable groups (59 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
523 duplicated block group(s) detected. A further 24 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 3 of the 547 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.
+ 125 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 35 Duplicated block (12 lines × 2) finding(s) in Code Duplication — start with mod.rs (7), contracts.rs (3), lib.rs (2). — One of this dimension's main actionable groups (35 warning-level).
Resolve the 35 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with scope_gate.rs (2), analyze.rs (2), cardinality.rs (2). — One of this dimension's main actionable groups (35 warning-level).
Resolve the 35 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with mod.rs (4), edge.rs (3), property_value.rs (2). — One of this dimension's main actionable groups (35 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · 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).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 6 Low cohesion finding(s) in Cohesion (LCOM4) — start with db.rs, json.rs, indexes.rs. — One of this dimension's main actionable groups (6 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
6136 test methods: 5377 unit, 742 integration, 0 BDD, 17 e2e. The JavaScript/TypeScript suite contributes 6 `it`/`test` case(s) across 1 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 5918 `#[test]` function(s) across 973 file(s) declaring at least one; its unit/integration split is Cargo's own — 114 of those file(s) are integration-test targets under a crate's tests/ directory, and the rest are #[test] functions compiled into the crate they test. The Python suite contributes 156 test function(s) across 18 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only. The Go suite contributes 56 test case(s) across 6 `_test.go` file(s) declaring at least one — every `func Test…(t *testing.T)` that `go test` would collect, plus the suite methods a testify-style runner reaches; a table-driven case list counts once, so this is a floor. Its tier split is INFERRED from file names, paths and build constraints, not declared: 1 of those file(s) use Go's external test package (`package x_test`), which is a visibility boundary rather than a pyramid tier and was not read as one.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test 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 617 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.
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 568 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 (74×16=1184) Repeated repair below the complexity floor: crates/cli/src/local_runtime.rs (32 of 47 changes were fixes); crates/db/src/search/text/cache.rs (13 of 18 changes were fixes); crates/planner/src/rules/access/filter/index/membership.rs (4 of 7 changes were fixes)
Resolve the 91 Hotspot finding(s) in Churn × Complexity Hotspots — start with mod.rs (8), count.rs (3), pipeline.rs (3). — One of this dimension's main actionable groups (91 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.2 / 10Strong✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
263 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is crates/db/src/migrations/mod.rs. Counted over 950 of the 1479 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 433070 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. 147 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
4 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.
7 finding(s): 0 critical, 7 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 7 REDACTED finding(s) in Secrets (history) — start with REDACTED (6), REDACTED. — One of this dimension's main actionable groups (7 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).
180 finding(s): 0 critical, 149 high, 29 medium, 2 low. 145 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 1246, line 1668, line 1749, …), `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 4 file(s) (e.g. a workflow `run:` block read as shell). Those files WERE scanned and their other rows are unaffected; only those rules' view of those snippets is missing.
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 3 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3). — One of this dimension's main actionable groups (3 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
No action in Static Analysis (SAST) — all 145 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 (145 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.
Resolve the 21 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (21). — One of this dimension's main actionable groups (21 warning-level).
Resolve the 16 Medium vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (16). — One of this dimension's main actionable groups (16 warning-level).
Resolve the 5 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (5). — One of this dimension's main actionable groups (5 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 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 951 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 951 of the 1479 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. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
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.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
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 repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
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.
Add an 'Architecture' / 'How it works' section to the root README — the high-level shape.
Add a README to the 11 of 24 project(s) that lack one — worth up to 0.9 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
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 README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
crates/server/README.md links to `../../docs/CLOUD_LAUNCH_TESTING.md`, but `docs/CLOUD_LAUNCH_TESTING.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — crates/server/README.md:39
What to do
Reconcile the README with reality: crates/server/README.md links to `../../docs/CLOUD_LAUNCH_TESTING.md`, but `docs/CLOUD_LAUNCH_TESTING.md` does not exist.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language 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 · Observability5.7 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 2/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`, `crates/metrics` and 2 more.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add OpenTelemetry tracing/metrics (opentelemetry with tracing-opentelemetry) so requests are traceable across the system, not just health-probable.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
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::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — crates/cli/src/cloud/client.rs:177
`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:359
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 the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
What to do
Raise allocation-aware density on the hot paths — currently 8 use(s) across 4,461 production line(s) (~1.8/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Go: on hot paths, reuse buffers and objects through sync.Pool, preallocate slices and maps with make([]T, 0, n) / make(map[K]V, n), size builders with Grow, append with strconv.Append*, and reslice with buf[:0] instead of allocating anew.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from the language model, a blocking call inside an async function (Python, TS/JS, Rust, Kotlin, 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.
What to do
Migrate the remaining .js/.jsx files to TypeScript.
React / JS · Code Health — Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm over JS/TS tokens, D-386): a block is reported only where its copies still agree on most of their own identifiers and literals, or were renamed as they were pasted but kept most of their constants, and where the copies carry enough code to stand on their own or the copied extent reaches 30 lines — so a re-implementation sharing neither names nor values, and a small pasted declaration, are both found and deliberately not reported, and a clean R10 is not a claim that nothing was copied.
Method: Near-exact copy-pasted blocks of substantial extent across the frontend (the D4 clone algorithm run over JS/TS tokens). Masking finds the candidates; a block is reported when its copies still agree on most of their own identifiers and literals, or when a renamed copy still agrees on most of its constants, AND the copies carry enough code to stand on their own — or when the copied extent reaches 30 lines. So a re-implementation sharing neither names nor values, and a small pasted declaration, are deliberately not counted. Deterministic.
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:330 — 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:251 — 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:341 · sdks/typescript/src/index.ts:357 — both copies are in the same file, so extract the 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:341
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:382 — 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:377 — 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:512 · sdks/typescript/src/index.ts:614 — 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:512
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:110
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
(anonymous) has cyclomatic complexity 13 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — sdks/typescript/scripts/parity/cypher-results.ts:44
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:580
(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
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
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 599 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.
What to do
Bump outdated dependencies to current versions to limit upgrade debt.
Do you agree with this assessment?
R6 · Tooling10.0 / 10Exemplary✓ Tool-verified
React / JS · Readiness — Whether the project wires up test, lint and typecheck — detected from each package.json script's COMMAND (eslint / tsc / vitest / jest / playwright), not just its name, and corroborated against CI-workflow invocations so a tool run only in CI still counts.
Method: package.json scanned for test/lint/typecheck script wiring. Deterministic presence check.
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.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document1.6 / 10Critical✓ Tool-verified
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
`stringifyJson` is exported, takes a document from its caller (line 69) and hands it to `encode`, which calls itself at line 11 (`encode`) with a piece of `value` (and at line 12, line 19) — and nowhere in `encode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `encode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/typescript/src/dsl.ts:11
`canonicalizeJson` is exported and takes `value: unknown` from its caller, and it calls itself at line 88 (`canonicalizeJson`) with a piece of `value` (and at line 93) — and nowhere in `canonicalizeJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonicalizeJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/typescript/src/dsl.ts:88
`stringifyJson` is exported, takes a document from its caller (line 69) and hands it to `stringifyEncoded`, which calls itself at line 175 (`stringifyEncoded`) with a piece of `value` (and at line 177, line 187, line 190) — and nowhere in `stringifyEncoded` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `stringifyEncoded` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/typescript/src/dsl.ts:175
`normalizeGraphIds` is exported, takes a document from its caller (line 148) and hands it to `mapWire`, which calls itself at line 134 (`mapWire`) with a piece of `value` — and nowhere in `mapWire` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `mapWire` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/typescript/scripts/parity/cypher-results.ts:134
`stringify_json` is public, takes a document from its caller (line 100) and hands it to `_encode`, which calls itself at line 38 (`_encode`) with a piece of `value` (and at line 46, line 50) — and nowhere in `_encode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_encode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/python/src/helixdb/dsl.py:38
`canonicalize_json` is public and takes `value: Any` from its caller, and it calls itself at line 118 (`canonicalize_json`) with a piece of `value` (and at line 120) — and nowhere in `canonicalize_json` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `canonicalize_json` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/python/src/helixdb/dsl.py:118
`insert_typed_parameter` is public, takes a document from its caller (line 3999) and hands it to `_validate_json_value`, which calls itself at line 3878 (`_validate_json_value`) with a piece of `value` (and at line 3885) — and nowhere in `_validate_json_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_validate_json_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/python/src/helixdb/dsl.py:3878
`insert_typed_parameter` is public, takes a document from its caller (line 3999) and hands it to `_normalize_typed_query_value`, which calls itself at line 3926 (`_normalize_typed_query_value`) with a piece of `value` — and nowhere in `_normalize_typed_query_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_normalize_typed_query_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack. — sdks/python/src/helixdb/dsl.py:3926
What to do
Each finding names the externally-callable member that accepts the document and the self-call that descends, and states that no depth parameter or counter exists anywhere in the walk. Confirm from the two, then thread a depth argument through the walk and reject documents past a fixed maximum, or rewrite it with an explicit stack.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. 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; 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:488, sdks/typescript/src/index.ts:580
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.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. 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.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×3) — sdks/typescript/src/index.ts:142, REDACTED:81, sdks/typescript/scripts/parity/run-helix.ts:309
What to do
Swallowed exception (empty catch)
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 5740 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.
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 — 25 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 — 51 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.
AC7 A11y enforcement — 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)
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:1 -------------------- 1 | >>> # syntax=docker/dockerfile:1.7 2 | 3 | ARG RUST_IMAGE=rust:1.97.1-bookworm -------------------- ERROR: failed to solve: failed to resolve source metadata for docker.io/docker/dockerfile:1.7: failed to do request: Head "https://registry-1.docker.io/v2/docker/dockerfile/manifests/1.7": 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.
D21 Naming Consistency — Naming consistency is measured on C# only; Go, JavaScript, Python, Rust, TypeScript not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. 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"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .go, .py, .rs, .ts, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — no ADRs to check
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 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.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
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 included — suite not readable by the collector
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 — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
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.
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.
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.
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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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:1004— 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 1004. 12 of those changes were fix/bug commits, and the other 48 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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:2963— crates/db/src/lib.rs changed 74 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 2963. 9 of those changes were fix/bug commits, and the other 65 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/execution/interpreter/count.rs crates/db/src/execution/interpreter/count.rs:1397— crates/db/src/execution/interpreter/count.rs changed 28 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 37 in ExecutionContext::count_cursor_leaf at line 1397. 2 of those changes were fix/bug commits, and the other 26 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/db/src/error.rs crates/db/src/error.rs:645— crates/db/src/error.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in HelixDbError::error_code at line 645. 3 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +00:00' --full-history --no-merges -- crates/db/src/error.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/repository.rs crates/db/src/index_lifecycle/repository.rs:454— crates/db/src/index_lifecycle/repository.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in db::index_lifecycle::repository::scoped_cursor_is_valid at line 454. 7 of those changes were fix/bug commits, and the other 20 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +00:00' --full-history --no-merges -- crates/db/src/index_lifecycle/repository.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: sdks/typescript/src/dsl.ts sdks/typescript/src/dsl.ts:1718— sdks/typescript/src/dsl.ts changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 86 in Step.toAst at line 1718. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +00:00' --full-history --no-merges -- sdks/typescript/src/dsl.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/planner/src/rules/cardinality.rs crates/planner/src/rules/cardinality.rs:1042— crates/planner/src/rules/cardinality.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in helix_planner::rules::cardinality::count_plan_cursor at line 1042. 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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: 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/cypher/src/bind.rs crates/cypher/src/bind.rs:82— crates/cypher/src/bind.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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: sdks/python/src/helixdb/dsl.py sdks/python/src/helixdb/dsl.py:2323— sdks/python/src/helixdb/dsl.py changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in Step.to_ast at line 2323. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +00:00' --full-history --no-merges -- sdks/python/src/helixdb/dsl.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/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 16 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. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/execution/interpreter/dispatch.rs crates/db/src/execution/interpreter/dispatch.rs:93— crates/db/src/execution/interpreter/dispatch.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in ExecutionContext::operation at line 93. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +00:00' --full-history --no-merges -- crates/db/src/execution/interpreter/dispatch.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: REDACTED REDACTED:1461— REDACTED changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 64 in Step.ToAST at line 1461. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +00:00' --full-history --no-merges -- REDACTED`: 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:154— crates/db/src/execution/interpreter/pull/source.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 33 in Source::open at line 154. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/migration_parity.rs crates/db/src/migration_parity.rs:983— crates/db/src/migration_parity.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in db::migration_parity::scan_v2_state at line 983. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +00:00' --full-history --no-merges -- crates/db/src/migration_parity.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:3069— 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 3069. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/cli/src/main.rs crates/cli/src/main.rs:578— crates/cli/src/main.rs changed 13 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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: scripts/validate-cargo-target-references.py scripts/validate-cargo-target-references.py:507— scripts/validate-cargo-target-references.py changed 10 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 507. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/db/src/index_lifecycle/text/driver.rs crates/db/src/index_lifecycle/text/driver.rs:1713— crates/db/src/index_lifecycle/text/driver.rs changed 13 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 1713. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/search/text/mod.rs crates/db/src/search/text/mod.rs:550— crates/db/src/search/text/mod.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in db::search::text::search_manifest_with_state_source at line 550. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +00:00' --full-history --no-merges -- crates/db/src/search/text/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/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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/index_lifecycle/outbox.rs crates/db/src/index_lifecycle/outbox.rs:1041— crates/db/src/index_lifecycle/outbox.rs changed 19 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 1041. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/planner/src/rules/contracts/applicability/known.rs crates/planner/src/rules/contracts/applicability/known.rs:6— crates/planner/src/rules/contracts/applicability/known.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in helix_planner::rules::contracts::applicability::known::for_known_rule at line 6. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +00:00' --full-history --no-merges -- crates/planner/src/rules/contracts/applicability/known.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.
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:1857— 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:1713— 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 54) crates/db/src/index_lifecycle/secondary.rs:1004— db::index_lifecycle::secondary::scan_source has cognitive complexity 54 (threshold 15). Drivers by points: if/else 14 (26 pts), match/switch 8 (17 pts), loops 5 (10 pts), boolean chains 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db::index_lifecycle::vector::driver::step_cleanup (cognitive 54) crates/db/src/index_lifecycle/vector/driver.rs:1314— 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:3337— 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::text::driver::scan_source (cognitive 46) crates/db/src/index_lifecycle/text/driver.rs:2473— 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:768— 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:136— 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::migration_parity::scan_v2_state (cognitive 40) crates/db/src/migration_parity.rs:983— db::migration_parity::scan_v2_state has cognitive complexity 40 (threshold 15). Drivers by points: if/else 9 (26 pts), match/switch 3 (7 pts), boolean chains 4, loops 3 (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.
db::index_lifecycle::secondary::delete_generation_rows (cognitive 39) crates/db/src/index_lifecycle/secondary.rs:1886— 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:4331— 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::index_lifecycle::secondary::catch_up_exact (cognitive 37) crates/db/src/index_lifecycle/secondary.rs:1424— db::index_lifecycle::secondary::catch_up_exact has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 4 (10 pts), loops 4 (5 pts), boolean chains 4 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
db::migrations::vector_retirement::release_reservations_batch (cognitive 37) crates/db/src/migrations/vector_retirement.rs:778— 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::exact::run_production_contracts (cognitive 35) crates/db/src/index_lifecycle/secondary/exact.rs:665— db::index_lifecycle::secondary::exact::run_production_contracts has cognitive complexity 35 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 8 (13 pts), match/switch 2 (5 pts), boolean chains 1 (nesting depth added 18). Of this number, 25 points are the body's own statements and 10 belong to one function item inside it that branches. 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.
db::migrations::vector_retirement::delete_core_batch (cognitive 34) crates/db/src/migrations/vector_retirement.rs:533— 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:137— 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::secondary::reconciliation_plan_from_observations (cognitive 30) crates/db/src/index_lifecycle/secondary.rs:2453— db::index_lifecycle::secondary::reconciliation_plan_from_observations has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (29 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:1546— FunctionTooLong — db::index_lifecycle_testing::contracts::run_secondary_mutation_interleaving runs 416 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 316 over it, 4.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.
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:1713— 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::secondary::exact::run_production_contracts crates/db/src/index_lifecycle/secondary/exact.rs:665— FunctionTooLong — db::index_lifecycle::secondary::exact::run_production_contracts runs 360 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 260 over it, 3.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::index_lifecycle::text::driver::scan_source crates/db/src/index_lifecycle/text/driver.rs:2473— 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::migrations::production_contracts::run_vector_adoption_contract crates/db/src/migrations/mod.rs:6168— FunctionTooLong — db::migrations::production_contracts::run_vector_adoption_contract runs 281 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 181 over it, 2.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: 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:1857— FunctionTooLong — db::migrations::preflight_legacy_vector_reservations runs 270 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 170 over it, 2.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::index_lifecycle::text::active_batch::prepare_destination crates/db/src/index_lifecycle/text/active_batch.rs:810— 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::migration_parity::scan_v2_state crates/db/src/migration_parity.rs:983— FunctionTooLong — db::migration_parity::scan_v2_state runs 245 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 145 over it, 2.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
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::secondary::scan_source crates/db/src/index_lifecycle/secondary.rs:1004— FunctionTooLong — db::index_lifecycle::secondary::scan_source runs 223 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 123 over it, 2.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: db::index_lifecycle::text::driver::prepare_compaction_step crates/db/src/index_lifecycle/text/driver.rs:1161— 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::migrations::production_contracts::run_vector_ineligible_contracts crates/db/src/migrations/mod.rs:6866— FunctionTooLong — db::migrations::production_contracts::run_vector_ineligible_contracts 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::outbox::execute_claimed_step_with_evidence crates/db/src/index_lifecycle/outbox.rs:1041— FunctionTooLong — db::index_lifecycle::outbox::execute_claimed_step_with_evidence runs 205 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 105 over it, 2.05× 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:1424— 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::migrations::production_contracts::prepare_vector_recovery crates/db/src/migrations/mod.rs:8100— FunctionTooLong — db::migrations::production_contracts::prepare_vector_recovery 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:31— 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: 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.
FileTooLong: migrations/mod.rs crates/db/src/migrations/mod.rs— FileTooLong — 5837 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 5337 over it, 11.67× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: interpreter/count.rs crates/db/src/execution/interpreter/count.rs— FileTooLong — 4165 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 3665 over it, 8.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: index_lifecycle_testing/contracts.rs crates/db/src/index_lifecycle_testing/contracts.rs— FileTooLong — 3973 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 87 free functions. The bar is 500 significant lines; this is 3473 over it, 7.95× 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 — 3315 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2815 over it, 6.63× 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 — 3061 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 43 free functions. The bar is 500 significant lines; this is 2561 over it, 6.12× 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 — 2820 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 2320 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: mutation/mod.rs crates/db/src/search/vector/hnsw/mutation/mod.rs— FileTooLong — 2728 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 2228 over it, 5.46× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/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: src/lib.rs crates/db/src/lib.rs— FileTooLong — 2434 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 1934 over it, 4.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: 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 — 2101 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 1601 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: search/mod.rs crates/db/src/search/mod.rs— FileTooLong — 2101 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 1601 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: 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 — 1712 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 1212 over it, 3.42× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: 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 — 1380 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 880 over it, 2.76× 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 — 1363 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 863 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/local_runtime.rs crates/cli/src/local_runtime.rs— FileTooLong — 1275 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 775 over it, 2.55× 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: src/migration_parity.rs crates/db/src/migration_parity.rs— FileTooLong — 1197 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 697 over it, 2.39× 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: access/indexes.rs crates/db/src/execution/interpreter/access/indexes.rs— FileTooLong — 1194 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 694 over it, 2.39× 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 — 1160 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 660 over it, 2.32× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: 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.
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: 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:1397— 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:923— 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:1753— 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: 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: 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.
MethodTooLong: Step.toAst sdks/typescript/src/dsl.ts:1718— MethodTooLong — toAst runs 150 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LifecycleTestController.install_donor_split_for_search_race crates/db/src/index_lifecycle_testing.rs:1341— MethodTooLong — install_donor_split_for_search_race runs 147 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 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: OracleState.read_indexed crates/db-testkit/src/model.rs:653— MethodTooLong — read_indexed runs 140 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
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:1857— 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:1713— 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:1004— 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:2473— 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:1314— 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::migration_parity::scan_v2_state (cyclomatic 26) crates/db/src/migration_parity.rs:983— db::migration_parity::scan_v2_state 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:31— 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::catch_up_exact (cyclomatic 22) crates/db/src/index_lifecycle/secondary.rs:1424— db::index_lifecycle::secondary::catch_up_exact 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::index_lifecycle::secondary::secondary_range_scan_bounds (cyclomatic 22) crates/db/src/index_lifecycle/secondary.rs:3337— 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:3167— 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. This is NOT this file's highest cyclomatic complexity: MigrationFailpoint::as_str (cyclomatic 42) 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.
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:1886— 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::vector::driver::plan_and_apply (cyclomatic 21) crates/db/src/index_lifecycle/vector/driver.rs:3069— 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:578— 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.
Duplicated block (12 lines × 2) crates/db-testkit/src/lifecycle_workload.rs:538— crates/db-testkit/src/lifecycle_workload.rs:538-549 | crates/db-testkit/src/lifecycle_workload.rs:555-566 — both copies are in the same file, so extract the block into 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-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.
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.
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.
Duplicated block (12 lines × 2) crates/db/src/execution/interpreter/storage.rs:228— crates/db/src/execution/interpreter/storage.rs:228-239 | 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.
Duplicated block (12 lines × 2) crates/db/src/index_lifecycle/queue/publication.rs:1018— crates/db/src/index_lifecycle/queue/publication.rs:1018-1029 | crates/db/src/index_lifecycle/queue/publication.rs:1286-1297 — both copies are in the same file, so extract the block into 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/index_lifecycle/repository.rs:184— crates/db/src/index_lifecycle/repository.rs:184-195 | crates/db/src/migrations/startup/bootstrap.rs:326-337 — 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 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) crates/db/src/index_lifecycle/secondary.rs:430— crates/db/src/index_lifecycle/secondary.rs:430-441 | crates/db/src/index_lifecycle/secondary.rs:444-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/db/src/index_lifecycle/text/active_batch.rs:1225— crates/db/src/index_lifecycle/text/active_batch.rs:1225-1236 | crates/db/src/index_lifecycle/text/active_batch.rs:1303-1314 — both copies are in the same file, so extract the block into 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/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.
Duplicated block (12 lines × 2) crates/db/src/index_lifecycle/text/statistics.rs:779— crates/db/src/index_lifecycle/text/statistics.rs:779-790 | crates/db/src/index_lifecycle/text/statistics.rs:1043-1054 — both copies are in the same file, so extract the block into 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/index_lifecycle/vector/driver.rs:1800— crates/db/src/index_lifecycle/vector/driver.rs:1800-1811 | crates/db/src/index_lifecycle/vector/driver.rs:1827-1838 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) crates/db/src/index_lifecycle_testing.rs:1263— crates/db/src/index_lifecycle_testing.rs:1263-1274 | crates/db/src/index_lifecycle_testing.rs:1447-1458 — both copies are in the same file, so extract the block into 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/migration_parity.rs:334— crates/db/src/migration_parity.rs:334-345 | crates/db/src/migration_parity.rs:384-395 — both copies are in the same file, so extract the block into 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/migrations/vector_retirement.rs:387— crates/db/src/migrations/vector_retirement.rs:387-398 | crates/db/src/migrations/vector_retirement.rs:757-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.
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.
Duplicated block (12 lines × 2) crates/db/src/search/mod.rs:1611— crates/db/src/search/mod.rs:1611-1622 | crates/db/src/search/mod.rs:1682-1693 — both copies are in the same file, so extract the block into 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:1625— crates/db/src/search/mod.rs:1625-1636 | crates/db/src/search/mod.rs:1696-1707 — both copies are in the same file, so extract the block into 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:1746— crates/db/src/search/mod.rs:1746-1757 | crates/db/src/search/mod.rs:1782-1793 — both copies are in the same file, so extract the block into 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/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.
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.
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.
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.
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:338— crates/server/src/lib.rs:338-349 | crates/server/src/lib.rs:355-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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.
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.
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.
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.
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.
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:467-473 — both copies are in the same file, so extract the block into 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/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.
Duplicated block (7 lines × 2) crates/db/src/index_lifecycle/queue/publication.rs:1152— crates/db/src/index_lifecycle/queue/publication.rs:1152-1158 | crates/db/src/index_lifecycle/queue/publication.rs:1735-1741 — both copies are in the same file, so extract the block into 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/db/src/index_lifecycle/scope_gate.rs:148— crates/db/src/index_lifecycle/scope_gate.rs:148-154 | crates/db/src/index_lifecycle/scope_gate.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.
Duplicated block (7 lines × 2) crates/db/src/index_lifecycle/scope_gate.rs:162— crates/db/src/index_lifecycle/scope_gate.rs:162-168 | crates/db/src/index_lifecycle/scope_gate.rs:176-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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.
Duplicated block (7 lines × 2) crates/db/src/search/text/mod.rs:396— crates/db/src/search/text/mod.rs:396-402 | crates/db/src/search/text/mod.rs:416-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.
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.
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.
Duplicated block (7 lines × 2) crates/planner/src/diagnostics/analyze.rs:704— crates/planner/src/diagnostics/analyze.rs:704-710 | crates/planner/src/diagnostics/analyze.rs:901-907 — both copies are in the same file, so extract the block into 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/planner/src/diagnostics/analyze.rs:714— crates/planner/src/diagnostics/analyze.rs:714-720 | crates/planner/src/diagnostics/analyze.rs:959-965 — both copies are in the same file, so extract the block into 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/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.
Duplicated block (7 lines × 2) crates/planner/src/ir/input/search/text.rs:106— crates/planner/src/ir/input/search/text.rs:106-112 | crates/planner/src/ir/input/search/vector.rs:209-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.
Duplicated block (7 lines × 2) crates/planner/src/planning/selected/native/family.rs:96— crates/planner/src/planning/selected/native/family.rs:96-102 | crates/planner/src/planning/selected/native/pipeline/ops.rs:43-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/server/src/lib.rs:329— crates/server/src/lib.rs:329-335 | crates/server/src/lib.rs:347-353 — both copies are in the same file, so extract the block into 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/db-testkit/src/lifecycle.rs:117— crates/db-testkit/src/lifecycle.rs:117-123 | crates/db/src/index_lifecycle/catalog.rs:157-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.
Duplicated block (7 lines × 2) crates/db/src/encoding/v2/keys/indexes/direction.rs:13— crates/db/src/encoding/v2/keys/indexes/direction.rs:13-19 | crates/db/src/encoding/v2/keys/indexes/equality/edge.rs:23-29 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) crates/db/src/index_lifecycle/outbox.rs:511— crates/db/src/index_lifecycle/outbox.rs:511-517 | crates/db/src/index_lifecycle/vector/driver.rs:1089-1095 — 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-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.
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.
Duplicated block (6 lines × 2) crates/db/src/encoding/v2/values/property/property_value.rs:330— crates/db/src/encoding/v2/values/property/property_value.rs:330-335 | crates/planner/src/analysis/scalar/values.rs:174-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 67 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/encoding/v2/values/property/property_value.rs:339— crates/db/src/encoding/v2/values/property/property_value.rs:339-344 | crates/planner/src/analysis/scalar/values.rs:182-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 67 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/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.
Duplicated block (6 lines × 2) crates/db/src/execution/interpreter/rows/bound_match.rs:102— crates/db/src/execution/interpreter/rows/bound_match.rs:102-107 | crates/db/src/execution/interpreter/rows/correlated.rs:123-128 — 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/execution/interpreter/stream/order.rs:21— crates/db/src/execution/interpreter/stream/order.rs:21-26 | crates/db/src/execution/interpreter/stream/projection/rows.rs:166-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.
Duplicated block (6 lines × 2) crates/db/src/execution/interpreter/stream/projection/rows.rs:85— crates/db/src/execution/interpreter/stream/projection/rows.rs:85-90 | crates/db/src/execution/interpreter/stream/projection/rows.rs:136-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 (6 lines × 2) crates/db/src/index_lifecycle/secondary.rs:2047— crates/db/src/index_lifecycle/secondary.rs:2047-2052 | crates/db/src/index_lifecycle/vector/driver.rs:1907-1912 — 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 83 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/index_lifecycle/text/active_batch.rs:1097— crates/db/src/index_lifecycle/text/active_batch.rs:1097-1103 | crates/db/src/index_lifecycle/text/driver.rs:2647-2652 — 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/index_lifecycle/text/driver.rs:1079— crates/db/src/index_lifecycle/text/driver.rs:1079-1084 | crates/db/src/index_lifecycle/text/driver.rs:1408-1413 — both copies are in the same file, so extract the block into 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/lib.rs:2011— crates/db/src/lib.rs:2011-2016 | crates/db/src/lib.rs:2058-2063 — both copies are in the same file, so extract the block into 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/migrations/tenant/envelope.rs:75— crates/db/src/migrations/tenant/envelope.rs:75-80 | crates/db/src/migrations/tenant/envelope.rs:159-164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) crates/db/src/search/vector/hnsw/mutation/mod.rs:1427— crates/db/src/search/vector/hnsw/mutation/mod.rs:1427-1432 | crates/db/src/search/vector/hnsw/mutation/mod.rs:1453-1458 — both copies are in the same file, so extract the block into 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/spaces/simple_sse.rs:32— crates/db/src/search/vector/spaces/simple_sse.rs:32-37 | crates/db/src/search/vector/spaces/simple_sse.rs:84-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.
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.
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.
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.
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.
Duplicated block (6 lines × 2) crates/db/src/config/indexes.rs:705— crates/db/src/config/indexes.rs:705-710 | 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.
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 (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.
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.
Duplicated block (11 lines × 2) crates/db/src/execution/interpreter/mutation/edge.rs:235— crates/db/src/execution/interpreter/mutation/edge.rs:235-245 | crates/db/src/execution/interpreter/mutation/node.rs:140-150 — 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 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.
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.
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.
Duplicated block (11 lines × 2) crates/db/src/index_lifecycle/queue/publication.rs:1256— crates/db/src/index_lifecycle/queue/publication.rs:1256-1266 | crates/db/src/index_lifecycle/queue/publication.rs:1818-1828 — both copies are in the same file, so extract the block into 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/index_lifecycle/secondary.rs:399— crates/db/src/index_lifecycle/secondary.rs:399-409 | crates/db/src/index_lifecycle/secondary.rs:1200-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.
Duplicated block (11 lines × 2) crates/db/src/index_lifecycle/secondary.rs:1697— crates/db/src/index_lifecycle/secondary.rs:1697-1707 | crates/db/src/index_lifecycle/vector/driver.rs:3571-3581 — 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 83 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_compaction.rs:444— crates/db/src/index_lifecycle/text/active_compaction.rs:444-454 | 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.
Duplicated block (11 lines × 2) crates/db/src/index_lifecycle/text/driver.rs:2544— crates/db/src/index_lifecycle/text/driver.rs:2544-2554 | crates/db/src/index_lifecycle/text/driver.rs:2657-2667 — both copies are in the same file, so extract the block into 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/index_lifecycle/vector/driver.rs:1684— crates/db/src/index_lifecycle/vector/driver.rs:1684-1694 | crates/db/src/index_lifecycle/vector/driver.rs:1789-1799 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/db/src/index_lifecycle/work.rs:419— crates/db/src/index_lifecycle/work.rs:419-429 | crates/db/src/index_lifecycle/work.rs:456-466 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/db/src/lib.rs:1225— crates/db/src/lib.rs:1225-1235 | crates/db/src/lib.rs:1505-1515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) crates/planner/src/exec/lowering/secondary_set.rs:154— crates/planner/src/exec/lowering/secondary_set.rs:154-164 | crates/planner/src/exec/lowering/secondary_set.rs:209-219 — both copies are in the same file, so extract the block into 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.
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 4 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.
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.
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.
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.
Duplicated block (11 lines × 2) crates/db/src/search/vector/storage/mod.rs:1514— crates/db/src/search/vector/storage/mod.rs:1514-1524 | crates/db/src/search/vector/storage/mod.rs:1568-1579 — both copies are in the same file, so extract the block into 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/encoding/v2/keys/graph.rs:191— crates/db/src/encoding/v2/keys/graph.rs:191-202 | crates/db/src/encoding/v2/legacy/edge_property_pair.rs:43-53 — 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.
Duplicated block (11 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:3874— crates/db/src/index_lifecycle_testing/contracts.rs:3874-3884 | crates/db/src/index_lifecycle_testing/contracts.rs:3907-3917 — both copies are in the same file, so extract the block into 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/search/vector/storage/mod.rs:591— crates/db/src/search/vector/storage/mod.rs:591-601 | crates/db/src/search/vector/storage/mod.rs:627-637 — both copies are in the same file, so extract the block into 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/migrations/mod.rs:6171— crates/db/src/migrations/mod.rs:6171-6181 | crates/db/src/migrations/mod.rs:8473-8483 — both copies are in the same file, so extract the block into 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/ast/src/testing/variants.rs:648— crates/ast/src/testing/variants.rs:648-657 | 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 67 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/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.
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.
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.
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.
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.
Duplicated block (10 lines × 2) crates/db/src/execution/interpreter/count.rs:2294— crates/db/src/execution/interpreter/count.rs:2294-2303 | 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/mod.rs:276— crates/db/src/execution/interpreter/mod.rs:276-285 | crates/planner/src/diagnostics/analyze.rs:945-954 — 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/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.
Duplicated block (10 lines × 2) crates/db/src/execution/interpreter/storage.rs:204— crates/db/src/execution/interpreter/storage.rs:204-213 | 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:1511— crates/db/src/index_lifecycle/outbox.rs:1511-1520 | crates/db/src/index_lifecycle/outbox.rs:1744-1753 — both copies are in the same file, so extract the block into 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.
Duplicated block (10 lines × 2) crates/db/src/index_lifecycle/vector/driver.rs:1715— crates/db/src/index_lifecycle/vector/driver.rs:1715-1724 | crates/db/src/index_lifecycle/vector/driver.rs:1840-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.
Duplicated block (10 lines × 2) crates/db/src/index_lifecycle/vector/driver.rs:2395— crates/db/src/index_lifecycle/vector/driver.rs:2395-2404 | crates/db/src/index_lifecycle/vector/driver.rs:2623-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.
Duplicated block (10 lines × 2) crates/db/src/migrations/mod.rs:5593— crates/db/src/migrations/mod.rs:5593-5603 | crates/db/src/migrations/mod.rs:8519-8528 — both copies are in the same file, so extract the block into 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:1436— crates/db/src/search/mod.rs:1436-1445 | crates/db/src/search/mod.rs:1476-1485 — both copies are in the same file, so extract the block into 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:1639— crates/db/src/search/mod.rs:1639-1648 | crates/db/src/search/mod.rs:1710-1719 — both copies are in the same file, so extract the block into 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:2023— crates/db/src/search/mod.rs:2023-2032 | crates/db/src/search/mod.rs:2044-2053 — both copies are in the same file, so extract the block into 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.
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.
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.
Duplicated block (10 lines × 2) crates/db/src/merge_operator.rs:193— crates/db/src/merge_operator.rs:193-202 | crates/db/src/needed_in_future/merge_operator.rs:41-50 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (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.
Duplicated block (10 lines × 2) crates/db/src/migrations/vector_retirement.rs:115— crates/db/src/migrations/vector_retirement.rs:115-126 | crates/db/src/migrations/vector_retirement.rs:702-711 — both copies are in the same file, so extract the block into 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/cli/src/local_runtime.rs:1218— crates/cli/src/local_runtime.rs:1218-1226 | crates/cli/src/local_runtime.rs:1243-1251 — both copies are in the same file, so extract the block into 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.
Duplicated block (9 lines × 2) crates/db/src/execution/interpreter/access/search/storage.rs:436— crates/db/src/execution/interpreter/access/search/storage.rs:436-444 | crates/db/src/migration_parity.rs:609-617 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) crates/db/src/execution/interpreter/storage.rs:207— crates/db/src/execution/interpreter/storage.rs:207-215 | crates/db/src/execution/interpreter/storage.rs:335-343 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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:369-377 — both copies are in the same file, so extract the block into 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/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:1029— crates/db/src/index_lifecycle/text/driver.rs:1029-1037 | crates/db/src/index_lifecycle/text/driver.rs:1341-1349 — both copies are in the same file, so extract the block into 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:3176— crates/db/src/index_lifecycle_testing/contracts.rs:3176-3184 | crates/db/src/index_lifecycle_testing/contracts.rs:3208-3216 — both copies are in the same file, so extract the block into 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/migrations/startup/bootstrap.rs:141— crates/db/src/migrations/startup/bootstrap.rs:141-149 | crates/db/src/migrations/startup/bootstrap.rs:224-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/db/src/search/mod.rs:779— crates/db/src/search/mod.rs:779-787 | crates/db/src/search/mod.rs:2372-2380 — both copies are in the same file, so extract the block into 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/search/mod.rs:1136— crates/db/src/search/mod.rs:1136-1144 | crates/db/src/search/mod.rs:1146-1154 — both copies are in the same file, so extract the block into 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/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.
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.
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.
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.
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.
Duplicated block (9 lines × 2) crates/planner/src/rules/access/filter/index/edge.rs:112— crates/planner/src/rules/access/filter/index/edge.rs:112-120 | crates/planner/src/rules/access/filter/index/node.rs:112-120 — 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/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:3484— crates/db/src/index_lifecycle_testing/contracts.rs:3484-3492 | crates/db/src/index_lifecycle_testing/contracts.rs:3572-3586 — both copies are in the same file, so extract the block into 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/secondary/exact/unique.rs:102— crates/db/src/index_lifecycle/secondary/exact/unique.rs:102-112 | crates/db/src/index_lifecycle/secondary/exact/unique.rs:167-175 — both copies are in the same file, so extract the block into 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/search/vector/storage/mod.rs:1055— crates/db/src/search/vector/storage/mod.rs:1055-1063 | crates/db/src/search/vector/storage/mod.rs:1130-1139 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) crates/db/src/execution/interpreter/access/params.rs:76— crates/db/src/execution/interpreter/access/params.rs:76-84 | crates/db/src/execution/interpreter/access/params.rs:93-101 — both copies are in the same file, so extract the block into 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/planner/src/rules/access/sets/equality_range/intersection/edge.rs:76— crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:76-84 | crates/planner/src/rules/access/sets/equality_range/intersection/node.rs:76-84 — 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 4 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.
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.
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.
Duplicated block (8 lines × 2) crates/db/src/migrations/mod.rs:6707— crates/db/src/migrations/mod.rs:6707-6715 | crates/db/src/migrations/mod.rs:6970-6977 — both copies are in the same file, so extract the block into 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/db/src/search/vector/spaces/simple_avx.rs:255— crates/db/src/search/vector/spaces/simple_avx.rs:255-262 | crates/db/src/search/vector/spaces/simple_avx.rs:293-300 — both copies are in the same file, so extract the block into 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/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.
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.
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.
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/pipeline/membership.rs:240— crates/planner/src/rules/access/pipeline/membership.rs:240-247 | crates/planner/src/rules/access/pipeline/support/empty.rs:29-36 — 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/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.
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:1509— crates/planner/src/rules/cardinality.rs:1509-1516 | crates/planner/src/rules/cardinality.rs:1586-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.
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.
Duplicated block (8 lines × 2) crates/server/src/diagnostics/mod.rs:897— crates/server/src/diagnostics/mod.rs:897-904 | crates/server/src/diagnostics/mod.rs:997-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.
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.
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.
Duplicated block (8 lines × 2) crates/db/src/migrations/mod.rs:5711— crates/db/src/migrations/mod.rs:5711-5722 | crates/db/src/migrations/mod.rs:7356-7363 — both copies are in the same file, so extract the block into 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/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.
Duplicated block (8 lines × 2) crates/db/src/index_lifecycle/failpoints.rs:196— crates/db/src/index_lifecycle/failpoints.rs:196-203 | crates/db/src/migrations/indexes/equality_bitmap.rs:143-152 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (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.
Duplicated block (8 lines × 2) crates/db/src/index_lifecycle/text/driver.rs:906— crates/db/src/index_lifecycle/text/driver.rs:906-913 | crates/db/src/index_lifecycle/text/driver.rs:1173-1180 — both copies are in the same file, so extract the block into 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/db/src/search/text/split.rs:373— crates/db/src/search/text/split.rs:373-380 | crates/db/src/search/text/split.rs:509-516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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.
Duplicated block (8 lines × 2) crates/db/src/index_lifecycle/secondary.rs:1718— crates/db/src/index_lifecycle/secondary.rs:1718-1725 | crates/db/src/index_lifecycle/vector/driver.rs:3592-3599 — 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 83 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.
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::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::update_rows (cognitive 55) crates/db/src/execution/interpreter/rows/mutations.rs:175— ExecutionContext::update_rows has cognitive complexity 55 (threshold 15). Drivers by points: if/else 9 (25 pts), match/switch 5 (18 pts), loops 4 (11 pts), boolean chains 1 (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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 36) crates/db/src/execution/interpreter/rows/mutations.rs:42— ExecutionContext::create_rows has cognitive complexity 36 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 6 (13 pts), match/switch 2 (8 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.
ExecutionContext::delete_rows (cognitive 35) crates/db/src/execution/interpreter/rows/mutations.rs:331— 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::search_vector_index_with_candidates (cognitive 22) crates/db/src/execution/interpreter/access/search/storage.rs:69— ExecutionContext::search_vector_index_with_candidates has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11, match/switch 8 (11 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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::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::count_cursor_leaf (cognitive 18) crates/db/src/execution/interpreter/count.rs:1397— 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::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.
ExecutionContext::top_k_batches (cognitive 16) crates/db/src/execution/interpreter/rows/top_k.rs:15— ExecutionContext::top_k_batches has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 2 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ExecutionContext::aggregate (cognitive 16) crates/db/src/execution/interpreter/stream/aggregate.rs:36— ExecutionContext::aggregate has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 1 (4 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.
ExecutionContext::project_edge_properties (cognitive 16) crates/db/src/execution/interpreter/stream/projection/rows.rs:270— ExecutionContext::project_edge_properties has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (5 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.
Duplicated block (5 lines × 2) crates/db-testkit/src/model.rs:991— crates/db-testkit/src/model.rs:991-995 | crates/value-semantics/src/lib.rs:113-117 — 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/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.
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.
Duplicated block (5 lines × 2) crates/db/src/encoding/v2/values/property/property_value.rs:223— crates/db/src/encoding/v2/values/property/property_value.rs:223-227 | crates/planner/src/analysis/scalar/values.rs:189-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 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/db/src/index_lifecycle/repository.rs:134— crates/db/src/index_lifecycle/repository.rs:134-138 | crates/db/src/migrations/startup/bootstrap.rs:198-202 — 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 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/db/src/migrations/startup/bootstrap.rs:127— crates/db/src/migrations/startup/bootstrap.rs:127-131 | crates/db/src/migrations/startup/bootstrap.rs:190-194 — both copies are in the same file, so extract the block into 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/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.
Duplicated block (5 lines × 2) crates/db/src/search/vector/hnsw/mutation/mod.rs:426— crates/db/src/search/vector/hnsw/mutation/mod.rs:426-430 | 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.
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.
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/planner/src/ir/access.rs:107— crates/planner/src/ir/access.rs:107-111 | crates/planner/src/ir/access.rs:123-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) crates/db/src/index_lifecycle/secondary.rs:3762— crates/db/src/index_lifecycle/secondary.rs:3762-3766 | crates/db/src/index_lifecycle/vector/driver.rs:4136-4140 — 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 83 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) crates/db/src/index_lifecycle_testing.rs:732— crates/db/src/index_lifecycle_testing.rs:732-736 | 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:122— crates/planner/src/rules/access/filter/index/edge.rs:122-126 | crates/planner/src/rules/access/filter/index/node.rs:122-126 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (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:52-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) sdks/rust/src/lib.rs:604— sdks/rust/src/lib.rs:604-609 | sdks/rust/src/lib.rs:612-616 — both copies are in the same file, so extract the block into 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/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.
Duplicated block (5 lines × 2) crates/db/src/index_lifecycle/text/driver.rs:1085— crates/db/src/index_lifecycle/text/driver.rs:1085-1089 | crates/db/src/index_lifecycle/text/driver.rs:1414-1418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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.
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.
Duplicated block (5 lines × 2) crates/db/src/index_lifecycle/secondary.rs:1047— crates/db/src/index_lifecycle/secondary.rs:1047-1051 | crates/db/src/index_lifecycle/text/driver.rs:2536-2540 — 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 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.
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.
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.
Duplicated block (5 lines × 2) sdks/python/src/helixdb/dsl.py:985— sdks/python/src/helixdb/dsl.py:985-992 | sdks/python/src/helixdb/dsl.py:1003-1007 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift 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/src/helixdb/dsl.py:985` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) crates/ast/src/testing/variants.rs:688— crates/ast/src/testing/variants.rs:688-701 | 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 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) 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:310— crates/db/src/execution/interpreter/access/indexes.rs:310-323 | crates/db/src/execution/interpreter/access/indexes.rs:387-400 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/db/src/execution/interpreter/count.rs:2279— crates/db/src/execution/interpreter/count.rs:2279-2292 | 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.
Duplicated block (14 lines × 2) crates/db/src/execution/interpreter/mutation/edge.rs:247— crates/db/src/execution/interpreter/mutation/edge.rs:247-260 | crates/db/src/execution/interpreter/mutation/edge.rs:311-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/db/src/execution/interpreter/mutation/node.rs:188— crates/db/src/execution/interpreter/mutation/node.rs:188-201 | crates/db/src/execution/interpreter/mutation/node.rs:265-278 — both copies are in the same file, so extract the block into 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:2536— crates/db/src/migrations/mod.rs:2536-2549 | crates/db/src/migrations/mod.rs:2565-2578 — both copies are in the same file, so extract the block into 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.
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.
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.
Duplicated block (14 lines × 2) crates/planner/src/rules/cardinality.rs:869— crates/planner/src/rules/cardinality.rs:869-882 | crates/planner/src/rules/cardinality.rs:962-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.
Duplicated block (14 lines × 2) crates/planner/src/rules/cardinality.rs:1422— crates/planner/src/rules/cardinality.rs:1422-1435 | crates/planner/src/rules/cardinality.rs:1446-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.
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.
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.
Duplicated block (14 lines × 2) crates/db/src/migrations/vector_simhash_directory.rs:549— crates/db/src/migrations/vector_simhash_directory.rs:549-562 | crates/db/src/migrations/vector_simhash_directory.rs:754-767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) crates/db/src/index_lifecycle/operation.rs:1259— crates/db/src/index_lifecycle/operation.rs:1259-1272 | crates/db/src/index_lifecycle/operation.rs:1284-1297 — both copies are in the same file, so extract the block into 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/lib.rs:500— crates/db/src/lib.rs:500-513 | crates/db/src/lib.rs:953-966 — both copies are in the same file, so extract the block into 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) sdks/python/scripts/cypher_parity.py:33— sdks/python/scripts/cypher_parity.py:33-46 | sdks/python/scripts/cypher_parity.py:50-63 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `client` to `Client` in one and `AsyncClient` 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 (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:1373— sdks/python/src/helixdb/dsl.py:1373-1386 | sdks/python/src/helixdb/dsl.py:1410-1423 — both copies are in the same file, so extract the 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.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×21
TooManyMethods: ExecutionContext crates/db/src/execution/interpreter/runtime_context.rs:269— TooManyMethods — 321 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 291 over it, 10.70× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: HelixDB crates/db/src/lib.rs:798— TooManyMethods — 116 methods, declared across 5 files: src/lib.rs (97), src/index_lifecycle_testing.rs (9), src/migration_parity.rs (7), src/cypher.rs (2), +1 more file(s). The bar is 30 methods; this is 86 over it, 3.87× 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 — 109 methods, declared across 4 files: hnsw/index.rs (56), mutation/mod.rs (38), hnsw/restricted.rs (9), hnsw/search.rs (6). The bar is 30 methods; this is 79 over it, 3.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: 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: 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:90— 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: 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 — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MutationOpCache crates/db/src/search/vector/hnsw/mutation/mod.rs:2893— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: 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.
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.
Duplicated block (13 lines × 2) crates/db/src/execution/interpreter/access/indexes.rs:296— crates/db/src/execution/interpreter/access/indexes.rs:296-308 | crates/db/src/execution/interpreter/access/indexes.rs:373-385 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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.
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.
Duplicated block (13 lines × 2) crates/db/src/execution/interpreter/count.rs:659— crates/db/src/execution/interpreter/count.rs:659-671 | crates/db/src/execution/interpreter/count.rs:717-729 — both copies are in the same file, so extract the block into 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/db/src/index_lifecycle/operation.rs:1030— crates/db/src/index_lifecycle/operation.rs:1030-1042 | crates/db/src/index_lifecycle/operation.rs:1487-1499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/db/src/migrations/mod.rs:5983— crates/db/src/migrations/mod.rs:5983-5995 | crates/db/src/migrations/mod.rs:6088-6100 — both copies are in the same file, so extract the block into 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/db/src/search/mod.rs:2541— crates/db/src/search/mod.rs:2541-2553 | crates/db/src/search/mod.rs:2555-2567 — both copies are in the same file, so extract the block into 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/db/src/search/vector/generation.rs:399— crates/db/src/search/vector/generation.rs:399-411 | crates/db/src/search/vector/generation.rs:513-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 (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.
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.
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.
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.
Duplicated block (13 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:3472— crates/db/src/index_lifecycle_testing/contracts.rs:3472-3484 | crates/db/src/index_lifecycle_testing/contracts.rs:3764-3776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:1298— crates/db/src/index_lifecycle_testing/contracts.rs:1298-1310 | crates/db/src/index_lifecycle_testing/contracts.rs:2412-2424 — both copies are in the same file, so extract the block into 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/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.
Duplicated block (13 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:1246— crates/db/src/index_lifecycle_testing/contracts.rs:1246-1258 | crates/db/src/index_lifecycle_testing/contracts.rs:1711-1723 — both copies are in the same file, so extract the block into 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/db/src/migrations/mod.rs:3567— crates/db/src/migrations/mod.rs:3567-3579 | crates/db/src/migrations/mod.rs:3640-3652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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:1397— 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::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::update_rows (cyclomatic 21) crates/db/src/execution/interpreter/rows/mutations.rs:175— ExecutionContext::update_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.
ExecutionContext::search_vector_index_with_candidates (cyclomatic 18) crates/db/src/execution/interpreter/access/search/storage.rs:69— ExecutionContext::search_vector_index_with_candidates 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.
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::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.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×16
ClassTooLong: VectorRows crates/db/src/search/vector/storage/mod.rs:291— ClassTooLong — 1028 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 628 over it, 2.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: VectorIndex crates/db/src/search/vector/hnsw/index.rs:109— ClassTooLong — 927 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 109 methods, 2 blocks, lines 109-1634. The bar is 400 significant lines; this is 527 over it, 2.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: LocalRuntime crates/cli/src/local_runtime.rs:90— 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 90-1180. 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: Runner crates/db-testkit/src/lifecycle_workload.rs:196— 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), 27 methods, 2 blocks, lines 196-1026. 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: 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: LifecycleTestController crates/db/src/index_lifecycle_testing.rs:877— ClassTooLong — 508 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods. The bar is 400 significant lines; this is 108 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Source crates/db/src/execution/interpreter/pull/source.rs:24— ClassTooLong — 460 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-690. The bar is 400 significant lines; this is 60 over it, 1.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: 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.
ClassTooLong: MutationOpCache crates/db/src/search/vector/hnsw/mutation/mod.rs:2893— ClassTooLong — 404 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods, 3 blocks, lines 2893-3509. The bar is 400 significant lines; this is 4 over it, 1.01× 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.
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.
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.
Duplicated block (15 lines × 2) crates/db/src/index_lifecycle/queue/publication.rs:1124— crates/db/src/index_lifecycle/queue/publication.rs:1124-1138 | crates/db/src/index_lifecycle/queue/publication.rs:1716-1730 — both copies are in the same file, so extract the block into 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/index_lifecycle/worker.rs:685— crates/db/src/index_lifecycle/worker.rs:685-699 | crates/db/src/index_lifecycle/worker.rs:747-761 — both copies are in the same file, so extract the block into 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/index_lifecycle_testing/contracts.rs:4114— crates/db/src/index_lifecycle_testing/contracts.rs:4114-4128 | crates/db/src/index_lifecycle_testing/contracts.rs:4214-4228 — both copies are in the same file, so extract the block into 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/merge_operator.rs:102— crates/db/src/merge_operator.rs:102-116 | crates/db/src/merge_operator.rs:128-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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.
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.
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.
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.
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.
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.
Duplicated block (15 lines × 2) crates/db/src/migrations/mod.rs:6335— crates/db/src/migrations/mod.rs:6335-6349 | crates/db/src/migrations/mod.rs:7516-7530 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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.
Repeated repair: crates/cli/src/local_runtime.rs crates/cli/src/local_runtime.rs:767— crates/cli/src/local_runtime.rs changed 47 times in last 90 days and 32 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 767), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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 18 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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/db/src/config/index_operation_queue.rs crates/db/src/config/index_operation_queue.rs:137— crates/db/src/config/index_operation_queue.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 3 (its worst body is IndexOperationQueueTuningError::fmt at line 137), 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): reject retained-byte ceilings below one operation's charge”; “fix(db): charge index-queue admission each operation's memory”; “fix(db): default the strong vector search bound to the retained-byte ceiling”; “fix(db): bound queue reads and retain queues across publication commits”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +00:00' --full-history --no-merges -- crates/db/src/config/index_operation_queue.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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/ts_query.rs crates/cli/src/ts_query.rs:117— crates/cli/src/ts_query.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is helix_cli::ts_query::ensure_sdk_in at line 117), 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 Cloud CLI command flows”; “fix(cli): sync TypeScript SDK release pin”; “fix(sdk): restore embedded package releases”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +00:00' --full-history --no-merges -- crates/cli/src/ts_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/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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/metrics.rs crates/cli/src/commands/metrics.rs:16— 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 16), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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/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), 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-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 14:02:15 +00:00' --until='2026-10-26 14:02:15 +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.
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/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/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/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.
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::relink_neighbor (cognitive 29) crates/db/src/search/vector/hnsw/mutation/mod.rs:2108— 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::search_layer_beam (cognitive 25) crates/db/src/search/vector/hnsw/mutation/mod.rs:992— VectorIndex::search_layer_beam has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorIndex::insert_with_mutation_cache (cognitive 19) crates/db/src/search/vector/hnsw/mutation/mod.rs:727— 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::insert_hnsw (cognitive 17) crates/db/src/search/vector/hnsw/mutation/mod.rs:874— VectorIndex::insert_hnsw has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (7 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorIndex::add_bidirectional_link (cognitive 17) crates/db/src/search/vector/hnsw/mutation/mod.rs:1585— 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.
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.
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.
Duplicated block (9 lines × 3) crates/db/src/index_lifecycle/text/validation.rs:441— crates/db/src/index_lifecycle/text/validation.rs:441-449 | crates/db/src/index_lifecycle/text/validation.rs:646-654 | crates/db/src/index_lifecycle/text/validation.rs:890-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.
Duplicated block (9 lines × 3) crates/db/src/search/vector/spaces/simple.rs:247— crates/db/src/search/vector/spaces/simple.rs:247-255 | crates/db/src/search/vector/spaces/simple.rs:263-271 | crates/db/src/search/vector/spaces/simple.rs:279-287 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/db/src/search/vector/storage/mod.rs:919— crates/db/src/search/vector/storage/mod.rs:919-927 | crates/db/src/search/vector/storage/mod.rs:941-949 | crates/db/src/search/vector/storage/mod.rs:970-978 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/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.
Duplicated block (9 lines × 3) crates/db/src/index_lifecycle_testing.rs:1246— crates/db/src/index_lifecycle_testing.rs:1246-1254 | crates/db/src/index_lifecycle_testing.rs:1372-1380 | crates/db/src/index_lifecycle_testing.rs:1413-1423 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 3) crates/cli/src/local_runtime.rs:1071— crates/cli/src/local_runtime.rs:1071-1079 | crates/cli/src/local_runtime.rs:1089-1097 | crates/cli/src/local_runtime.rs:1115-1123 — 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.
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.
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.
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.
Duplicated block (16 lines × 2) crates/db/src/index_lifecycle_testing.rs:1276— crates/db/src/index_lifecycle_testing.rs:1276-1291 | crates/db/src/index_lifecycle_testing.rs:1460-1475 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/db/src/migrations/mod.rs:6183— crates/db/src/migrations/mod.rs:6183-6198 | crates/db/src/migrations/mod.rs:6531-6546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/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.
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:2377— crates/db/src/index_lifecycle/vector/driver.rs:2377-2392 | crates/db/src/index_lifecycle/vector/driver.rs:2605-2620 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) crates/db/src/execution/interpreter/storage.rs:243— crates/db/src/execution/interpreter/storage.rs:243-258 | crates/db/src/execution/interpreter/storage.rs:312-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
X17 · Uncapped recursion over a caller-supplied document· Recursive walk over a caller-supplied document has no depth cap · ×8
Recursive walk over a caller-supplied document has no depth cap sdks/typescript/src/dsl.ts:11— `stringifyJson` is exported, takes a document from its caller (line 69) and hands it to `encode`, which calls itself at line 11 (`encode`) with a piece of `value` (and at line 12, line 19) — and nowhere in `encode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `encode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap sdks/typescript/src/dsl.ts:88— `canonicalizeJson` is exported and takes `value: unknown` from its caller, and it calls itself at line 88 (`canonicalizeJson`) with a piece of `value` (and at line 93) — and nowhere in `canonicalizeJson` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `canonicalizeJson` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap sdks/typescript/src/dsl.ts:175— `stringifyJson` is exported, takes a document from its caller (line 69) and hands it to `stringifyEncoded`, which calls itself at line 175 (`stringifyEncoded`) with a piece of `value` (and at line 177, line 187, line 190) — and nowhere in `stringifyEncoded` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `stringifyEncoded` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap sdks/typescript/scripts/parity/cypher-results.ts:134— `normalizeGraphIds` is exported, takes a document from its caller (line 148) and hands it to `mapWire`, which calls itself at line 134 (`mapWire`) with a piece of `value` — and nowhere in `mapWire` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. JavaScript sets no limit of its own on that nesting: `JSON.parse` accepts any depth, so a 100,000-byte body — inside Express's default 100kb limit — parses to 50,000 levels, and a walk like this one throws `RangeError: Maximum call stack size exceeded` long before it reaches the bottom. Wherever that throw lands, the work fails: a request errors, and a walk running outside any `try` — an event handler, a timer, a promise nobody awaits — takes the Node process down with every other request in flight. Thread a depth argument through `mapWire` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap sdks/python/src/helixdb/dsl.py:38— `stringify_json` is public, takes a document from its caller (line 100) and hands it to `_encode`, which calls itself at line 38 (`_encode`) with a piece of `value` (and at line 46, line 50) — and nowhere in `_encode` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_encode` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap sdks/python/src/helixdb/dsl.py:118— `canonicalize_json` is public and takes `value: Any` from its caller, and it calls itself at line 118 (`canonicalize_json`) with a piece of `value` (and at line 120) — and nowhere in `canonicalize_json` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `canonicalize_json` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap sdks/python/src/helixdb/dsl.py:3878— `insert_typed_parameter` is public, takes a document from its caller (line 3999) and hands it to `_validate_json_value`, which calls itself at line 3878 (`_validate_json_value`) with a piece of `value` (and at line 3885) — and nowhere in `_validate_json_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_validate_json_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Recursive walk over a caller-supplied document has no depth cap sdks/python/src/helixdb/dsl.py:3926— `insert_typed_parameter` is public, takes a document from its caller (line 3999) and hands it to `_normalize_typed_query_value`, which calls itself at line 3926 (`_normalize_typed_query_value`) with a piece of `value` — and nowhere in `_normalize_typed_query_value` is there a depth parameter, a descent counter, or any other cap. The walk therefore spends one stack frame per LEVEL of the value it is handed, so the nesting of the caller's document — not this code — decides how deep the stack goes. Python's parsers accept far more nesting than its stack allows: `json.loads` turns 3,000 bytes of brackets into 1,500 levels and `xml.etree.ElementTree` parses tens of thousands, while a walk like this one raises `RecursionError` once it passes the interpreter's default limit of 1,000 frames. Wherever that exception lands, the work fails: a request errors, and outside any `try` the worker or the program exits with it. Raising `sys.setrecursionlimit` only moves the number the document has to beat. Thread a depth argument through `_normalize_typed_query_value` and reject the value past a fixed maximum, or rewrite the descent with an explicit stack.
Duplicated block (6 lines × 3) crates/db/src/migrations/startup/bootstrap.rs:121— crates/db/src/migrations/startup/bootstrap.rs:121-126 | crates/db/src/migrations/startup/bootstrap.rs:184-189 | crates/db/src/migrations/startup/bootstrap.rs:260-265 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/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/mutation/contracts.rs:29— crates/db/src/execution/interpreter/mutation/contracts.rs:29-34 | crates/db/src/index_lifecycle/mutation_catalog.rs:309-314 | crates/db/src/migrations/mod.rs:4119-4124 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) 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.
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.
Duplicated block (6 lines × 3) crates/db/src/index_lifecycle/text/driver.rs:908— crates/db/src/index_lifecycle/text/driver.rs:908-913 | crates/db/src/index_lifecycle/text/driver.rs:1175-1180 | crates/db/src/index_lifecycle/text/driver.rs:1562-1568 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 3) crates/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 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) 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.
Duplicated block (23 lines × 2) crates/db/src/index_lifecycle_testing.rs:1222— crates/db/src/index_lifecycle_testing.rs:1222-1244 | crates/db/src/index_lifecycle_testing.rs:1348-1370 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) 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.
Duplicated block (23 lines × 2) crates/db/src/migrations/vector_retirement.rs:495— crates/db/src/migrations/vector_retirement.rs:495-517 | crates/db/src/migrations/vector_retirement.rs:897-919 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) 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 (23 lines × 2) crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:85— crates/planner/src/rules/access/sets/equality_range/intersection/edge.rs:85-107 | crates/planner/src/rules/access/sets/equality_range/intersection/node.rs:85-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 4 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.
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.
Duplicated block (17 lines × 2) crates/db/src/index_lifecycle/outbox.rs:1121— crates/db/src/index_lifecycle/outbox.rs:1121-1137 | crates/db/src/index_lifecycle/outbox.rs:1148-1164 — both copies are in the same file, so extract the block into 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/src/index_lifecycle/text/active_batch.rs:918— crates/db/src/index_lifecycle/text/active_batch.rs:918-934 | crates/db/src/index_lifecycle/text/active_batch.rs:943-959 — both copies are in the same file, so extract the block into 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/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.
Duplicated block (17 lines × 2) crates/db/src/index_lifecycle/worker.rs:707— crates/db/src/index_lifecycle/worker.rs:707-723 | crates/db/src/index_lifecycle/worker.rs:776-792 — both copies are in the same file, so extract the block into 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/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.
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.
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.
Duplicated block (8–9 lines × 2) crates/db/src/encoding/v2/values/property/property_value.rs:152— crates/db/src/encoding/v2/values/property/property_value.rs:152-159 | crates/planner/src/analysis/literal_set.rs:103-111 — 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–9 lines × 2) crates/db/src/execution/interpreter/mutation/visibility.rs:112— crates/db/src/execution/interpreter/mutation/visibility.rs:112-120 | crates/db/src/execution/interpreter/scheduler.rs:432-439 — 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–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 (8–9 lines × 2) crates/planner/src/diagnostics/analyze.rs:923— crates/planner/src/diagnostics/analyze.rs:923-931 | crates/planner/src/diagnostics/analyze.rs:954-961 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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:243— 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:413— 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:377 — 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:512— sdks/typescript/src/index.ts:512 · sdks/typescript/src/index.ts:614 — 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×5
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×5
Members sharing a duplicated core (4 members, 50+ identical tokens) 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:230— crates/db/src/execution/interpreter/mutation/edge.rs:230-262 | crates/db/src/execution/interpreter/mutation/edge.rs:289-326 | crates/db/src/execution/interpreter/mutation/node.rs:126-203 | crates/db/src/execution/interpreter/mutation/node.rs:241-280 — 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:1262— crates/db/src/search/mod.rs:1262-1274 | crates/db/src/search/mod.rs:1290-1303 | crates/db/src/search/mod.rs:1335-1345 | crates/db/src/search/mod.rs:1399-1410 — 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:399-413 | sdks/python/scripts/run_server_parity.py:417-431 — These 4 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Duplicated block (21 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:4780— crates/db/src/index_lifecycle_testing/contracts.rs:4780-4800 | crates/db/src/index_lifecycle_testing/contracts/all_index_validation.rs:1107-1127 — 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 (21 lines × 2) crates/db/src/migrations/indexes/equality_bitmap.rs:404— crates/db/src/migrations/indexes/equality_bitmap.rs:404-424 | crates/db/src/migrations/indexes/equality_bitmap.rs:453-473 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/db/src/search/mod.rs:2735— crates/db/src/search/mod.rs:2735-2755 | crates/db/src/search/mod.rs:2757-2777 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) crates/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:514— crates/planner/src/rules/cardinality.rs:514-534 | crates/planner/src/rules/cardinality.rs:630-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.
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.
Duplicated block (20 lines × 2) crates/db/src/execution/interpreter/access/indexes.rs:860— crates/db/src/execution/interpreter/access/indexes.rs:860-879 | 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.
Duplicated block (20 lines × 2) crates/db/src/execution/interpreter/count.rs:2305— crates/db/src/execution/interpreter/count.rs:2305-2324 | 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.
Duplicated block (20 lines × 2) crates/db/src/migrations/mod.rs:3481— crates/db/src/migrations/mod.rs:3481-3500 | crates/db/src/migrations/mod.rs:3591-3610 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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.
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.
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.
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.
Duplicated block (19 lines × 2) crates/db/src/execution/interpreter/mutation/edge.rs:299— crates/db/src/execution/interpreter/mutation/edge.rs:299-317 | crates/db/src/execution/interpreter/mutation/node.rs:253-271 — 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 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.
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.
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.
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.
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.
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.
Duplicated block (11 lines × 3) crates/db/src/index_lifecycle_testing.rs:1226— crates/db/src/index_lifecycle_testing.rs:1226-1236 | crates/db/src/index_lifecycle_testing.rs:1352-1362 | crates/db/src/index_lifecycle_testing.rs:1392-1402 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 3) crates/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.
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.
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.
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 (7 lines × 3) crates/db/src/index_lifecycle/queue/publication.rs:1023— crates/db/src/index_lifecycle/queue/publication.rs:1023-1029 | crates/db/src/index_lifecycle/queue/publication.rs:1291-1297 | crates/db/src/index_lifecycle/queue/publication.rs:1837-1843 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) crates/db/src/index_lifecycle/secondary.rs:3744— crates/db/src/index_lifecycle/secondary.rs:3744-3750 | crates/db/src/index_lifecycle/text/driver.rs:2892-2898 | crates/db/src/index_lifecycle/vector/driver.rs:4118-4124 — 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 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.
Duplicated block (7 lines × 3) crates/db/src/migrations/tenant/envelope.rs:58— crates/db/src/migrations/tenant/envelope.rs:58-64 | crates/db/src/migrations/tenant/envelope.rs:106-112 | crates/db/src/migrations/tenant/envelope.rs:142-148 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) crates/planner/src/rules/access/pipeline/membership.rs:242— crates/planner/src/rules/access/pipeline/membership.rs:242-248 | crates/planner/src/rules/access/pipeline/support/empty.rs:31-37 | crates/planner/src/rules/physical_contracts/support/cardinality.rs:64-70 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) crates/db/src/index_lifecycle/secondary.rs:3768— crates/db/src/index_lifecycle/secondary.rs:3768-3774 | crates/db/src/index_lifecycle/text/driver.rs:2920-2926 | crates/db/src/index_lifecycle/vector/driver.rs:4142-4148 — 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 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.
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:2108— 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.
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 188) crates/cypher/src/bind.rs:82— helix_cypher::bind::bind_clauses has cognitive complexity 188 (threshold 15). Drivers by points: if/else 37 (121 pts), match/switch 8 (32 pts), loops 6 (19 pts), boolean chains 16 (nesting depth added 121). To reduce it, split the body into named stages: move each independent 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.
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.
Duplicated block (25 lines × 2) crates/ast/src/testing/variants.rs:662— crates/ast/src/testing/variants.rs:662-686 | 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 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) crates/db/src/execution/interpreter/access/indexes.rs:325— crates/db/src/execution/interpreter/access/indexes.rs:325-349 | crates/db/src/execution/interpreter/access/indexes.rs:402-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (25 lines × 2) 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.
Duplicated block (25 lines × 2) crates/db/src/search/vector/hnsw/mutation/mod.rs:2163— crates/db/src/search/vector/hnsw/mutation/mod.rs:2163-2187 | crates/db/src/search/vector/hnsw/mutation/mod.rs:2217-2241 — both copies are in the same file, so extract the block into 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/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/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.
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.
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:542— crates/db/src/index_lifecycle/secondary/exact.rs:542-560 | 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:286— crates/db/src/merge_operator.rs:286-303 | crates/db/src/merge_operator.rs:315-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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 (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.
Duplicated block (12 lines × 3) crates/db/src/index_lifecycle/secondary.rs:3781— crates/db/src/index_lifecycle/secondary.rs:3781-3792 | crates/db/src/index_lifecycle/text/driver.rs:2934-2945 | crates/db/src/index_lifecycle/vector/driver.rs:4155-4166 — 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 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.
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:3670— crates/db/src/index_lifecycle/secondary.rs:3670-3678 | crates/db/src/index_lifecycle/vector/driver.rs:4045-4054 — 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 83 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/index_lifecycle/secondary.rs:3693— crates/db/src/index_lifecycle/secondary.rs:3693-3701 | crates/db/src/index_lifecycle/vector/driver.rs:4071-4080 — 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 83 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/planner/src/rules/access/pipeline/membership.rs:243— crates/planner/src/rules/access/pipeline/membership.rs:243-252 | crates/planner/src/rules/physical_contracts/support/cardinality.rs:65-73 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (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.
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:296-303 | 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.
Duplicated block (8 lines × 3) crates/db/src/migrations/mod.rs:6192— crates/db/src/migrations/mod.rs:6192-6199 | crates/db/src/migrations/mod.rs:6540-6547 | crates/db/src/migrations/mod.rs:6890-6897 — 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:3362— crates/db/src/index_lifecycle_testing/contracts.rs:3362-3369 | crates/db/src/index_lifecycle_testing/contracts.rs:3387-3401 | crates/db/src/index_lifecycle_testing/contracts.rs:3849-3857 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 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/src/execution/interpreter/mod.rs:280— crates/db/src/execution/interpreter/mod.rs:280-286 | crates/db/src/execution/interpreter/mutation/visibility.rs:115-121 | crates/db/src/execution/interpreter/scheduler.rs:434-440 | crates/planner/src/diagnostics/analyze.rs:706-712 | crates/planner/src/diagnostics/analyze.rs:949-955 — there are 5 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 5) crates/db/src/migrations/mod.rs:6546— crates/db/src/migrations/mod.rs:6546-6554 | crates/db/src/migrations/mod.rs:6767-6775 | crates/db/src/migrations/mod.rs:6896-6904 | crates/db/src/migrations/mod.rs:7162-7168 | crates/db/src/migrations/mod.rs:8499-8505 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 5) crates/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.
Outbound HTTP without resilience crates/cli/src/cloud/client.rs:177— `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience 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:359— `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.
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:382 — 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 73) crates/cypher/src/bind.rs:82— helix_cypher::bind::bind_clauses has cyclomatic complexity 73 (threshold 15). To reduce it, separate the cases: extract each independent 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:631— 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.
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:342-370 — 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 46 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 (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.
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.
Duplicated block (16–17 lines × 2) crates/db/src/execution/interpreter/mutation/rows.rs:106— crates/db/src/execution/interpreter/mutation/rows.rs:106-121 | crates/db/src/execution/interpreter/mutation/rows.rs:150-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 (16–17 lines × 2) crates/db/src/lib.rs:2239— crates/db/src/lib.rs:2239-2255 | crates/db/src/lib.rs:3752-3767 — both copies are in the same file, so extract the block into 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–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.
Duplicated block (14–16 lines × 2) crates/db/src/index_lifecycle/secondary.rs:1252— crates/db/src/index_lifecycle/secondary.rs:1252-1267 | crates/db/src/index_lifecycle/secondary.rs:1640-1653 — both copies are in the same file, so extract the block into 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–16 lines × 2) crates/db/src/needed_in_future/merge_operator.rs:196— crates/db/src/needed_in_future/merge_operator.rs:196-211 | crates/db/src/needed_in_future/merge_operator.rs:236-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) crates/db/src/migration_parity.rs:879— crates/db/src/migration_parity.rs:879-892 | crates/db/src/migration_parity.rs:928-942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) crates/planner/src/analysis.rs:57— crates/planner/src/analysis.rs:57-70 | crates/planner/src/rules/access/filter/atoms/mod.rs:30-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14–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 lines × 3) crates/db/src/index_lifecycle/secondary.rs:1773— crates/db/src/index_lifecycle/secondary.rs:1773-1785 | crates/db/src/index_lifecycle/secondary.rs:2006-2018 | crates/db/src/index_lifecycle/secondary.rs:2081-2093 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) crates/db/src/migrations/vector_retirement.rs:495— 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 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13 lines × 3) crates/db/src/index_lifecycle/secondary/exact.rs:114— crates/db/src/index_lifecycle/secondary/exact.rs:114-128 | crates/db/src/index_lifecycle/secondary/exact.rs:296-308 | crates/db/src/index_lifecycle/secondary/exact/unique.rs:62-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 4 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.
Duplicated block (11–12 lines × 2) crates/db/src/execution/interpreter/mutation/edge.rs:357— crates/db/src/execution/interpreter/mutation/edge.rs:357-367 | crates/db/src/execution/interpreter/mutation/node.rs:311-322 — 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 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.
Duplicated block (11–12 lines × 2) crates/db/src/index_lifecycle/secondary.rs:1031— crates/db/src/index_lifecycle/secondary.rs:1031-1041 | crates/db/src/index_lifecycle/text/driver.rs:2513-2524 — 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 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.
Duplicated block (11–12 lines × 2) crates/db/src/search/mod.rs:1047— crates/db/src/search/mod.rs:1047-1057 | crates/db/src/search/mod.rs:2426-2437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) crates/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.
Duplicated block (10–11 lines × 2) crates/db/src/migrations/vector_properties.rs:167— crates/db/src/migrations/vector_properties.rs:167-177 | crates/db/src/migrations/vector_retirement.rs:430-439 — 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 5 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 (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.
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.
Duplicated block (8 lines × 4) 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 | crates/planner/src/analysis/prune.rs:57-64 — before extracting anything, compare `crates/planner/src/analysis/labels.rs` and `crates/planner/src/analysis/prune.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 × 4) crates/db/src/config/indexes.rs:677— crates/db/src/config/indexes.rs:677-684 | crates/db/src/config/indexes.rs:687-694 | 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–8 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:2475— crates/db/src/index_lifecycle_testing/contracts.rs:2475-2482 | crates/db/src/index_lifecycle_testing/contracts.rs:2619-2625 — both copies are in the same file, so extract the block into 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.
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:358-364 — 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.
Swallowed exception (empty catch) sdks/typescript/src/index.ts:142— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) REDACTED:81— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) sdks/typescript/scripts/parity/run-helix.ts:309— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
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.
Runner::random_step (cyclomatic 22) crates/db-testkit/src/lifecycle_workload.rs:376— Runner::random_step 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.
Runner::validate_invariants (cyclomatic 19) crates/db-testkit/src/lifecycle_workload.rs:905— Runner::validate_invariants 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.
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:2963— 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:3182— 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.
TooManyFunctions: db::migrations crates/db/src/migrations/mod.rs:76— TooManyFunctions — 74 free functions. The bar is 30 free functions; this is 44 over it, 2.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: db::migrations::production_contracts crates/db/src/migrations/mod.rs:5293— TooManyFunctions — 49 free functions. The bar is 30 free functions; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/db/src/migrations/mod.rs:6168— crates/db/src/migrations/mod.rs:6168-6499 | crates/db/src/migrations/mod.rs:6503-6723 | crates/db/src/migrations/mod.rs:6727-6862 | crates/db/src/migrations/mod.rs:6866-7118 | crates/db/src/migrations/mod.rs:7122-7334 | crates/db/src/migrations/mod.rs:8102-8338 | crates/db/src/migrations/mod.rs:8470-8650 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) crates/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 (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.
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.
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 (18 lines × 2) crates/ast/src/testing/variants.rs:710— crates/ast/src/testing/variants.rs:710-727 | 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 67 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) 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.
Duplicated block (17–18 lines × 2) crates/db/src/index_lifecycle/secondary/exact.rs:278— crates/db/src/index_lifecycle/secondary/exact.rs:278-294 | 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 4 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.
Duplicated block (17–18 lines × 2) crates/db/src/index_lifecycle/secondary/exact.rs:299— crates/db/src/index_lifecycle/secondary/exact.rs:299-315 | 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 4 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.
Duplicated block (15–16 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:3455— crates/db/src/index_lifecycle_testing/contracts.rs:3455-3470 | crates/db/src/index_lifecycle_testing/contracts.rs:3536-3550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) crates/db/src/migrations/mod.rs:1876— crates/db/src/migrations/mod.rs:1876-1891 | crates/db/src/migrations/mod.rs:2115-2129 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) crates/cli/src/local_runtime.rs:408— crates/cli/src/local_runtime.rs:408-421 | crates/cli/src/local_runtime.rs:443-455 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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.
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.
Duplicated block (12–14 lines × 2) crates/db/src/index_lifecycle_testing.rs:902— crates/db/src/index_lifecycle_testing.rs:902-913 | crates/db/src/index_lifecycle_testing.rs:1032-1045 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 4) 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.
Duplicated block (13 lines × 4) crates/db/src/migrations/vector_retirement.rs:367— crates/db/src/migrations/vector_retirement.rs:367-379 | crates/db/src/migrations/vector_retirement.rs:494-506 | crates/db/src/migrations/vector_retirement.rs:624-636 | crates/db/src/migrations/vector_retirement.rs:896-908 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 4) crates/db/src/index_lifecycle/text/driver.rs:666— crates/db/src/index_lifecycle/text/driver.rs:666-677 | crates/db/src/index_lifecycle/text/driver.rs:692-703 | crates/db/src/index_lifecycle/text/driver.rs:709-721 | crates/db/src/index_lifecycle/text/driver.rs:726-737 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 4) crates/db/src/migrations/vector_properties.rs:281— crates/db/src/migrations/vector_properties.rs:281-293 | crates/db/src/migrations/vector_retirement.rs:514-525 | crates/db/src/migrations/vector_retirement.rs:648-659 | crates/db/src/migrations/vector_retirement.rs:916-927 — 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 5 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 (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.
Duplicated block (10 lines × 4) crates/db/src/migrations/vector_retirement.rs:261— crates/db/src/migrations/vector_retirement.rs:261-270 | crates/db/src/migrations/vector_retirement.rs:547-556 | crates/db/src/migrations/vector_retirement.rs:682-691 | crates/db/src/migrations/vector_retirement.rs:793-802 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) 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.
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:317-325 | 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 (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.
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.
Duplicated block (6–7 lines × 2) crates/planner/src/diagnostics/analyze.rs:186— crates/planner/src/diagnostics/analyze.rs:186-192 | crates/planner/src/diagnostics/analyze.rs:711-716 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–7 lines × 2) crates/planner/src/diagnostics/analyze.rs:996— crates/planner/src/diagnostics/analyze.rs:996-1002 | crates/planner/src/diagnostics/analyze.rs:1047-1052 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 6) crates/db/src/migrations/vector_properties.rs:166— crates/db/src/migrations/vector_properties.rs:166-171 | crates/db/src/migrations/vector_retirement.rs:260-265 | crates/db/src/migrations/vector_retirement.rs:429-434 | crates/db/src/migrations/vector_retirement.rs:546-551 | crates/db/src/migrations/vector_retirement.rs:681-686 | crates/db/src/migrations/vector_retirement.rs:792-797 — 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 5 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 (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 (5 lines × 3) crates/db/src/execution/interpreter/rows/hash_probe.rs:48— crates/db/src/execution/interpreter/rows/hash_probe.rs:48-52 | crates/db/src/execution/interpreter/rows/joins.rs:62-66 | crates/db/src/execution/interpreter/rows/lookup.rs:40-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.
Duplicated block (5 lines × 3) crates/db/src/execution/interpreter/pull/poll.rs:264— crates/db/src/execution/interpreter/pull/poll.rs:264-268 | crates/db/src/execution/interpreter/pull/poll.rs:544-548 | crates/db/src/execution/interpreter/pull/poll.rs:560-565 — 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 (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.
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.
Duplicated block (10 lines × 5) crates/db/src/migrations/mod.rs:6182— crates/db/src/migrations/mod.rs:6182-6191 | crates/db/src/migrations/mod.rs:6530-6539 | crates/db/src/migrations/mod.rs:6752-6761 | crates/db/src/migrations/mod.rs:7152-7161 | crates/db/src/migrations/mod.rs:8484-8493 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 5) crates/db/src/migrations/vector_retirement.rs:363— crates/db/src/migrations/vector_retirement.rs:363-372 | crates/db/src/migrations/vector_retirement.rs:490-499 | crates/db/src/migrations/vector_retirement.rs:620-629 | crates/db/src/migrations/vector_retirement.rs:735-744 | crates/db/src/migrations/vector_retirement.rs:892-901 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
R10 · Code Duplication· Duplicated block with local edits (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:330 — 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:251 — 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:488— `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:580— `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:2323— 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.
validate-cargo-target-references.validate_codec_architecture (cyclomatic 48) scripts/validate-cargo-target-references.py:507— validate-cargo-target-references.validate_codec_architecture has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
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.
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:423— 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.
workload.generate (cyclomatic 30) scripts/async-index-benchmark/workload.py:107— workload.generate 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.
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:513— 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 23) crates/db/src/execution/interpreter/pull/source.rs:510— Source::next has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: 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.
replay.run (cyclomatic 23) scripts/async-index-benchmark/replay.py:286— replay.run has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
s3_metrics.collect (cyclomatic 23) scripts/async-index-benchmark/s3_metrics.py:40— s3_metrics.collect 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:110— 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:1093— 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:386— 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.
dsl._convert_param_value (cyclomatic 21) sdks/python/src/helixdb/dsl.py:3735— dsl._convert_param_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.
clone_seed.clone (cyclomatic 21) scripts/async-index-benchmark/clone_seed.py:62— clone_seed.clone 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.
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.
resources.collect (cyclomatic 20) scripts/async-index-benchmark/resources.py:100— resources.collect 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:337— 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.
Edit::apply (cyclomatic 19) crates/db/src/index_lifecycle/graph_mutation/map.rs:65— Edit::apply 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.
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:942— 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.
Client.postCypher (cyclomatic 19) sdks/go/cypher.go:57— Client.postCypher 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.
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._normalize_typed_query_value (cyclomatic 18) sdks/python/src/helixdb/dsl.py:3890— dsl._normalize_typed_query_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.
Pool.request (cyclomatic 18) scripts/async-index-benchmark/replay.py:193— Pool.request 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.
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.
matrix.final (cyclomatic 17) scripts/async-index-benchmark/matrix.py:101— matrix.final 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.
workload.validate (cyclomatic 17) scripts/async-index-benchmark/workload.py:40— workload.validate 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.
compare-planner-plans.validate (cyclomatic 17) scripts/compare-planner-plans.py:11— compare-planner-plans.validate 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:2963— 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:1684— 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.
seed.seed (cyclomatic 16) scripts/async-index-benchmark/seed.py:164— seed.seed 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.
validate-cargo-target-references.validate_codec_architecture (cognitive 77) scripts/validate-cargo-target-references.py:507— validate-cargo-target-references.validate_codec_architecture has cognitive complexity 77 (threshold 15). Drivers by points: if/else 19 (42 pts), loops 20 (27 pts), boolean chains 8 (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.
workload.generate (cognitive 75) scripts/async-index-benchmark/workload.py:107— workload.generate has cognitive complexity 75 (threshold 15). Drivers by points: if/else 17 (39 pts), ternaries 8 (21 pts), loops 3 (11 pts), boolean chains 4 (nesting depth added 43). 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.
Step.to_ast (cognitive 56) sdks/python/src/helixdb/dsl.py:2323— 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:423— 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 45) crates/db/src/execution/interpreter/pull/source.rs:510— Source::next has cognitive complexity 45 (threshold 15). Drivers by points: if/else 11 (32 pts), match/switch 4 (11 pts), boolean chains 1, loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
s3_metrics.collect (cognitive 43) scripts/async-index-benchmark/s3_metrics.py:40— s3_metrics.collect has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (29 pts), loops 4 (7 pts), boolean chains 5, ternaries 1 (2 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
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:513— 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.
Client.postCypher (cognitive 33) sdks/go/cypher.go:57— Client.postCypher has cognitive complexity 33 (threshold 15). Drivers by points: if/else 16 (30 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:110— 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.
replay.run (cognitive 27) scripts/async-index-benchmark/replay.py:286— replay.run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 5, loops 4 (5 pts), ternaries 2 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
compare-planner-plans.validate (cognitive 27) scripts/compare-planner-plans.py:11— compare-planner-plans.validate has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 6, 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.
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.
LegacyVectorRetirementCatalog::load (cognitive 26) crates/db/src/migrations/vector_retirement.rs:67— 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.
Edit::apply (cognitive 25) crates/db/src/index_lifecycle/graph_mutation/map.rs:65— Edit::apply has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 4 (5 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
dsl._convert_param_value (cognitive 25) sdks/python/src/helixdb/dsl.py:3735— dsl._convert_param_value has cognitive complexity 25 (threshold 15). Drivers by points: if/else 17 (23 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.
matrix.final (cognitive 25) scripts/async-index-benchmark/matrix.py:101— matrix.final has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (10 pts), boolean chains 6, ternaries 2 (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.
SecondaryMutationRuntime::flush (cognitive 24) crates/db/src/index_lifecycle/secondary.rs:357— SecondaryMutationRuntime::flush has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 3 (4 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
resources.collect (cognitive 24) scripts/async-index-benchmark/resources.py:100— resources.collect has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, loops 2 (3 pts), ternaries 2, error handling 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Client.Exec (cognitive 24) sdks/go/client.go:337— 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.
Runner::validate_invariants (cognitive 23) crates/db-testkit/src/lifecycle_workload.rs:905— Runner::validate_invariants has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 3, loops 3, match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PropertyValue.from_value (cognitive 23) sdks/python/src/helixdb/dsl.py:386— 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.
dsl._normalize_typed_query_value (cognitive 23) sdks/python/src/helixdb/dsl.py:3890— dsl._normalize_typed_query_value has cognitive complexity 23 (threshold 15). Drivers by points: if/else 16 (22 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
paritycypher.RunEmbedded (cognitive 23) sdks/go/internal/paritycypher/run.go:83— 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.
QueuePublisher::publish_vector (cognitive 22) crates/db/src/index_lifecycle/queue/publication.rs:1093— 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.
clone_seed.clone (cognitive 22) scripts/async-index-benchmark/clone_seed.py:62— clone_seed.clone has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (11 pts), boolean chains 7, loops 3 (4 pts) (nesting depth added 2). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Pool.request (cognitive 22) scripts/async-index-benchmark/replay.py:193— Pool.request has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (9 pts), ternaries 4 (9 pts), boolean chains 3, error handling 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate-cargo-target-references.validate_references (cognitive 22) scripts/validate-cargo-target-references.py:319— validate-cargo-target-references.validate_references has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (16 pts), loops 3 (6 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.
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:362— 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.
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.
seed.seed (cognitive 21) scripts/async-index-benchmark/seed.py:164— seed.seed has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 4 (6 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.
workload.validate (cognitive 21) scripts/async-index-benchmark/workload.py:40— workload.validate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 4, loops 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
validate-cargo-target-references.referenced_test_filters (cognitive 21) scripts/validate-cargo-target-references.py:399— validate-cargo-target-references.referenced_test_filters has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
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:942— 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.
clone_seed.inventory (cognitive 18) scripts/async-index-benchmark/clone_seed.py:21— clone_seed.inventory has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
seed.verify_indexes (cognitive 18) scripts/async-index-benchmark/seed.py:101— seed.verify_indexes has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
EdgeMergeOperator::merge_batch (cognitive 17) crates/db/src/needed_in_future/merge_operator.rs:229— EdgeMergeOperator::merge_batch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:1684— 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:488— 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:767— 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.
Catalog.add_metadata (cognitive 16) scripts/validate-cargo-target-references.py:185— Catalog.add_metadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), error handling 1 (4 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.
D4 · Code Duplication· Near-duplicate member family (6 members, 24 shared lines) · ×1
Near-duplicate member family (6 members, 24 shared lines) crates/db/src/migrations/vector_properties.rs:144— crates/db/src/migrations/vector_properties.rs:144-300 | crates/db/src/migrations/vector_retirement.rs:252-403 | crates/db/src/migrations/vector_retirement.rs:412-530 | crates/db/src/migrations/vector_retirement.rs:538-664 | crates/db/src/migrations/vector_retirement.rs:673-775 | crates/db/src/migrations/vector_retirement.rs:784-934 — These 6 members are variants of one another: a block of 24 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, 32 shared lines) · ×1
Near-duplicate member family (4 members, 32 shared lines) crates/db/src/migrations/vector_retirement.rs:252— crates/db/src/migrations/vector_retirement.rs:252-403 | crates/db/src/migrations/vector_retirement.rs:412-530 | crates/db/src/migrations/vector_retirement.rs:538-664 | crates/db/src/migrations/vector_retirement.rs:784-934 — These 4 members are variants of one another: a block of 32 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
Near-duplicate member pair (67 shared lines) crates/ast/src/testing/variants.rs:647— crates/ast/src/testing/variants.rs:647-730 | 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 (60 shared lines) crates/db/src/index_lifecycle_testing.rs:1221— crates/db/src/index_lifecycle_testing.rs:1221-1333 | crates/db/src/index_lifecycle_testing.rs:1347-1518 — 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 (54 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:699-939 — These two members are variants of one another: 54 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:295— crates/db/src/execution/interpreter/access/indexes.rs:295-363 | crates/db/src/execution/interpreter/access/indexes.rs:372-440 — 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 (44 shared lines) crates/db/src/execution/interpreter/count.rs:2272— crates/db/src/execution/interpreter/count.rs:2272-2324 | 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.
Near-duplicate member pair (43 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: 43 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 (38 shared lines) crates/db/src/execution/interpreter/storage.rs:203— crates/db/src/execution/interpreter/storage.rs:203-258 | crates/db/src/execution/interpreter/storage.rs:272-327 — These two members are variants of one another: 38 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:1610— crates/db/src/search/mod.rs:1610-1650 | crates/db/src/search/mod.rs:1681-1721 — 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 (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.
Duplicated block (30 lines × 2) crates/db/src/search/vector/hnsw/mutation/mod.rs:601— crates/db/src/search/vector/hnsw/mutation/mod.rs:601-630 | crates/db/src/search/vector/hnsw/mutation/mod.rs:661-690 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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.
Duplicated block (25–26 lines × 2) crates/db/src/index_lifecycle/text/driver.rs:1827— crates/db/src/index_lifecycle/text/driver.rs:1827-1852 | crates/db/src/index_lifecycle/text/driver.rs:2072-2096 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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:295— crates/db/src/index_lifecycle_testing.rs:295-316 | crates/db/src/index_lifecycle_testing.rs:840-863 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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.
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 (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.
Duplicated block (19 lines × 4) crates/db/src/migrations/mod.rs:6172— crates/db/src/migrations/mod.rs:6172-6190 | crates/db/src/migrations/mod.rs:6742-6760 | crates/db/src/migrations/mod.rs:6870-6888 | crates/db/src/migrations/mod.rs:7142-7160 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (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.
Duplicated block (16–18 lines × 2) crates/db/src/index_lifecycle/secondary.rs:1336— crates/db/src/index_lifecycle/secondary.rs:1336-1351 | crates/db/src/index_lifecycle/secondary.rs:1506-1523 — both copies are in the same file, so extract the block into 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–18 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:3363— crates/db/src/index_lifecycle_testing/contracts.rs:3363-3374 | crates/db/src/index_lifecycle_testing/contracts.rs:3389-3406 — both copies are in the same file, so extract the block into 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–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.
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.
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.
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 (15 lines × 3) crates/db/src/index_lifecycle/secondary/exact.rs:99— crates/db/src/index_lifecycle/secondary/exact.rs:99-113 | crates/db/src/index_lifecycle/secondary/exact.rs:281-295 | crates/db/src/index_lifecycle/secondary/exact/unique.rs:47-61 — 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 4 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.
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.
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.
Duplicated block (14 lines × 4) crates/db/src/migrations/mod.rs:6541— crates/db/src/migrations/mod.rs:6541-6554 | crates/db/src/migrations/mod.rs:6762-6775 | crates/db/src/migrations/mod.rs:6891-6904 | crates/db/src/migrations/mod.rs:8285-8298 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–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.
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.
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.
Duplicated block (11–12 lines × 5) 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:98-109 | crates/planner/src/analysis/labels.rs:131-142 | crates/planner/src/analysis/labels.rs:271-282 | crates/planner/src/analysis/prune.rs:53-63 — before extracting anything, compare `crates/planner/src/analysis/labels.rs` and `crates/planner/src/analysis/prune.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 (12 lines × 4) crates/db/src/execution/interpreter/mutation/edge.rs:245— crates/db/src/execution/interpreter/mutation/edge.rs:245-256 | crates/db/src/execution/interpreter/mutation/edge.rs:309-320 | crates/db/src/execution/interpreter/mutation/node.rs:186-197 | crates/db/src/execution/interpreter/mutation/node.rs:263-274 — 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 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.
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:1264— crates/db/src/search/mod.rs:1264-1274 | crates/db/src/search/mod.rs:1293-1303 | crates/db/src/search/mod.rs:1337-1345 | crates/db/src/search/mod.rs:1402-1410 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–11 lines × 4) 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 | crates/planner/src/analysis/prune.rs:58-67 — before extracting anything, compare `crates/planner/src/analysis/labels.rs` and `crates/planner/src/analysis/prune.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 (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.
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 (9–10 lines × 6) crates/db/src/migrations/vector_properties.rs:286— crates/db/src/migrations/vector_properties.rs:286-295 | crates/db/src/migrations/vector_retirement.rs:391-399 | crates/db/src/migrations/vector_retirement.rs:518-526 | crates/db/src/migrations/vector_retirement.rs:652-660 | crates/db/src/migrations/vector_retirement.rs:761-770 | crates/db/src/migrations/vector_retirement.rs:920-929 — 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 5 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 (9–10 lines × 3) crates/db/src/migration_parity.rs:859— crates/db/src/migration_parity.rs:859-867 | crates/db/src/migration_parity.rs:876-885 | crates/db/src/migration_parity.rs:925-934 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–10 lines × 2) crates/db/src/migrations/mod.rs:6897— crates/db/src/migrations/mod.rs:6897-6906 | crates/db/src/migrations/mod.rs:7162-7168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 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.
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.
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.
Duplicated block (5–9 lines × 2) crates/db/src/index_lifecycle_testing/contracts.rs:1515— crates/db/src/index_lifecycle_testing/contracts.rs:1515-1519 | crates/db/src/index_lifecycle_testing/contracts.rs:1934-1942 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 6) 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:317-324 | 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.
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.
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.
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.
Duplicated block (6–7 lines × 3) crates/db/src/index_lifecycle/outbox.rs:1002— crates/db/src/index_lifecycle/outbox.rs:1002-1007 | crates/db/src/index_lifecycle/outbox.rs:1121-1127 | crates/db/src/index_lifecycle/outbox.rs:1148-1154 — 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 (3–7 lines × 3) crates/db/src/migrations/vector_simhash_directory.rs:540— crates/db/src/migrations/vector_simhash_directory.rs:540-546 | crates/db/src/migrations/vector_simhash_directory.rs:627-629 | crates/db/src/migrations/vector_simhash_directory.rs:745-751 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 4) crates/db/src/search/vector/spaces/simple_avx.rs:34— crates/db/src/search/vector/spaces/simple_avx.rs:34-39 | crates/db/src/search/vector/spaces/simple_avx.rs:89-94 | crates/db/src/search/vector/spaces/simple_avx.rs:147-152 | crates/db/src/search/vector/spaces/simple_avx.rs:203-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.
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.
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 (9 lines × 6) crates/db/src/migrations/vector_properties.rs:258— crates/db/src/migrations/vector_properties.rs:258-266 | crates/db/src/migrations/vector_retirement.rs:363-371 | crates/db/src/migrations/vector_retirement.rs:490-498 | crates/db/src/migrations/vector_retirement.rs:620-628 | crates/db/src/migrations/vector_retirement.rs:735-743 | crates/db/src/migrations/vector_retirement.rs:892-900 — 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 5 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 (5 lines × 4) crates/db/src/migration_parity.rs:1299— crates/db/src/migration_parity.rs:1299-1303 | crates/db/src/migration_parity.rs:1331-1335 | crates/db/src/migration_parity.rs:1409-1413 | crates/db/src/migration_parity.rs:1446-1450 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10–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:403-412 | sdks/python/scripts/run_server_parity.py:421-430 — 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:341— sdks/typescript/src/index.ts:341 · sdks/typescript/src/index.ts:357 — both copies are in the same file, so extract the block into 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:110— 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 (anonymous) (cyclomatic 13, cognitive 11) sdks/typescript/scripts/parity/cypher-results.ts:44— (anonymous) has cyclomatic complexity 13 and cognitive complexity 11; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function 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:580— 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 (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: 599 lines of code sdks/typescript/src/index.ts:1— sdks/typescript/src/index.ts has 599 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:117— `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:1722— `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:3670— `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:750— `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:292— `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/index_lifecycle/secondary.rs:2756— `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:3746— `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.
Duplicated predicate crates/db/src/index_lifecycle/queue/backlog/tests.rs:79— `requested == limit + 1 && refused_at == limit` appears character-identically in 2 files — crates/db/src/index_lifecycle/queue/backlog/tests.rs, crates/db/src/index_lifecycle/queue/tests.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:83— 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: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.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 129 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/db/src/id_allocator.rs, crates/planner/src/relational/evaluation.rs, crates/db/src/config/indexes.rs, crates/cypher/src/parser.rs, crates/db/src/execution/interpreter/rows/matches.rs (+121 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 130 significant file(s) lose their only recent owner: crates/db/src/migrations/mod.rs, crates/db/src/search/vector/hnsw/mutation/mod.rs, crates/db/src/index_lifecycle/vector/driver.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 (+122 more). Pair on, review, or document these before any departure.
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) — 3 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 (263 single-owned of 950 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; 950 of the 1479 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)) — 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.
No ADRs found — 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/`.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 4 of 22 project(s) overshoot their size bounds, lowering Project Cohesion to 6.8/10. The most over is `crates/db` (242999 LoC, 534 module-visible types across 69 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 951 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; 951 of the 1479 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.
README/code drift crates/server/README.md:39— crates/server/README.md links to `../../docs/CLOUD_LAUNCH_TESTING.md`, but `docs/CLOUD_LAUNCH_TESTING.md` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Logging is not universal — Only 2/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`, `crates/metrics` and 2 more.
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; 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 (`!`) reduce the strict null checking score — ~1.7 `!` null assertions per 1k TypeScript source lines — 10 assertion(s) across the 5740 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.
Silent fallback default on Err crates/db/src/migrations/indexes/equality_bitmap.rs:392— `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 01a17f71-d272-7924-a27b-9e514aa54af3 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 167 · Warnings: 1537 · Recommendations: 57 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 27-10-2026 @ 22:18 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.