Public report of tursodatabase/turso, published 26 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, 26 October 2026, 04:22 UTC · Survey ID cd_82282efc205c4aa58eb8cfc1b034c234
tursodatabase/turso
Measured 26 October 2026, 04:09 UTC, at code version 67c3e6a
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.
Boundary Type-Coupling is not measured: Bounded contexts not declared.
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
Down 2 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 very large codebase: 658,972 lines of product code in 67 projects, tests not counted · Estimated rebuild effort: about 4.8 person-years · Weakest lens: Security and Compliance, 12
Findings by how serious they are
806 critical3316 serious166 minor
10 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
26 October 2026, 04:09 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 ▸
89of 89 dimensions measured by tools.
4259of 4288 findings point to an exact file and line, so you can open each one in the code. The other 29 concern the repository as a whole, such as missing documentation.
89dimensions across 8 lenses, read from 658,972 lines of product code in 67 projects.
tursodatabase/turso falls short of our standard for a preview release because we found no encryption of stored data, no key vault and no enforced HTTPS, and it has passwords or keys in the code's history. It scores 41 out of 100 and is rated Weak, and 781 of its 806 critical findings are security problems.
Security and Compliance, at 12, is the weakest lens and counts most in the score. The best first step is encrypting the sensitive stored data and keeping its keys in a vault, worth about 21 points. Raising Security and Compliance to 68 would lift the score to about 65.
378 pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. 335 weaknesses in the code could be used by an attacker, and sixteen settings leave the servers or containers unsafe. Pinning each tool to an exact version, fixing the weaknesses the scanner points to and correcting the unsafe settings would close these risks. Limiting each secret to its own step would fix the 14 secrets exposed to more of the pipeline than needed, and the 12 passwords or keys in the code's history and the three passwords or keys in the code need replacing, with the old ones switched off. The 12 errors that are caught and ignored need handling or logging instead of being ignored.
The product code is 658,972 lines, about €700,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Security and Compliance rose from 12 to 68, the lowest score rated Strong, the score would rise from 41 to about 65.
Code composition: what the lines of code are
Business logic 5%Supporting code 5%Tests 90%
New since the last survey: 641 findings
These 641 critical or serious findings weren't in the previous survey, on 12 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
God Classes · MethodTooLong: PostgreSQLTranslator.translate_create_table REDACTED
God Classes · FunctionTooLong: turso_core::incremental::vdbe_maintenance::plan::validate_planned_node core/incremental/vdbe_maintenance/plan.rs
God Classes · FunctionTooLong: turso_core::translate::alter::emit_column_constraints_validation REDACTED
God Classes · FileTooLong: translate/aggregation.rs core/translate/aggregation.rs
God Classes · FunctionTooLong: turso_core::incremental::vdbe_maintenance::members::emit_add_to_member core/incremental/vdbe_maintenance/members.rs
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: 328 findings
These 328 critical or serious findings were in the previous survey, on 12 October 2026, and are gone from this one. The first 100 are listed here.
God Classes · FileTooLong: incremental/aggregate_operator.rs core/incremental/aggregate_operator.rs
God Classes · MethodTooLong: DbspCompiler.compile_plan core/incremental/compiler.rs
God Classes · FunctionTooLong: turso_core::dialect::sqlite::resolve_builtin_function core/dialect/sqlite.rs
God Classes · ClassTooLong: LogicalPlanBuilder core/translate/logical.rs
God Classes · FileTooLong: translate/logical.rs core/translate/logical.rs
God Classes · FileTooLong: incremental/compiler.rs core/incremental/compiler.rs
God Classes · ClassTooLong: DbspCompiler core/incremental/compiler.rs
God Classes · ClassTooLong: IncrementalView core/incremental/view.rs
God Classes · MethodTooLong: LogicalPlanBuilder.build_aggregate_internal core/translate/logical.rs
God Classes · MethodTooLong: LogicalPlanBuilder.build_expr core/translate/logical.rs
God Classes · MethodTooLong: DbspCompiler.logical_to_ast_expr_with_schema core/incremental/compiler.rs
Rebuild cost: about €700,000 · Estimate
Cost to rebuild
€230,000 to €1,200,000, for 3,850 to 12,225 hours of work, about 4.8 person-years for 2 to 10 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 41. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Very large: 658,972 lines of product code
Comment lines
The estimate prices 654,324 lines. Comment lines count towards the size of 658,972 lines but aren't priced as work.
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.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault.
Skip if delegated to infra (Postgres TDE, KMS, etc.).
Raises the score by about 21 points · Medium effort · Data Protection
2
Resolve the 8 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED, 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 €700,000 to build again, about 4.8 person-years of work. Its weakest lens is Security and Compliance, at 12 (Critical). 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
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Of all the actions in this report, it raises the score most for the work it takes: about 21 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 6.3 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 4% to 10% on every change. The history of the code shows how much it changes: about 946,333 lines over the last 90 days, which is about 3,837,906 lines a year. At that pace, the extra work comes to an estimated 419.6 to 2517.7 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change, never less than 2% to 5% and never more than 40% to 60% in all; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
670 modules, with 2235 dependencies between them. 9 loops run through 168 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 630 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.
sql_generation.model.query.drop uses sql_generation.generation, so a change to sql_generation.generation can break sql_generation.model.query.drop, while a change to sql_generation.model.query.drop can't break sql_generation.generation.
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.
4→40 sql_generation.model.query.drop uses limbo_sim.runner.envpart of a loop✕
Connections
1 pair of types, where a type in sql_generation.model.query.drop uses a type in limbo_sim.runner.env.
sql_generation.model.query.drop uses limbo_sim.runner.env, so a change to limbo_sim.runner.env can break sql_generation.model.query.drop, while a change to sql_generation.model.query.drop can't break limbo_sim.runner.env.
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.
1 pair of types, where a type in turso_core.time.internal uses a type in turso.value.
The types involved
turso_core.time.internal.Time → turso.value.Value
Direction
turso_core.time.internal uses turso.value, so a change to turso.value can break turso_core.time.internal, while a change to turso_core.time.internal can't break turso.value.
Position
Below the diagonal: turso_core.time.internal uses a module listed above it, which is the healthy direction.
turso_core.vdbe.affinity uses turso.value, so a change to turso.value can break turso_core.vdbe.affinity, while a change to turso_core.vdbe.affinity can't break turso.value.
Position
Below the diagonal: turso_core.vdbe.affinity uses a module listed above it, which is the healthy direction.
7→20 turso_core.vdbe.affinity uses turso_core.translate.emitterpart of a loop✕
Connections
1 pair of types, where a type in turso_core.vdbe.affinity uses a type in turso_core.translate.emitter.
turso_core.vdbe.affinity uses turso_core.translate.emitter, so a change to turso_core.translate.emitter can break turso_core.vdbe.affinity, while a change to turso_core.vdbe.affinity can't break turso_core.translate.emitter.
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.
7→29 turso_core.vdbe.affinity uses turso_core.schemapart of a loop✕
Connections
1 pair of types, where a type in turso_core.vdbe.affinity uses a type in turso_core.schema.
turso_core.vdbe.affinity uses turso_core.schema, so a change to turso_core.schema can break turso_core.vdbe.affinity, while a change to turso_core.vdbe.affinity can't break turso_core.schema.
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.
7→33 turso_core.vdbe.affinity uses turso_core.translate.planpart of a loop✕
Connections
1 pair of types, where a type in turso_core.vdbe.affinity uses a type in turso_core.translate.plan.
turso_core.vdbe.affinity uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_core.vdbe.affinity, while a change to turso_core.vdbe.affinity can't break turso_core.translate.plan.
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.
turso.connection uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso.connection, while a change to turso.connection can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso.connection uses a module listed above it, which is the healthy direction.
turso.connection uses turso_core.time.internal, so a change to turso_core.time.internal can break turso.connection, while a change to turso.connection can't break turso_core.time.internal.
Position
Below the diagonal: turso.connection uses a module listed above it, which is the healthy direction.
turso_core.io.clock uses turso_core.time.internal, so a change to turso_core.time.internal can break turso_core.io.clock, while a change to turso_core.io.clock can't break turso_core.time.internal.
Position
Below the diagonal: turso_core.io.clock uses a module listed above it, which is the healthy direction.
turso_core.skiplist.base uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_core.skiplist.base, while a change to turso_core.skiplist.base can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_core.skiplist.base uses a module listed above it, which is the healthy direction.
sql_generation.generation uses turso_core.skiplist.base, so a change to turso_core.skiplist.base can break sql_generation.generation, while a change to sql_generation.generation can't break turso_core.skiplist.base.
Position
Below the diagonal: sql_generation.generation uses a module listed above it, which is the healthy direction.
turso_core.io uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_core.io, while a change to turso_core.io can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_core.io uses a module listed above it, which is the healthy direction.
turso_core.io uses turso_core.time.internal, so a change to turso_core.time.internal can break turso_core.io, while a change to turso_core.io can't break turso_core.time.internal.
Position
Below the diagonal: turso_core.io uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in turso_core.io uses a type in turso_core.io.clock.
The types involved
turso_core.io.IO → turso_core.io.clock.Clock
Direction
turso_core.io uses turso_core.io.clock, so a change to turso_core.io.clock can break turso_core.io, while a change to turso_core.io can't break turso_core.io.clock.
Position
Below the diagonal: turso_core.io uses a module listed above it, which is the healthy direction.
12→15 turso_core.io uses turso_core.io.completionspart of a loop✕
Connections
4 pairs of types, where a type in turso_core.io uses a type in turso_core.io.completions.
turso_core.io uses turso_core.io.completions, so a change to turso_core.io.completions can break turso_core.io, while a change to turso_core.io can't break turso_core.io.completions.
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.
turso_core.vdbe.builder uses turso.value, so a change to turso.value can break turso_core.vdbe.builder, while a change to turso_core.vdbe.builder can't break turso.value.
Position
Below the diagonal: turso_core.vdbe.builder uses a module listed above it, which is the healthy direction.
turso_core.vdbe.builder uses turso_core.vdbe.affinity, so a change to turso_core.vdbe.affinity can break turso_core.vdbe.builder, while a change to turso_core.vdbe.builder can't break turso_core.vdbe.affinity.
Position
Below the diagonal: turso_core.vdbe.builder uses a module listed above it, which is the healthy direction.
turso_core.vdbe.builder uses turso.connection, so a change to turso.connection can break turso_core.vdbe.builder, while a change to turso_core.vdbe.builder can't break turso.connection.
Position
Below the diagonal: turso_core.vdbe.builder uses a module listed above it, which is the healthy direction.
turso_core.vdbe.builder uses turso_core.skiplist.base, so a change to turso_core.skiplist.base can break turso_core.vdbe.builder, while a change to turso_core.vdbe.builder can't break turso_core.skiplist.base.
Position
Below the diagonal: turso_core.vdbe.builder uses a module listed above it, which is the healthy direction.
13→19 turso_core.vdbe.builder uses turso_core.vdbepart of a loop✕
Connections
3 pairs of types, where a type in turso_core.vdbe.builder uses a type in turso_core.vdbe.
turso_core.vdbe.builder uses turso_core.vdbe, so a change to turso_core.vdbe can break turso_core.vdbe.builder, while a change to turso_core.vdbe.builder can't break turso_core.vdbe.
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.
13→20 turso_core.vdbe.builder uses turso_core.translate.emitterpart of a loop✕
Connections
2 pairs of types, where a type in turso_core.vdbe.builder uses a type in turso_core.translate.emitter.
turso_core.vdbe.builder uses turso_core.translate.emitter, so a change to turso_core.translate.emitter can break turso_core.vdbe.builder, while a change to turso_core.vdbe.builder can't break turso_core.translate.emitter.
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.
13→22 turso_core.vdbe.builder uses turso_core.translate.collatepart of a loop✕
Connections
1 pair of types, where a type in turso_core.vdbe.builder uses a type in turso_core.translate.collate.
turso_core.vdbe.builder uses turso_core.translate.collate, so a change to turso_core.translate.collate can break turso_core.vdbe.builder, while a change to turso_core.vdbe.builder can't break turso_core.translate.collate.
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.
13→29 turso_core.vdbe.builder uses turso_core.schemapart of a loop✕
Connections
9 pairs of types, where a type in turso_core.vdbe.builder uses a type in turso_core.schema.
turso_core.vdbe.builder uses turso_core.schema, so a change to turso_core.schema can break turso_core.vdbe.builder, while a change to turso_core.vdbe.builder can't break turso_core.schema.
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.
13→31 turso_core.vdbe.builder uses turso_parser.astpart of a loop✕
Connections
6 pairs of types, where a type in turso_core.vdbe.builder uses a type in turso_parser.ast.
turso_core.vdbe.builder uses turso_parser.ast, so a change to turso_parser.ast can break turso_core.vdbe.builder, while a change to turso_core.vdbe.builder can't break turso_parser.ast.
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.
13→33 turso_core.vdbe.builder uses turso_core.translate.planpart of a loop✕
Connections
3 pairs of types, where a type in turso_core.vdbe.builder uses a type in turso_core.translate.plan.
turso_core.vdbe.builder uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_core.vdbe.builder, while a change to turso_core.vdbe.builder can't break turso_core.translate.plan.
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.
turso_node uses turso_core.time.internal, so a change to turso_core.time.internal can break turso_node, while a change to turso_node can't break turso_core.time.internal.
Position
Below the diagonal: turso_node uses a module listed above it, which is the healthy direction.
turso_core.io.completions uses turso_core.error, so a change to turso_core.error can break turso_core.io.completions, while a change to turso_core.io.completions can't break turso_core.error.
Position
Below the diagonal: turso_core.io.completions uses a module listed above it, which is the healthy direction.
turso_core.io.completions uses turso_core.io, so a change to turso_core.io can break turso_core.io.completions, while a change to turso_core.io.completions can't break turso_core.io.
Position
Below the diagonal: turso_core.io.completions uses a module listed above it, which is the healthy direction.
turso_core.statement uses turso.value, so a change to turso.value can break turso_core.statement, while a change to turso_core.statement can't break turso.value.
Position
Below the diagonal: turso_core.statement uses a module listed above it, which is the healthy direction.
turso_core.statement uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_core.statement, while a change to turso_core.statement can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_core.statement uses a module listed above it, which is the healthy direction.
turso_core.statement uses turso_core.error, so a change to turso_core.error can break turso_core.statement, while a change to turso_core.statement can't break turso_core.error.
Position
Below the diagonal: turso_core.statement uses a module listed above it, which is the healthy direction.
turso_core.statement uses turso_core.time.internal, so a change to turso_core.time.internal can break turso_core.statement, while a change to turso_core.statement can't break turso_core.time.internal.
Position
Below the diagonal: turso_core.statement uses a module listed above it, which is the healthy direction.
turso_core.statement uses turso_core.vdbe.affinity, so a change to turso_core.vdbe.affinity can break turso_core.statement, while a change to turso_core.statement can't break turso_core.vdbe.affinity.
Position
Below the diagonal: turso_core.statement uses a module listed above it, which is the healthy direction.
turso_core.statement uses turso.connection, so a change to turso.connection can break turso_core.statement, while a change to turso_core.statement can't break turso.connection.
Position
Below the diagonal: turso_core.statement uses a module listed above it, which is the healthy direction.
turso_core.statement uses turso_core.io.clock, so a change to turso_core.io.clock can break turso_core.statement, while a change to turso_core.statement can't break turso_core.io.clock.
Position
Below the diagonal: turso_core.statement uses a module listed above it, which is the healthy direction.
turso_core.statement uses turso_core.vdbe.builder, so a change to turso_core.vdbe.builder can break turso_core.statement, while a change to turso_core.statement can't break turso_core.vdbe.builder.
Position
Below the diagonal: turso_core.statement uses a module listed above it, which is the healthy direction.
16→19 turso_core.statement uses turso_core.vdbepart of a loop✕
Connections
3 pairs of types, where a type in turso_core.statement uses a type in turso_core.vdbe.
turso_core.statement uses turso_core.vdbe, so a change to turso_core.vdbe can break turso_core.statement, while a change to turso_core.statement can't break turso_core.vdbe.
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.
16→24 turso_core.statement uses turso_core.typespart of a loop✕
Connections
1 pair of types, where a type in turso_core.statement uses a type in turso_core.types.
turso_core.statement uses turso_core.types, so a change to turso_core.types can break turso_core.statement, while a change to turso_core.statement can't break turso_core.types.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→26 turso_core.statement uses turso_core.storage.pagerpart of a loop✕
Connections
1 pair of types, where a type in turso_core.statement uses a type in turso_core.storage.pager.
turso_core.statement uses turso_core.storage.pager, so a change to turso_core.storage.pager can break turso_core.statement, while a change to turso_core.statement can't break turso_core.storage.pager.
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.
16→29 turso_core.statement uses turso_core.schemapart of a loop✕
Connections
1 pair of types, where a type in turso_core.statement uses a type in turso_core.schema.
turso_core.statement uses turso_core.schema, so a change to turso_core.schema can break turso_core.statement, while a change to turso_core.statement can't break turso_core.schema.
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.
16→33 turso_core.statement uses turso_core.translate.planpart of a loop✕
Connections
1 pair of types, where a type in turso_core.statement uses a type in turso_core.translate.plan.
turso_core.statement uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_core.statement, while a change to turso_core.statement can't break turso_core.translate.plan.
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.
turso_core.vdbe.execute uses turso.value, so a change to turso.value can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso.value.
Position
Below the diagonal: turso_core.vdbe.execute uses a module listed above it, which is the healthy direction.
turso_core.vdbe.execute uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_core.vdbe.execute uses a module listed above it, which is the healthy direction.
turso_core.vdbe.execute uses turso_core.error, so a change to turso_core.error can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_core.error.
Position
Below the diagonal: turso_core.vdbe.execute uses a module listed above it, which is the healthy direction.
turso_core.vdbe.execute uses turso_core.vdbe.affinity, so a change to turso_core.vdbe.affinity can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_core.vdbe.affinity.
Position
Below the diagonal: turso_core.vdbe.execute uses a module listed above it, which is the healthy direction.
turso_core.vdbe.execute uses turso.connection, so a change to turso.connection can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso.connection.
Position
Below the diagonal: turso_core.vdbe.execute uses a module listed above it, which is the healthy direction.
turso_core.vdbe.execute uses turso_core.io.clock, so a change to turso_core.io.clock can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_core.io.clock.
Position
Below the diagonal: turso_core.vdbe.execute uses a module listed above it, which is the healthy direction.
turso_core.vdbe.execute uses turso_node, so a change to turso_node can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_node.
Position
Below the diagonal: turso_core.vdbe.execute uses a module listed above it, which is the healthy direction.
17→19 turso_core.vdbe.execute uses turso_core.vdbepart of a loop✕
Connections
6 pairs of types, where a type in turso_core.vdbe.execute uses a type in turso_core.vdbe.
turso_core.vdbe.execute uses turso_core.vdbe, so a change to turso_core.vdbe can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_core.vdbe.
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.
17→20 turso_core.vdbe.execute uses turso_core.translate.emitterpart of a loop✕
Connections
1 pair of types, where a type in turso_core.vdbe.execute uses a type in turso_core.translate.emitter.
turso_core.vdbe.execute uses turso_core.translate.emitter, so a change to turso_core.translate.emitter can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_core.translate.emitter.
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.
17→22 turso_core.vdbe.execute uses turso_core.translate.collatepart of a loop✕
Connections
1 pair of types, where a type in turso_core.vdbe.execute uses a type in turso_core.translate.collate.
turso_core.vdbe.execute uses turso_core.translate.collate, so a change to turso_core.translate.collate can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_core.translate.collate.
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.
17→24 turso_core.vdbe.execute uses turso_core.typespart of a loop✕
Connections
4 pairs of types, where a type in turso_core.vdbe.execute uses a type in turso_core.types.
turso_core.vdbe.execute uses turso_core.types, so a change to turso_core.types can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_core.types.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→26 turso_core.vdbe.execute uses turso_core.storage.pagerpart of a loop✕
Connections
1 pair of types, where a type in turso_core.vdbe.execute uses a type in turso_core.storage.pager.
turso_core.vdbe.execute uses turso_core.storage.pager, so a change to turso_core.storage.pager can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_core.storage.pager.
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.
17→27 turso_core.vdbe.execute uses turso_core.mvcc.databasepart of a loop✕
Connections
3 pairs of types, where a type in turso_core.vdbe.execute uses a type in turso_core.mvcc.database.
turso_core.vdbe.execute uses turso_core.mvcc.database, so a change to turso_core.mvcc.database can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_core.mvcc.database.
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.
17→28 turso_core.vdbe.execute uses turso_core.storage.btreepart of a loop✕
Connections
1 pair of types, where a type in turso_core.vdbe.execute uses a type in turso_core.storage.btree.
turso_core.vdbe.execute uses turso_core.storage.btree, so a change to turso_core.storage.btree can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_core.storage.btree.
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.
17→29 turso_core.vdbe.execute uses turso_core.schemapart of a loop✕
Connections
5 pairs of types, where a type in turso_core.vdbe.execute uses a type in turso_core.schema.
turso_core.vdbe.execute uses turso_core.schema, so a change to turso_core.schema can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_core.schema.
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.
17→31 turso_core.vdbe.execute uses turso_parser.astpart of a loop✕
Connections
1 pair of types, where a type in turso_core.vdbe.execute uses a type in turso_parser.ast.
turso_core.vdbe.execute uses turso_parser.ast, so a change to turso_parser.ast can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_parser.ast.
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.
17→34 turso_core.vdbe.execute uses turso_core.functionpart of a loop✕
Connections
2 pairs of types, where a type in turso_core.vdbe.execute uses a type in turso_core.function.
turso_core.vdbe.execute uses turso_core.function, so a change to turso_core.function can break turso_core.vdbe.execute, while a change to turso_core.vdbe.execute can't break turso_core.function.
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.
turso_core.storage.wal uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_core.storage.wal, while a change to turso_core.storage.wal can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_core.storage.wal uses a module listed above it, which is the healthy direction.
turso_core.storage.wal uses turso_core.error, so a change to turso_core.error can break turso_core.storage.wal, while a change to turso_core.storage.wal can't break turso_core.error.
Position
Below the diagonal: turso_core.storage.wal uses a module listed above it, which is the healthy direction.
turso_core.storage.wal uses turso_core.io.clock, so a change to turso_core.io.clock can break turso_core.storage.wal, while a change to turso_core.storage.wal can't break turso_core.io.clock.
Position
Below the diagonal: turso_core.storage.wal uses a module listed above it, which is the healthy direction.
turso_core.storage.wal uses turso_core.io, so a change to turso_core.io can break turso_core.storage.wal, while a change to turso_core.storage.wal can't break turso_core.io.
Position
Below the diagonal: turso_core.storage.wal uses a module listed above it, which is the healthy direction.
turso_core.storage.wal uses turso_core.io.completions, so a change to turso_core.io.completions can break turso_core.storage.wal, while a change to turso_core.storage.wal can't break turso_core.io.completions.
Position
Below the diagonal: turso_core.storage.wal uses a module listed above it, which is the healthy direction.
18→25 turso_core.storage.wal uses turso_core.storage.sqlite3_ondiskpart of a loop✕
Connections
10 pairs of types, where a type in turso_core.storage.wal uses a type in turso_core.storage.sqlite3_ondisk.
turso_core.storage.wal uses turso_core.storage.sqlite3_ondisk, so a change to turso_core.storage.sqlite3_ondisk can break turso_core.storage.wal, while a change to turso_core.storage.wal can't break turso_core.storage.sqlite3_ondisk.
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.
18→26 turso_core.storage.wal uses turso_core.storage.pagerpart of a loop✕
Connections
2 pairs of types, where a type in turso_core.storage.wal uses a type in turso_core.storage.pager.
turso_core.storage.wal uses turso_core.storage.pager, so a change to turso_core.storage.pager can break turso_core.storage.wal, while a change to turso_core.storage.wal can't break turso_core.storage.pager.
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.
turso_core.vdbe uses turso_core.error, so a change to turso_core.error can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso_core.error.
Position
Below the diagonal: turso_core.vdbe uses a module listed above it, which is the healthy direction.
turso_core.vdbe uses turso.connection, so a change to turso.connection can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso.connection.
Position
Below the diagonal: turso_core.vdbe uses a module listed above it, which is the healthy direction.
turso_core.vdbe uses turso_core.io.clock, so a change to turso_core.io.clock can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso_core.io.clock.
Position
Below the diagonal: turso_core.vdbe uses a module listed above it, which is the healthy direction.
turso_core.vdbe uses turso_core.vdbe.builder, so a change to turso_core.vdbe.builder can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso_core.vdbe.builder.
Position
Below the diagonal: turso_core.vdbe uses a module listed above it, which is the healthy direction.
turso_core.vdbe uses turso_core.statement, so a change to turso_core.statement can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso_core.statement.
Position
Below the diagonal: turso_core.vdbe uses a module listed above it, which is the healthy direction.
turso_core.vdbe uses turso_core.vdbe.execute, so a change to turso_core.vdbe.execute can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso_core.vdbe.execute.
Position
Below the diagonal: turso_core.vdbe uses a module listed above it, which is the healthy direction.
19→24 turso_core.vdbe uses turso_core.typespart of a loop✕
Connections
4 pairs of types, where a type in turso_core.vdbe uses a type in turso_core.types.
turso_core.vdbe uses turso_core.types, so a change to turso_core.types can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso_core.types.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→26 turso_core.vdbe uses turso_core.storage.pagerpart of a loop✕
Connections
3 pairs of types, where a type in turso_core.vdbe uses a type in turso_core.storage.pager.
turso_core.vdbe uses turso_core.storage.pager, so a change to turso_core.storage.pager can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso_core.storage.pager.
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.
19→27 turso_core.vdbe uses turso_core.mvcc.databasepart of a loop✕
Connections
3 pairs of types, where a type in turso_core.vdbe uses a type in turso_core.mvcc.database.
turso_core.vdbe uses turso_core.mvcc.database, so a change to turso_core.mvcc.database can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso_core.mvcc.database.
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.
19→29 turso_core.vdbe uses turso_core.schemapart of a loop✕
Connections
1 pair of types, where a type in turso_core.vdbe uses a type in turso_core.schema.
turso_core.vdbe uses turso_core.schema, so a change to turso_core.schema can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso_core.schema.
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.
19→31 turso_core.vdbe uses turso_parser.astpart of a loop✕
Connections
1 pair of types, where a type in turso_core.vdbe uses a type in turso_parser.ast.
turso_core.vdbe uses turso_parser.ast, so a change to turso_parser.ast can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso_parser.ast.
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.
19→33 turso_core.vdbe uses turso_core.translate.planpart of a loop✕
Connections
3 pairs of types, where a type in turso_core.vdbe uses a type in turso_core.translate.plan.
turso_core.vdbe uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso_core.translate.plan.
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.
19→35 turso_core.vdbe uses turso_core.connectionpart of a loop✕
Connections
1 pair of types, where a type in turso_core.vdbe uses a type in turso_core.connection.
turso_core.vdbe uses turso_core.connection, so a change to turso_core.connection can break turso_core.vdbe, while a change to turso_core.vdbe can't break turso_core.connection.
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.
turso_core.translate.emitter uses turso_core.vdbe.affinity, so a change to turso_core.vdbe.affinity can break turso_core.translate.emitter, while a change to turso_core.translate.emitter can't break turso_core.vdbe.affinity.
Position
Below the diagonal: turso_core.translate.emitter uses a module listed above it, which is the healthy direction.
turso_core.translate.emitter uses turso.connection, so a change to turso.connection can break turso_core.translate.emitter, while a change to turso_core.translate.emitter can't break turso.connection.
Position
Below the diagonal: turso_core.translate.emitter uses a module listed above it, which is the healthy direction.
turso_core.translate.emitter uses turso_core.vdbe.builder, so a change to turso_core.vdbe.builder can break turso_core.translate.emitter, while a change to turso_core.translate.emitter can't break turso_core.vdbe.builder.
Position
Below the diagonal: turso_core.translate.emitter uses a module listed above it, which is the healthy direction.
turso_core.translate.emitter uses turso_core.vdbe, so a change to turso_core.vdbe can break turso_core.translate.emitter, while a change to turso_core.translate.emitter can't break turso_core.vdbe.
Position
Below the diagonal: turso_core.translate.emitter uses a module listed above it, which is the healthy direction.
20→22 turso_core.translate.emitter uses turso_core.translate.collatepart of a loop✕
Connections
1 pair of types, where a type in turso_core.translate.emitter uses a type in turso_core.translate.collate.
turso_core.translate.emitter uses turso_core.translate.collate, so a change to turso_core.translate.collate can break turso_core.translate.emitter, while a change to turso_core.translate.emitter can't break turso_core.translate.collate.
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.
20→29 turso_core.translate.emitter uses turso_core.schemapart of a loop✕
Connections
8 pairs of types, where a type in turso_core.translate.emitter uses a type in turso_core.schema.
turso_core.translate.emitter uses turso_core.schema, so a change to turso_core.schema can break turso_core.translate.emitter, while a change to turso_core.translate.emitter can't break turso_core.schema.
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.
20→31 turso_core.translate.emitter uses turso_parser.astpart of a loop✕
Connections
3 pairs of types, where a type in turso_core.translate.emitter uses a type in turso_parser.ast.
turso_core.translate.emitter uses turso_parser.ast, so a change to turso_parser.ast can break turso_core.translate.emitter, while a change to turso_core.translate.emitter can't break turso_parser.ast.
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.
20→33 turso_core.translate.emitter uses turso_core.translate.planpart of a loop✕
Connections
4 pairs of types, where a type in turso_core.translate.emitter uses a type in turso_core.translate.plan.
turso_core.translate.emitter uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_core.translate.emitter, while a change to turso_core.translate.emitter can't break turso_core.translate.plan.
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.
20→35 turso_core.translate.emitter uses turso_core.connectionpart of a loop✕
Connections
3 pairs of types, where a type in turso_core.translate.emitter uses a type in turso_core.connection.
turso_core.translate.emitter uses turso_core.connection, so a change to turso_core.connection can break turso_core.translate.emitter, while a change to turso_core.translate.emitter can't break turso_core.connection.
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.
20→36 turso_core.translate.emitter uses turso_core.databasepart of a loop✕
Connections
1 pair of types, where a type in turso_core.translate.emitter uses a type in turso_core.database.
turso_core.translate.emitter uses turso_core.database, so a change to turso_core.database can break turso_core.translate.emitter, while a change to turso_core.translate.emitter can't break turso_core.database.
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.
20→38 turso_core.translate.emitter uses tursopart of a loop✕
Connections
1 pair of types, where a type in turso_core.translate.emitter uses a type in turso.
turso_core.translate.emitter uses turso, so a change to turso can break turso_core.translate.emitter, while a change to turso_core.translate.emitter can't break turso.
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.
turso_ext.vtabs uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_ext.vtabs, while a change to turso_ext.vtabs can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_ext.vtabs uses a module listed above it, which is the healthy direction.
turso_ext.vtabs uses turso.connection, so a change to turso.connection can break turso_ext.vtabs, while a change to turso_ext.vtabs can't break turso.connection.
Position
Below the diagonal: turso_ext.vtabs uses a module listed above it, which is the healthy direction.
turso_ext.vtabs uses turso_core.vdbe, so a change to turso_core.vdbe can break turso_ext.vtabs, while a change to turso_ext.vtabs can't break turso_core.vdbe.
Position
Below the diagonal: turso_ext.vtabs uses a module listed above it, which is the healthy direction.
turso_core.translate.collate uses turso_core.translate.emitter, so a change to turso_core.translate.emitter can break turso_core.translate.collate, while a change to turso_core.translate.collate can't break turso_core.translate.emitter.
Position
Below the diagonal: turso_core.translate.collate uses a module listed above it, which is the healthy direction.
22→33 turso_core.translate.collate uses turso_core.translate.planpart of a loop✕
Connections
1 pair of types, where a type in turso_core.translate.collate uses a type in turso_core.translate.plan.
turso_core.translate.collate uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_core.translate.collate, while a change to turso_core.translate.collate can't break turso_core.translate.plan.
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.
22→35 turso_core.translate.collate uses turso_core.connectionpart of a loop✕
Connections
1 pair of types, where a type in turso_core.translate.collate uses a type in turso_core.connection.
turso_core.translate.collate uses turso_core.connection, so a change to turso_core.connection can break turso_core.translate.collate, while a change to turso_core.translate.collate can't break turso_core.connection.
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.
turso_pg_parser.ast uses turso_ext.vtabs, so a change to turso_ext.vtabs can break turso_pg_parser.ast, while a change to turso_pg_parser.ast can't break turso_ext.vtabs.
Position
Below the diagonal: turso_pg_parser.ast uses a module listed above it, which is the healthy direction.
23→29 turso_pg_parser.ast uses turso_core.schemapart of a loop✕
Connections
1 pair of types, where a type in turso_pg_parser.ast uses a type in turso_core.schema.
turso_pg_parser.ast uses turso_core.schema, so a change to turso_core.schema can break turso_pg_parser.ast, while a change to turso_pg_parser.ast can't break turso_core.schema.
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.
turso_core.types uses turso_core.error, so a change to turso_core.error can break turso_core.types, while a change to turso_core.types can't break turso_core.error.
Position
Below the diagonal: turso_core.types uses a module listed above it, which is the healthy direction.
turso_core.types uses turso_core.io.completions, so a change to turso_core.io.completions can break turso_core.types, while a change to turso_core.types can't break turso_core.io.completions.
Position
Below the diagonal: turso_core.types uses a module listed above it, which is the healthy direction.
turso_core.types uses turso_core.vdbe, so a change to turso_core.vdbe can break turso_core.types, while a change to turso_core.types can't break turso_core.vdbe.
Position
Below the diagonal: turso_core.types uses a module listed above it, which is the healthy direction.
turso_core.types uses turso_core.translate.collate, so a change to turso_core.translate.collate can break turso_core.types, while a change to turso_core.types can't break turso_core.translate.collate.
Position
Below the diagonal: turso_core.types uses a module listed above it, which is the healthy direction.
24→28 turso_core.types uses turso_core.storage.btreepart of a loop✕
Connections
1 pair of types, where a type in turso_core.types uses a type in turso_core.storage.btree.
turso_core.types uses turso_core.storage.btree, so a change to turso_core.storage.btree can break turso_core.types, while a change to turso_core.types can't break turso_core.storage.btree.
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.
24→29 turso_core.types uses turso_core.schemapart of a loop✕
Connections
1 pair of types, where a type in turso_core.types uses a type in turso_core.schema.
turso_core.types uses turso_core.schema, so a change to turso_core.schema can break turso_core.types, while a change to turso_core.types can't break turso_core.schema.
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.
24→31 turso_core.types uses turso_parser.astpart of a loop✕
Connections
2 pairs of types, where a type in turso_core.types uses a type in turso_parser.ast.
turso_core.types uses turso_parser.ast, so a change to turso_parser.ast can break turso_core.types, while a change to turso_core.types can't break turso_parser.ast.
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.
24→33 turso_core.types uses turso_core.translate.planpart of a loop✕
Connections
1 pair of types, where a type in turso_core.types uses a type in turso_core.translate.plan.
turso_core.types uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_core.types, while a change to turso_core.types can't break turso_core.translate.plan.
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.
24→34 turso_core.types uses turso_core.functionpart of a loop✕
Connections
1 pair of types, where a type in turso_core.types uses a type in turso_core.function.
turso_core.types uses turso_core.function, so a change to turso_core.function can break turso_core.types, while a change to turso_core.types can't break turso_core.function.
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.
24→39 turso_core.types uses sql_generation.model.tablepart of a loop✕
Connections
1 pair of types, where a type in turso_core.types uses a type in sql_generation.model.table.
turso_core.types uses sql_generation.model.table, so a change to sql_generation.model.table can break turso_core.types, while a change to turso_core.types can't break sql_generation.model.table.
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.
turso_core.storage.sqlite3_ondisk uses turso_core.io, so a change to turso_core.io can break turso_core.storage.sqlite3_ondisk, while a change to turso_core.storage.sqlite3_ondisk can't break turso_core.io.
Position
Below the diagonal: turso_core.storage.sqlite3_ondisk uses a module listed above it, which is the healthy direction.
turso_core.storage.sqlite3_ondisk uses turso_core.io.completions, so a change to turso_core.io.completions can break turso_core.storage.sqlite3_ondisk, while a change to turso_core.storage.sqlite3_ondisk can't break turso_core.io.completions.
Position
Below the diagonal: turso_core.storage.sqlite3_ondisk uses a module listed above it, which is the healthy direction.
turso_core.storage.sqlite3_ondisk uses turso_core.storage.wal, so a change to turso_core.storage.wal can break turso_core.storage.sqlite3_ondisk, while a change to turso_core.storage.sqlite3_ondisk can't break turso_core.storage.wal.
Position
Below the diagonal: turso_core.storage.sqlite3_ondisk uses a module listed above it, which is the healthy direction.
turso_core.storage.sqlite3_ondisk uses turso_core.types, so a change to turso_core.types can break turso_core.storage.sqlite3_ondisk, while a change to turso_core.storage.sqlite3_ondisk can't break turso_core.types.
Position
Below the diagonal: turso_core.storage.sqlite3_ondisk uses a module listed above it, which is the healthy direction.
25→26 turso_core.storage.sqlite3_ondisk uses turso_core.storage.pagerpart of a loop✕
Connections
1 pair of types, where a type in turso_core.storage.sqlite3_ondisk uses a type in turso_core.storage.pager.
turso_core.storage.sqlite3_ondisk uses turso_core.storage.pager, so a change to turso_core.storage.pager can break turso_core.storage.sqlite3_ondisk, while a change to turso_core.storage.sqlite3_ondisk can't break turso_core.storage.pager.
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.
turso_core.storage.pager uses turso.connection, so a change to turso.connection can break turso_core.storage.pager, while a change to turso_core.storage.pager can't break turso.connection.
Position
Below the diagonal: turso_core.storage.pager uses a module listed above it, which is the healthy direction.
turso_core.storage.pager uses turso_core.io, so a change to turso_core.io can break turso_core.storage.pager, while a change to turso_core.storage.pager can't break turso_core.io.
Position
Below the diagonal: turso_core.storage.pager uses a module listed above it, which is the healthy direction.
turso_core.storage.pager uses turso_core.io.completions, so a change to turso_core.io.completions can break turso_core.storage.pager, while a change to turso_core.storage.pager can't break turso_core.io.completions.
Position
Below the diagonal: turso_core.storage.pager uses a module listed above it, which is the healthy direction.
turso_core.storage.pager uses turso_core.storage.wal, so a change to turso_core.storage.wal can break turso_core.storage.pager, while a change to turso_core.storage.pager can't break turso_core.storage.wal.
Position
Below the diagonal: turso_core.storage.pager uses a module listed above it, which is the healthy direction.
turso_core.storage.pager uses turso_core.storage.sqlite3_ondisk, so a change to turso_core.storage.sqlite3_ondisk can break turso_core.storage.pager, while a change to turso_core.storage.pager can't break turso_core.storage.sqlite3_ondisk.
Position
Below the diagonal: turso_core.storage.pager uses a module listed above it, which is the healthy direction.
26→27 turso_core.storage.pager uses turso_core.mvcc.databasepart of a loop✕
Connections
5 pairs of types, where a type in turso_core.storage.pager uses a type in turso_core.mvcc.database.
turso_core.storage.pager uses turso_core.mvcc.database, so a change to turso_core.mvcc.database can break turso_core.storage.pager, while a change to turso_core.storage.pager can't break turso_core.mvcc.database.
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.
26→28 turso_core.storage.pager uses turso_core.storage.btreepart of a loop✕
Connections
1 pair of types, where a type in turso_core.storage.pager uses a type in turso_core.storage.btree.
turso_core.storage.pager uses turso_core.storage.btree, so a change to turso_core.storage.btree can break turso_core.storage.pager, while a change to turso_core.storage.pager can't break turso_core.storage.btree.
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.
turso_core.mvcc.database uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_core.mvcc.database uses a module listed above it, which is the healthy direction.
turso_core.mvcc.database uses turso.connection, so a change to turso.connection can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso.connection.
Position
Below the diagonal: turso_core.mvcc.database uses a module listed above it, which is the healthy direction.
turso_core.mvcc.database uses turso_core.io.clock, so a change to turso_core.io.clock can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso_core.io.clock.
Position
Below the diagonal: turso_core.mvcc.database uses a module listed above it, which is the healthy direction.
turso_core.mvcc.database uses turso_core.skiplist.base, so a change to turso_core.skiplist.base can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso_core.skiplist.base.
Position
Below the diagonal: turso_core.mvcc.database uses a module listed above it, which is the healthy direction.
turso_core.mvcc.database uses turso_core.io, so a change to turso_core.io can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso_core.io.
Position
Below the diagonal: turso_core.mvcc.database uses a module listed above it, which is the healthy direction.
turso_core.mvcc.database uses turso_core.io.completions, so a change to turso_core.io.completions can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso_core.io.completions.
Position
Below the diagonal: turso_core.mvcc.database uses a module listed above it, which is the healthy direction.
turso_core.mvcc.database uses turso_core.storage.wal, so a change to turso_core.storage.wal can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso_core.storage.wal.
Position
Below the diagonal: turso_core.mvcc.database uses a module listed above it, which is the healthy direction.
turso_core.mvcc.database uses turso_core.storage.sqlite3_ondisk, so a change to turso_core.storage.sqlite3_ondisk can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso_core.storage.sqlite3_ondisk.
Position
Below the diagonal: turso_core.mvcc.database uses a module listed above it, which is the healthy direction.
turso_core.mvcc.database uses turso_core.storage.pager, so a change to turso_core.storage.pager can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso_core.storage.pager.
Position
Below the diagonal: turso_core.mvcc.database uses a module listed above it, which is the healthy direction.
27→28 turso_core.mvcc.database uses turso_core.storage.btreepart of a loop✕
Connections
3 pairs of types, where a type in turso_core.mvcc.database uses a type in turso_core.storage.btree.
turso_core.mvcc.database uses turso_core.storage.btree, so a change to turso_core.storage.btree can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso_core.storage.btree.
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.
27→29 turso_core.mvcc.database uses turso_core.schemapart of a loop✕
Connections
4 pairs of types, where a type in turso_core.mvcc.database uses a type in turso_core.schema.
turso_core.mvcc.database uses turso_core.schema, so a change to turso_core.schema can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso_core.schema.
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.
27→33 turso_core.mvcc.database uses turso_core.translate.planpart of a loop✕
Connections
2 pairs of types, where a type in turso_core.mvcc.database uses a type in turso_core.translate.plan.
turso_core.mvcc.database uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso_core.translate.plan.
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.
27→35 turso_core.mvcc.database uses turso_core.connectionpart of a loop✕
Connections
2 pairs of types, where a type in turso_core.mvcc.database uses a type in turso_core.connection.
turso_core.mvcc.database uses turso_core.connection, so a change to turso_core.connection can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso_core.connection.
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.
27→38 turso_core.mvcc.database uses tursopart of a loop✕
Connections
6 pairs of types, where a type in turso_core.mvcc.database uses a type in turso.
turso_core.mvcc.database uses turso, so a change to turso can break turso_core.mvcc.database, while a change to turso_core.mvcc.database can't break turso.
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.
turso_core.storage.btree uses turso.value, so a change to turso.value can break turso_core.storage.btree, while a change to turso_core.storage.btree can't break turso.value.
Position
Below the diagonal: turso_core.storage.btree uses a module listed above it, which is the healthy direction.
turso_core.storage.btree uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_core.storage.btree, while a change to turso_core.storage.btree can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_core.storage.btree uses a module listed above it, which is the healthy direction.
turso_core.storage.btree uses turso_core.io.completions, so a change to turso_core.io.completions can break turso_core.storage.btree, while a change to turso_core.storage.btree can't break turso_core.io.completions.
Position
Below the diagonal: turso_core.storage.btree uses a module listed above it, which is the healthy direction.
turso_core.storage.btree uses turso_core.types, so a change to turso_core.types can break turso_core.storage.btree, while a change to turso_core.storage.btree can't break turso_core.types.
Position
Below the diagonal: turso_core.storage.btree uses a module listed above it, which is the healthy direction.
turso_core.storage.btree uses turso_core.storage.sqlite3_ondisk, so a change to turso_core.storage.sqlite3_ondisk can break turso_core.storage.btree, while a change to turso_core.storage.btree can't break turso_core.storage.sqlite3_ondisk.
Position
Below the diagonal: turso_core.storage.btree uses a module listed above it, which is the healthy direction.
turso_core.storage.btree uses turso_core.storage.pager, so a change to turso_core.storage.pager can break turso_core.storage.btree, while a change to turso_core.storage.btree can't break turso_core.storage.pager.
Position
Below the diagonal: turso_core.storage.btree uses a module listed above it, which is the healthy direction.
turso_core.storage.btree uses turso_core.mvcc.database, so a change to turso_core.mvcc.database can break turso_core.storage.btree, while a change to turso_core.storage.btree can't break turso_core.mvcc.database.
Position
Below the diagonal: turso_core.storage.btree uses a module listed above it, which is the healthy direction.
28→29 turso_core.storage.btree uses turso_core.schemapart of a loop✕
Connections
2 pairs of types, where a type in turso_core.storage.btree uses a type in turso_core.schema.
turso_core.storage.btree uses turso_core.schema, so a change to turso_core.schema can break turso_core.storage.btree, while a change to turso_core.storage.btree can't break turso_core.schema.
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.
28→33 turso_core.storage.btree uses turso_core.translate.planpart of a loop✕
Connections
2 pairs of types, where a type in turso_core.storage.btree uses a type in turso_core.translate.plan.
turso_core.storage.btree uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_core.storage.btree, while a change to turso_core.storage.btree can't break turso_core.translate.plan.
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.
1 pair of types, where a type in turso_core.schema uses a type in turso.value.
The types involved
turso_core.schema.Column → turso.value.ValueType
Direction
turso_core.schema uses turso.value, so a change to turso.value can break turso_core.schema, while a change to turso_core.schema can't break turso.value.
Position
Below the diagonal: turso_core.schema uses a module listed above it, which is the healthy direction.
turso_core.schema uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_core.schema, while a change to turso_core.schema can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_core.schema uses a module listed above it, which is the healthy direction.
turso_core.schema uses turso_core.error, so a change to turso_core.error can break turso_core.schema, while a change to turso_core.schema can't break turso_core.error.
Position
Below the diagonal: turso_core.schema uses a module listed above it, which is the healthy direction.
turso_core.schema uses turso_core.vdbe.affinity, so a change to turso_core.vdbe.affinity can break turso_core.schema, while a change to turso_core.schema can't break turso_core.vdbe.affinity.
Position
Below the diagonal: turso_core.schema uses a module listed above it, which is the healthy direction.
turso_core.schema uses turso_core.translate.emitter, so a change to turso_core.translate.emitter can break turso_core.schema, while a change to turso_core.schema can't break turso_core.translate.emitter.
Position
Below the diagonal: turso_core.schema uses a module listed above it, which is the healthy direction.
turso_core.schema uses turso_core.translate.collate, so a change to turso_core.translate.collate can break turso_core.schema, while a change to turso_core.schema can't break turso_core.translate.collate.
Position
Below the diagonal: turso_core.schema uses a module listed above it, which is the healthy direction.
turso_core.schema uses turso_pg_parser.ast, so a change to turso_pg_parser.ast can break turso_core.schema, while a change to turso_core.schema can't break turso_pg_parser.ast.
Position
Below the diagonal: turso_core.schema uses a module listed above it, which is the healthy direction.
turso_core.schema uses turso_core.storage.pager, so a change to turso_core.storage.pager can break turso_core.schema, while a change to turso_core.schema can't break turso_core.storage.pager.
Position
Below the diagonal: turso_core.schema uses a module listed above it, which is the healthy direction.
turso_core.schema uses turso_core.storage.btree, so a change to turso_core.storage.btree can break turso_core.schema, while a change to turso_core.schema can't break turso_core.storage.btree.
Position
Below the diagonal: turso_core.schema uses a module listed above it, which is the healthy direction.
29→31 turso_core.schema uses turso_parser.astpart of a loop✕
Connections
19 pairs of types, where a type in turso_core.schema uses a type in turso_parser.ast.
turso_core.schema uses turso_parser.ast, so a change to turso_parser.ast can break turso_core.schema, while a change to turso_core.schema can't break turso_parser.ast.
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.
29→32 turso_core.schema uses sql_generation.model.query.selectpart of a loop✕
Connections
2 pairs of types, where a type in turso_core.schema uses a type in sql_generation.model.query.select.
turso_core.schema uses sql_generation.model.query.select, so a change to sql_generation.model.query.select can break turso_core.schema, while a change to turso_core.schema can't break sql_generation.model.query.select.
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.
29→33 turso_core.schema uses turso_core.translate.planpart of a loop✕
Connections
9 pairs of types, where a type in turso_core.schema uses a type in turso_core.translate.plan.
turso_core.schema uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_core.schema, while a change to turso_core.schema can't break turso_core.translate.plan.
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.
29→34 turso_core.schema uses turso_core.functionpart of a loop✕
Connections
1 pair of types, where a type in turso_core.schema uses a type in turso_core.function.
turso_core.schema uses turso_core.function, so a change to turso_core.function can break turso_core.schema, while a change to turso_core.schema can't break turso_core.function.
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.
29→35 turso_core.schema uses turso_core.connectionpart of a loop✕
Connections
2 pairs of types, where a type in turso_core.schema uses a type in turso_core.connection.
turso_core.schema uses turso_core.connection, so a change to turso_core.connection can break turso_core.schema, while a change to turso_core.schema can't break turso_core.connection.
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.
turso_core.schema uses sql_generation.model.table, so a change to sql_generation.model.table can break turso_core.schema, while a change to turso_core.schema can't break sql_generation.model.table.
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.
turso_core.translate.optimizer uses turso_core.vdbe.affinity, so a change to turso_core.vdbe.affinity can break turso_core.translate.optimizer, while a change to turso_core.translate.optimizer can't break turso_core.vdbe.affinity.
Position
Below the diagonal: turso_core.translate.optimizer uses a module listed above it, which is the healthy direction.
turso_core.translate.optimizer uses turso_core.vdbe.builder, so a change to turso_core.vdbe.builder can break turso_core.translate.optimizer, while a change to turso_core.translate.optimizer can't break turso_core.vdbe.builder.
Position
Below the diagonal: turso_core.translate.optimizer uses a module listed above it, which is the healthy direction.
turso_core.translate.optimizer uses turso_core.translate.emitter, so a change to turso_core.translate.emitter can break turso_core.translate.optimizer, while a change to turso_core.translate.optimizer can't break turso_core.translate.emitter.
Position
Below the diagonal: turso_core.translate.optimizer uses a module listed above it, which is the healthy direction.
turso_core.translate.optimizer uses turso_core.schema, so a change to turso_core.schema can break turso_core.translate.optimizer, while a change to turso_core.translate.optimizer can't break turso_core.schema.
Position
Below the diagonal: turso_core.translate.optimizer uses a module listed above it, which is the healthy direction.
30→31 turso_core.translate.optimizer uses turso_parser.astpart of a loop✕
Connections
2 pairs of types, where a type in turso_core.translate.optimizer uses a type in turso_parser.ast.
turso_core.translate.optimizer uses turso_parser.ast, so a change to turso_parser.ast can break turso_core.translate.optimizer, while a change to turso_core.translate.optimizer can't break turso_parser.ast.
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.
30→32 turso_core.translate.optimizer uses sql_generation.model.query.selectpart of a loop✕
Connections
2 pairs of types, where a type in turso_core.translate.optimizer uses a type in sql_generation.model.query.select.
turso_core.translate.optimizer uses sql_generation.model.query.select, so a change to sql_generation.model.query.select can break turso_core.translate.optimizer, while a change to turso_core.translate.optimizer can't break sql_generation.model.query.select.
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.
30→33 turso_core.translate.optimizer uses turso_core.translate.planpart of a loop✕
Connections
16 pairs of types, where a type in turso_core.translate.optimizer uses a type in turso_core.translate.plan.
turso_core.translate.optimizer uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_core.translate.optimizer, while a change to turso_core.translate.optimizer can't break turso_core.translate.plan.
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.
turso_parser.ast uses turso_core.skiplist.base, so a change to turso_core.skiplist.base can break turso_parser.ast, while a change to turso_parser.ast can't break turso_core.skiplist.base.
Position
Below the diagonal: turso_parser.ast uses a module listed above it, which is the healthy direction.
turso_parser.ast uses sql_generation.generation, so a change to sql_generation.generation can break turso_parser.ast, while a change to turso_parser.ast can't break sql_generation.generation.
Position
Below the diagonal: turso_parser.ast uses a module listed above it, which is the healthy direction.
turso_parser.ast uses turso_core.translate.emitter, so a change to turso_core.translate.emitter can break turso_parser.ast, while a change to turso_parser.ast can't break turso_core.translate.emitter.
Position
Below the diagonal: turso_parser.ast uses a module listed above it, which is the healthy direction.
1 pair of types, where a type in turso_parser.ast uses a type in turso_ext.vtabs.
The types involved
turso_parser.ast.Cmd → turso_ext.vtabs.Stmt
Direction
turso_parser.ast uses turso_ext.vtabs, so a change to turso_ext.vtabs can break turso_parser.ast, while a change to turso_parser.ast can't break turso_ext.vtabs.
Position
Below the diagonal: turso_parser.ast uses a module listed above it, which is the healthy direction.
turso_parser.ast uses turso_pg_parser.ast, so a change to turso_pg_parser.ast can break turso_parser.ast, while a change to turso_parser.ast can't break turso_pg_parser.ast.
Position
Below the diagonal: turso_parser.ast uses a module listed above it, which is the healthy direction.
turso_parser.ast uses turso_core.schema, so a change to turso_core.schema can break turso_parser.ast, while a change to turso_parser.ast can't break turso_core.schema.
Position
Below the diagonal: turso_parser.ast uses a module listed above it, which is the healthy direction.
turso_parser.ast uses turso_core.translate.optimizer, so a change to turso_core.translate.optimizer can break turso_parser.ast, while a change to turso_parser.ast can't break turso_core.translate.optimizer.
Position
Below the diagonal: turso_parser.ast uses a module listed above it, which is the healthy direction.
31→32 turso_parser.ast uses sql_generation.model.query.selectpart of a loop✕
Connections
9 pairs of types, where a type in turso_parser.ast uses a type in sql_generation.model.query.select.
turso_parser.ast uses sql_generation.model.query.select, so a change to sql_generation.model.query.select can break turso_parser.ast, while a change to turso_parser.ast can't break sql_generation.model.query.select.
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.
31→33 turso_parser.ast uses turso_core.translate.planpart of a loop✕
Connections
2 pairs of types, where a type in turso_parser.ast uses a type in turso_core.translate.plan.
turso_parser.ast uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_parser.ast, while a change to turso_parser.ast can't break turso_core.translate.plan.
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.
31→39 turso_parser.ast uses sql_generation.model.tablepart of a loop✕
Connections
16 pairs of types, where a type in turso_parser.ast uses a type in sql_generation.model.table.
turso_parser.ast uses sql_generation.model.table, so a change to sql_generation.model.table can break turso_parser.ast, while a change to turso_parser.ast can't break sql_generation.model.table.
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.
sql_generation.model.query.select uses sql_generation.generation, so a change to sql_generation.generation can break sql_generation.model.query.select, while a change to sql_generation.model.query.select can't break sql_generation.generation.
Position
Below the diagonal: sql_generation.model.query.select uses a module listed above it, which is the healthy direction.
sql_generation.model.query.select uses turso_parser.ast, so a change to turso_parser.ast can break sql_generation.model.query.select, while a change to sql_generation.model.query.select can't break turso_parser.ast.
Position
Below the diagonal: sql_generation.model.query.select uses a module listed above it, which is the healthy direction.
32→33 sql_generation.model.query.select uses turso_core.translate.planpart of a loop✕
Connections
3 pairs of types, where a type in sql_generation.model.query.select uses a type in turso_core.translate.plan.
sql_generation.model.query.select uses turso_core.translate.plan, so a change to turso_core.translate.plan can break sql_generation.model.query.select, while a change to sql_generation.model.query.select can't break turso_core.translate.plan.
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.
32→39 sql_generation.model.query.select uses sql_generation.model.tablepart of a loop✕
Connections
1 pair of types, where a type in sql_generation.model.query.select uses a type in sql_generation.model.table.
sql_generation.model.query.select uses sql_generation.model.table, so a change to sql_generation.model.table can break sql_generation.model.query.select, while a change to sql_generation.model.query.select can't break sql_generation.model.table.
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.
32→40 sql_generation.model.query.select uses limbo_sim.runner.envpart of a loop✕
Connections
3 pairs of types, where a type in sql_generation.model.query.select uses a type in limbo_sim.runner.env.
sql_generation.model.query.select uses limbo_sim.runner.env, so a change to limbo_sim.runner.env can break sql_generation.model.query.select, while a change to sql_generation.model.query.select can't break limbo_sim.runner.env.
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.
turso_core.translate.plan uses turso_core.vdbe.affinity, so a change to turso_core.vdbe.affinity can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break turso_core.vdbe.affinity.
Position
Below the diagonal: turso_core.translate.plan uses a module listed above it, which is the healthy direction.
turso_core.translate.plan uses turso_core.skiplist.base, so a change to turso_core.skiplist.base can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break turso_core.skiplist.base.
Position
Below the diagonal: turso_core.translate.plan uses a module listed above it, which is the healthy direction.
turso_core.translate.plan uses sql_generation.generation, so a change to sql_generation.generation can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break sql_generation.generation.
Position
Below the diagonal: turso_core.translate.plan uses a module listed above it, which is the healthy direction.
turso_core.translate.plan uses turso_core.vdbe.builder, so a change to turso_core.vdbe.builder can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break turso_core.vdbe.builder.
Position
Below the diagonal: turso_core.translate.plan uses a module listed above it, which is the healthy direction.
turso_core.translate.plan uses turso_core.vdbe, so a change to turso_core.vdbe can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break turso_core.vdbe.
Position
Below the diagonal: turso_core.translate.plan uses a module listed above it, which is the healthy direction.
turso_core.translate.plan uses turso_core.translate.emitter, so a change to turso_core.translate.emitter can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break turso_core.translate.emitter.
Position
Below the diagonal: turso_core.translate.plan uses a module listed above it, which is the healthy direction.
turso_core.translate.plan uses turso_core.translate.collate, so a change to turso_core.translate.collate can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break turso_core.translate.collate.
Position
Below the diagonal: turso_core.translate.plan uses a module listed above it, which is the healthy direction.
turso_core.translate.plan uses turso_core.types, so a change to turso_core.types can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break turso_core.types.
Position
Below the diagonal: turso_core.translate.plan uses a module listed above it, which is the healthy direction.
turso_core.translate.plan uses turso_core.schema, so a change to turso_core.schema can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break turso_core.schema.
Position
Below the diagonal: turso_core.translate.plan uses a module listed above it, which is the healthy direction.
turso_core.translate.plan uses turso_parser.ast, so a change to turso_parser.ast can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break turso_parser.ast.
Position
Below the diagonal: turso_core.translate.plan uses a module listed above it, which is the healthy direction.
turso_core.translate.plan uses sql_generation.model.query.select, so a change to sql_generation.model.query.select can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break sql_generation.model.query.select.
Position
Below the diagonal: turso_core.translate.plan uses a module listed above it, which is the healthy direction.
33→34 turso_core.translate.plan uses turso_core.functionpart of a loop✕
Connections
3 pairs of types, where a type in turso_core.translate.plan uses a type in turso_core.function.
turso_core.translate.plan uses turso_core.function, so a change to turso_core.function can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break turso_core.function.
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.
33→39 turso_core.translate.plan uses sql_generation.model.tablepart of a loop✕
Connections
2 pairs of types, where a type in turso_core.translate.plan uses a type in sql_generation.model.table.
turso_core.translate.plan uses sql_generation.model.table, so a change to sql_generation.model.table can break turso_core.translate.plan, while a change to turso_core.translate.plan can't break sql_generation.model.table.
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.
turso_core.function uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_core.function, while a change to turso_core.function can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_core.function uses a module listed above it, which is the healthy direction.
turso_core.function uses turso.connection, so a change to turso.connection can break turso_core.function, while a change to turso_core.function can't break turso.connection.
Position
Below the diagonal: turso_core.function uses a module listed above it, which is the healthy direction.
turso_core.function uses turso_core.vdbe, so a change to turso_core.vdbe can break turso_core.function, while a change to turso_core.function can't break turso_core.vdbe.
Position
Below the diagonal: turso_core.function uses a module listed above it, which is the healthy direction.
turso_core.function uses turso_core.types, so a change to turso_core.types can break turso_core.function, while a change to turso_core.function can't break turso_core.types.
Position
Below the diagonal: turso_core.function uses a module listed above it, which is the healthy direction.
turso_core.function uses turso_core.translate.plan, so a change to turso_core.translate.plan can break turso_core.function, while a change to turso_core.function can't break turso_core.translate.plan.
Position
Below the diagonal: turso_core.function uses a module listed above it, which is the healthy direction.
turso_core.connection uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_core.connection, while a change to turso_core.connection can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_core.error, so a change to turso_core.error can break turso_core.connection, while a change to turso_core.connection can't break turso_core.error.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_core.time.internal, so a change to turso_core.time.internal can break turso_core.connection, while a change to turso_core.connection can't break turso_core.time.internal.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso.connection, so a change to turso.connection can break turso_core.connection, while a change to turso_core.connection can't break turso.connection.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_core.io, so a change to turso_core.io can break turso_core.connection, while a change to turso_core.connection can't break turso_core.io.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_node, so a change to turso_node can break turso_core.connection, while a change to turso_core.connection can't break turso_node.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_core.statement, so a change to turso_core.statement can break turso_core.connection, while a change to turso_core.connection can't break turso_core.statement.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_core.storage.wal, so a change to turso_core.storage.wal can break turso_core.connection, while a change to turso_core.connection can't break turso_core.storage.wal.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_ext.vtabs, so a change to turso_ext.vtabs can break turso_core.connection, while a change to turso_core.connection can't break turso_ext.vtabs.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_core.translate.collate, so a change to turso_core.translate.collate can break turso_core.connection, while a change to turso_core.connection can't break turso_core.translate.collate.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_core.storage.sqlite3_ondisk, so a change to turso_core.storage.sqlite3_ondisk can break turso_core.connection, while a change to turso_core.connection can't break turso_core.storage.sqlite3_ondisk.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_core.storage.pager, so a change to turso_core.storage.pager can break turso_core.connection, while a change to turso_core.connection can't break turso_core.storage.pager.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_core.mvcc.database, so a change to turso_core.mvcc.database can break turso_core.connection, while a change to turso_core.connection can't break turso_core.mvcc.database.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_core.schema, so a change to turso_core.schema can break turso_core.connection, while a change to turso_core.connection can't break turso_core.schema.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_parser.ast, so a change to turso_parser.ast can break turso_core.connection, while a change to turso_core.connection can't break turso_parser.ast.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
turso_core.connection uses turso_core.function, so a change to turso_core.function can break turso_core.connection, while a change to turso_core.connection can't break turso_core.function.
Position
Below the diagonal: turso_core.connection uses a module listed above it, which is the healthy direction.
35→36 turso_core.connection uses turso_core.databasepart of a loop✕
Connections
1 pair of types, where a type in turso_core.connection uses a type in turso_core.database.
turso_core.connection uses turso_core.database, so a change to turso_core.database can break turso_core.connection, while a change to turso_core.connection can't break turso_core.database.
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.
turso_core.database uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_core.database, while a change to turso_core.database can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso_core.error, so a change to turso_core.error can break turso_core.database, while a change to turso_core.database can't break turso_core.error.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso.connection, so a change to turso.connection can break turso_core.database, while a change to turso_core.database can't break turso.connection.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso_core.io, so a change to turso_core.io can break turso_core.database, while a change to turso_core.database can't break turso_core.io.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso_node, so a change to turso_node can break turso_core.database, while a change to turso_core.database can't break turso_node.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso_core.io.completions, so a change to turso_core.io.completions can break turso_core.database, while a change to turso_core.database can't break turso_core.io.completions.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso_core.storage.wal, so a change to turso_core.storage.wal can break turso_core.database, while a change to turso_core.database can't break turso_core.storage.wal.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso_ext.vtabs, so a change to turso_ext.vtabs can break turso_core.database, while a change to turso_core.database can't break turso_ext.vtabs.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso_core.storage.sqlite3_ondisk, so a change to turso_core.storage.sqlite3_ondisk can break turso_core.database, while a change to turso_core.database can't break turso_core.storage.sqlite3_ondisk.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso_core.storage.pager, so a change to turso_core.storage.pager can break turso_core.database, while a change to turso_core.database can't break turso_core.storage.pager.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso_core.mvcc.database, so a change to turso_core.mvcc.database can break turso_core.database, while a change to turso_core.database can't break turso_core.mvcc.database.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso_core.schema, so a change to turso_core.schema can break turso_core.database, while a change to turso_core.database can't break turso_core.schema.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso_core.function, so a change to turso_core.function can break turso_core.database, while a change to turso_core.database can't break turso_core.function.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_core.database uses turso_core.connection, so a change to turso_core.connection can break turso_core.database, while a change to turso_core.database can't break turso_core.connection.
Position
Below the diagonal: turso_core.database uses a module listed above it, which is the healthy direction.
turso_sdk_kit.rsapi uses turso.value, so a change to turso.value can break turso_sdk_kit.rsapi, while a change to turso_sdk_kit.rsapi can't break turso.value.
Position
Below the diagonal: turso_sdk_kit.rsapi uses a module listed above it, which is the healthy direction.
turso_sdk_kit.rsapi uses sql_generation.model.query.drop, so a change to sql_generation.model.query.drop can break turso_sdk_kit.rsapi, while a change to turso_sdk_kit.rsapi can't break sql_generation.model.query.drop.
Position
Below the diagonal: turso_sdk_kit.rsapi uses a module listed above it, which is the healthy direction.
turso_sdk_kit.rsapi uses turso_core.error, so a change to turso_core.error can break turso_sdk_kit.rsapi, while a change to turso_sdk_kit.rsapi can't break turso_core.error.
Position
Below the diagonal: turso_sdk_kit.rsapi uses a module listed above it, which is the healthy direction.
turso_sdk_kit.rsapi uses turso_core.time.internal, so a change to turso_core.time.internal can break turso_sdk_kit.rsapi, while a change to turso_sdk_kit.rsapi can't break turso_core.time.internal.
Position
Below the diagonal: turso_sdk_kit.rsapi uses a module listed above it, which is the healthy direction.
turso_sdk_kit.rsapi uses turso.connection, so a change to turso.connection can break turso_sdk_kit.rsapi, while a change to turso_sdk_kit.rsapi can't break turso.connection.
Position
Below the diagonal: turso_sdk_kit.rsapi uses a module listed above it, which is the healthy direction.
turso_sdk_kit.rsapi uses turso_core.io, so a change to turso_core.io can break turso_sdk_kit.rsapi, while a change to turso_sdk_kit.rsapi can't break turso_core.io.
Position
Below the diagonal: turso_sdk_kit.rsapi uses a module listed above it, which is the healthy direction.
turso_sdk_kit.rsapi uses turso_core.vdbe.builder, so a change to turso_core.vdbe.builder can break turso_sdk_kit.rsapi, while a change to turso_sdk_kit.rsapi can't break turso_core.vdbe.builder.
Position
Below the diagonal: turso_sdk_kit.rsapi uses a module listed above it, which is the healthy direction.
turso_sdk_kit.rsapi uses turso_node, so a change to turso_node can break turso_sdk_kit.rsapi, while a change to turso_sdk_kit.rsapi can't break turso_node.
Position
Below the diagonal: turso_sdk_kit.rsapi uses a module listed above it, which is the healthy direction.
turso_sdk_kit.rsapi uses turso_core.io.completions, so a change to turso_core.io.completions can break turso_sdk_kit.rsapi, while a change to turso_sdk_kit.rsapi can't break turso_core.io.completions.
Position
Below the diagonal: turso_sdk_kit.rsapi uses a module listed above it, which is the healthy direction.
turso_sdk_kit.rsapi uses turso_core.statement, so a change to turso_core.statement can break turso_sdk_kit.rsapi, while a change to turso_sdk_kit.rsapi can't break turso_core.statement.
Position
Below the diagonal: turso_sdk_kit.rsapi uses a module listed above it, which is the healthy direction.
turso_sdk_kit.rsapi uses turso_core.vdbe, so a change to turso_core.vdbe can break turso_sdk_kit.rsapi, while a change to turso_sdk_kit.rsapi can't break turso_core.vdbe.
Position
Below the diagonal: turso_sdk_kit.rsapi uses a module listed above it, which is the healthy direction.
turso_sdk_kit.rsapi uses turso_core.database, so a change to turso_core.database can break turso_sdk_kit.rsapi, while a change to turso_sdk_kit.rsapi can't break turso_core.database.
Position
Below the diagonal: turso_sdk_kit.rsapi uses a module listed above it, which is the healthy direction.
turso uses turso_core.io.completions, so a change to turso_core.io.completions can break turso, while a change to turso can't break turso_core.io.completions.
Position
Below the diagonal: turso uses a module listed above it, which is the healthy direction.
sql_generation.model.table uses turso.value, so a change to turso.value can break sql_generation.model.table, while a change to sql_generation.model.table can't break turso.value.
Position
Below the diagonal: sql_generation.model.table uses a module listed above it, which is the healthy direction.
sql_generation.model.table uses sql_generation.generation, so a change to sql_generation.generation can break sql_generation.model.table, while a change to sql_generation.model.table can't break sql_generation.generation.
Position
Below the diagonal: sql_generation.model.table uses a module listed above it, which is the healthy direction.
sql_generation.model.table uses turso_pg_parser.ast, so a change to turso_pg_parser.ast can break sql_generation.model.table, while a change to sql_generation.model.table can't break turso_pg_parser.ast.
Position
Below the diagonal: sql_generation.model.table uses a module listed above it, which is the healthy direction.
sql_generation.model.table uses turso_core.schema, so a change to turso_core.schema can break sql_generation.model.table, while a change to sql_generation.model.table can't break turso_core.schema.
Position
Below the diagonal: sql_generation.model.table uses a module listed above it, which is the healthy direction.
sql_generation.model.table uses turso_parser.ast, so a change to turso_parser.ast can break sql_generation.model.table, while a change to sql_generation.model.table can't break turso_parser.ast.
Position
Below the diagonal: sql_generation.model.table uses a module listed above it, which is the healthy direction.
sql_generation.model.table uses turso_core.translate.plan, so a change to turso_core.translate.plan can break sql_generation.model.table, while a change to sql_generation.model.table can't break turso_core.translate.plan.
Position
Below the diagonal: sql_generation.model.table uses a module listed above it, which is the healthy direction.
sql_generation.model.table uses turso, so a change to turso can break sql_generation.model.table, while a change to sql_generation.model.table can't break turso.
Position
Below the diagonal: sql_generation.model.table uses a module listed above it, which is the healthy direction.
limbo_sim.runner.env uses turso_node, so a change to turso_node can break limbo_sim.runner.env, while a change to limbo_sim.runner.env can't break turso_node.
Position
Below the diagonal: limbo_sim.runner.env uses a module listed above it, which is the healthy direction.
limbo_sim.runner.env uses turso_core.translate.emitter, so a change to turso_core.translate.emitter can break limbo_sim.runner.env, while a change to limbo_sim.runner.env can't break turso_core.translate.emitter.
Position
Below the diagonal: limbo_sim.runner.env uses a module listed above it, which is the healthy direction.
limbo_sim.runner.env uses turso_core.schema, so a change to turso_core.schema can break limbo_sim.runner.env, while a change to limbo_sim.runner.env can't break turso_core.schema.
Position
Below the diagonal: limbo_sim.runner.env uses a module listed above it, which is the healthy direction.
limbo_sim.runner.env uses sql_generation.model.table, so a change to sql_generation.model.table can break limbo_sim.runner.env, while a change to limbo_sim.runner.env can't break sql_generation.model.table.
Position
Below the diagonal: limbo_sim.runner.env uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 60% · Adequate · gated by D2 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
781
High / Critical
A03:2025 — Software Supply Chain Failures
64
High / Critical
A02:2025 — Security Misconfiguration
48
High / Critical
A07:2025 — Authentication Failures
16
High / Critical
Roadmap
Immediately secure sensitive data by implementing encryption at rest and managing keys in a vault, while simultaneously resolving end-of-life runtime dependencies to ensure platform stability. Address the significant volume of secrets found in history and the widespread insecure string copy functions identified by static analysis to mitigate critical security risks. Finally, resolve the remaining explicit code debt to complete the health remediation.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Skip if delegated to infra (Postgres TDE, KMS, etc.).
Resolve the 7 NoWarnInCsproj finding(s) in Explicit Debt — start with Turso.EntityFrameworkCore.Sqlite.csproj (2), Turso.Data.csproj, Turso.Data.Sqlite.csproj.
Per-file score 0–10 — a quality signature. Of 500 files carrying findings, judged against the Preview bar: 6% slop · 16% mixed · 78% near-clean.
File
Score
Band
Worst signal
REDACTED
0.3
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.5
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
0.8
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
0.8
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
0.9
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
1.3
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
1.3
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
1.3
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
1.4
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
1.4
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
1.4
Slop
IaC & Container Security: High IaC: REDACTED
REDACTED
1.8
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
2.1
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
2.1
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
2.3
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
2.3
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
2.3
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
2.3
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
2.3
Slop
Static Analysis (SAST): High: REDACTED
REDACTED
2.3
Slop
Static Analysis (SAST): High: REDACTED
How the grades work
Every finding carries one of four grades. Three say how serious it is. The fourth says this
survey could not settle it — and it is a grade, not a gap.
Critical — 806
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 — 3316
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 — 166
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 10
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. 89 of 89 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 — 89 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, 4259 of 4288 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 MEASURED: the .NET half could not be measured — no coverage produced (collector absent, or test run exceeded the inline budget); the JavaScript/TypeScript half could not be measured — the dependency install for examples/react-native/ failed in the analyzer sandbox (npm error code 127), so the suite never ran. This repository's production source spans both ecosystems, and no partial figure is published as if it were the whole: coverage is excluded from the score rather than counted as a near-zero. This is OUR limitation, not a defect in the repo — a coverage step in CI (`cargo llvm-cov`) shows coverage is measured in your own CI. Commit the lcov/Cobertura report it produces and the real number is read on the next scan. You can widen what we reach: optional: commit the lcov/Cobertura report your CI produces, and 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 238 test(s) behind this row are the ones the C# collector could read, and this repository also carries at least 247 test source file(s) (.py, .rs, .java, .ts, .js, .mjs) that it cannot: it parses C# syntax and matches C# test attributes, so a vitest/jest/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 reliability NOT SCORED: this repository's production source spans .cs, .rs, and the rust executor ran against the .rs half and did not finish re-running within its tier budget — so reliability was not measured for the repository as a whole. The .NET suite did build and re-run, and came back with 0 flaky across 2 measured tier(s) (unit: measured (0 flaky); JavaScript/TypeScript (vitest via `yarn install --immutable --mode=skip-build` in bindings/javascript/packages/common/ (1 tests); vitest via `yarn install --immutable --mode=skip-build` in bindings/javascript/packages/native/ (4 tests); vitest via `yarn install --immutable --mode=skip-build` in bindings/javascript/packages/wasm/ (0 tests); vitest via `yarn install --immutable --mode=skip-build` in bindings/javascript/sync/packages/native/ (0 tests); vitest via `yarn install --immutable --mode=skip-build` in bindings/javascript/sync/packages/wasm/ (0 tests); jest via `npm ci --ignore-scripts` in examples/react-native/): measured (0 flaky)) — but that is a figure for one half of the product, and we do not publish a partial one as if it were complete. This is OUR limitation, not a defect in the repo — test reliability is excluded from the score rather than counted. The half was driven by a runner we ship, so this is not a missing-runner gap.
D12 Dependency Hygiene — 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. `dotnet list package` did not return usable output (restore or query failed); no outdated/vulnerable/deprecated data to assess. The tool said: `dotnet list package` exited 1 with no output.
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 a Cargo manifest, but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its Cargo dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D14 License Compliance — measured, with a gap in what it reached — 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 a Python REDACTED/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D15 Churn × Complexity Hotspots — 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. A hotspot's complexity is meant to be the worst body its churn actually touched. For postgres/frontend/functions.rs, fuzz/fuzz_targets/expression.rs that could not be established — the complexity reader for the file reports no body extents, or the history carries no per-line attribution — so the row quotes the file's worst body, which the counted changes may never have touched. The churn count is unaffected.
D17 Explicit Debt — 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 C# workspace loaded this repository's projects but reported a load failure, and the dead-code reference search is unreliable over a graph that did not load cleanly, so it was skipped. The other debt markers on this row were read; dead symbols were not, and their absence from the score is not a finding that the code has none. First load diagnostic: Failure: solution references project 'src\Benchmarks\REDACTED' but the on-disk path is 'REDACTED' (separator/casing mismatch); on a case-sensitive file system MSBuildWorkspace would load 0 of these projects. Loading a corrected copy of the solution.
D17 Explicit Debt — 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 31 deducted marker(s) and the 1.3/KLoC density on this row were taken over this repository's .NET projects ALONE: .rs (534,288 lines, 83% of production source) went unread, because every marker collector on this path is reached through a C# workspace. A read-only sweep of that source finds at least 385 task marker(s) (TODO/FIXME/HACK/XXX) across 129 file(s) that this score does not count — a floor, since only line comments are read there and D17's other eight marker kinds (suppressions, NoWarn, editorconfig severities, empty catches, commented-out code, Obsolete, dead code, preprocessor branches) need a compiler we do not have for that language. The debt in that source is UNMEASURED — its absence from the score above is a gap in this analyzer's language coverage, not a finding that the code carries none.
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.
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.
D23 Boundary Type-Coupling — 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. Large codebase (603,281 production LoC in the .NET projects) with no declared bounded contexts — cross-boundary type coupling is unassessed Bounded contexts cannot be inferred from a codebase that is not physically organised by them (D-321), so with none declared there are no boundaries for the coupling pass to measure across. You can widen what we reach: name this codebase's bounded contexts (≥2 module groups, e.g. per subsystem) so cross-boundary type coupling can 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 — 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 source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — not measured this run — 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. `bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs`, `bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.Aggregates.cs`, `bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.Collations.cs`, `bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.Functions.cs`, `bindings/dotnet/src/Turso.Data/TursoAutomaticSyncCoordinator.cs`, … (+19 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D39 IL Efficiency — 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. IL NOT MEASURED: the analyzer's own build of this repository failed for an ENVIRONMENT reason (exit 1) — MSBuild's engine or the CLR gave up, or our image does not carry the SDK band/targeting pack this repository needs. This is OUR limitation, not a defect in the repo, and it is not a statement that this repository fails to build. D18 owns the question of whether this repository builds; it was not answered here.
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 DockerCompose (.devcontainer/docker-compose.yml). compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.tursodb.volumes.[]: required variable MAIN_GIT_DIR is missing a value: run .devcontainer/init-env.sh to generate .devcontainer/.env; runtime evidence skipped.
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.
P8 Schema migrations — 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. Every other migration runner — DbUp, FluentMigrator, Evolve, Flyway, Liquibase, RoundhousE, a hand-rolled versioned-SQL runner — is invisible to the detector, so an absence here is our blind spot rather than a missing migration strategy in the repository. The card abstains instead of scoring. You can widen what we reach: if the schema is created and evolved by a tool other than EF Core migrations, naming it lets us teach the detector to read it.
PF3 Async & latency hygiene — 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. 5 further occurrence(s) are not listed individually; the score already reflects all 45.
R10 Code Duplication — 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. 32 further occurrence(s) are not listed individually; the score already reflects all 72.
R7 Dead Code — 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. 23 further occurrence(s) are not listed individually; the score already reflects all 63.
Repo exclusion declarations (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
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.
D22 Internal API Consistency: API-surface coherence is an LLM judgement over a sample of the public surface — consistency of intent across the whole API is approximated, not exhaustively verified.
D24 Comment Value: Comment value is measured as redundancy only: a comment that repeats its code's words is found, but a paraphrase in other words, a vague comment, or one the code contradicts is not, and whether a comment is valuable is not claimed. Comments in other scripts or languages, and outside C#, are not judged.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (REDACTED, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
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".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
463 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was turso_core::vdbe::execute::op_function at 380. A further 68 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 ScalarFunc::fmt at 119 — they are counted neither in the figure above nor in this dimension's score. 27 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: core/function.rs (ScalarFunc::fmt at 119), core/vdbe/builder.rs (ProgramBuilder::resolve_labels at 65), testing/differential-oracle/sql_gen/src/context.rs (Context::current_scope at 56), core/pragma.rs (turso_core::pragma::pragma_for at 49), postgres/parser/ast.rs (Stmt::fmt at 47), and 22 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.
+ 129 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 2 bodies over 240 down to 240 or less in Cyclomatic Complexity — start with turso_core::vdbe::execute::op_function (cyclomatic 380), turso_core::vdbe::explain::insn_to_row (cyclomatic 265). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 2 together lifts Cyclomatic Complexity from 4.1 to about 4.6/10, projected with the scoring formula itself and assuming each lands exactly at 240; 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.
+ 200 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 34 bodies over 120 down to 120 or less in Cognitive Complexity — start with turso_core::vdbe::execute::op_function (cognitive 718), turso_core::translate::alter::translate_alter_table (cognitive 346), turso_core::vdbe::execute::op_transaction_inner (cognitive 331). — 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 34 together lifts Cognitive Complexity from 2.0 to about 3.6/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.4 / 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 200 FunctionTooLong finding(s) in God Classes — start with execute.rs (26), REDACTED (12), REDACTED (10). — One of this dimension's main actionable groups (200 warning-level).
Resolve the 139 FileTooLong finding(s) in God Classes — start with REDACTED (13), main.rs (4), lib.rs (3). — One of this dimension's main actionable groups (139 warning-level).
Resolve the 105 MethodTooLong finding(s) in God Classes — start with REDACTED (16), REDACTED (6), REDACTED (6). — One of this dimension's main actionable groups (105 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.
1044 duplicated block group(s) detected. A further 44 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 119 of the 1088 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.
+ 215 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 70 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with REDACTED (7), schema.rs (5), REDACTED (4). — One of this dimension's main actionable groups (70 warning-level).
Resolve the 67 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with REDACTED (6), main.rs (5), parser.rs (4). — One of this dimension's main actionable groups (67 warning-level).
Resolve the 63 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with REDACTED (7), execute.rs (6), hash_table.rs (4). — One of this dimension's main actionable groups (63 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 · Coupling9.4 / 10Stronggated by 5 serious findings✓ 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.
67 production modules (Gradle+Cargo+npm+Go+Python), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; edges a convention plugin adds from buildSrc or build-logic are not visible there; 6 module(s) off the main sequence, with abstractness counted on 53 of the 67 (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: query-result-oracle · ×5
Off the main sequence: @tursodatabase/database-wasm-common
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 10 Low cohesion finding(s) in Cohesion (LCOM4) — start with policy.rs, connection.rs, builder.rs. — One of this dimension's main actionable groups (10 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.
7217 test methods: 5438 unit, 1779 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 172 `it`/`test` case(s) across 12 test file(s) declaring at least one beside 238 .NET test method(s); its tier split is read from package names and paths only. The Rust suite contributes 6117 `#[test]` function(s) across 392 file(s) declaring at least one; its unit/integration split is Cargo's own — 103 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 378 test function(s) across 14 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 100 test case(s) across 5 `_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: 0 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. The java suite(s) contribute 212 test method(s), read from the language model's own test census — every XCTest `test…` method on an XCTestCase, every swift-testing `@Test` and every JUnit/TestNG `@Test`-annotated method, which is those frameworks' own discovery rule. Their tier split is INFERRED from the test target's name and path only, not declared.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.9 / 10Stronggated by 2 serious findings✓ 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.
1 skipped, 1 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 238 tests. Measured on the C# suite only — at least 247 test source file(s) (.py, .rs, .java, .ts, .js, .mjs) went unread, so its test quality is unmeasured and is not in these counts.
No assertions: ReplicaFacadePropagatesItsEffectivePoolingDefaultbindings/dotnet/src/Turso.Tests/SqliteManagedExecutionTests.cs:14
What to do
Resolve the 1 Skipped test finding(s) in Test Quality — start with TursoTests.cs. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 No assertions finding(s) in Test Quality — start with SqliteManagedExecutionTests.cs. — One of this dimension's main actionable groups (1 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 3 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 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 159 packages use a banned license. ★ DEPTH: this repository's MSBuild projects declare 16 direct `PackageReference`(s), and 145 further package(s) were reached beyond them by closing the graph over nuget.org's own nuspec dependency graph — so a banned licence pulled in only by a dependency's OWN dependencies is inside this verdict. A package whose licence nuget.org could not be asked for is not graded, and version ranges are taken at their lower bound, so this is the closure as that graph states it rather than a restored consumer's exact resolution. ★ COVERAGE OF THIS VERDICT: it grades this repository's NuGet package dependencies and nothing else. The repository also declares a Cargo manifest and a Python REDACTED/requirements.txt (pip/uv/Poetry), and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Resolve the 105 Hotspot finding(s) in Churn × Complexity Hotspots — start with REDACTED (9), select.rs (3), main.rs (3). — One of this dimension's main actionable groups (105 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.5 / 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.
174 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is REDACTED. Counted over 707 of the 933 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×5
Further sole-owners (lower concentration)
What to do
Resolve the 5 Off-boarding risk finding(s) in Bus Factor. — One of this dimension's main actionable groups (5 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.
31 deducted debt markers + unmeasured dead symbols across 16251 LoC in the .NET projects (1.3/KLoC) → score 7.4. Dead code not measured: the solution did not load cleanly, so the reference search was skipped. Measured on the .NET source only: .rs (83% of production source) was not read, and carries at least 385 uncounted task marker(s) in 129 file(s).
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 12 EmptyCatchBlock finding(s) in Explicit Debt — start with TursoSyncDatabase.cs (6), TursoAutomaticSyncCoordinator.cs, TursoConnection.cs. — One of this dimension's main actionable groups (12 issue-level).
Resolve the 7 NoWarnInCsproj finding(s) in Explicit Debt — start with Turso.EntityFrameworkCore.Sqlite.csproj (2), Turso.Data.csproj, Turso.Data.Sqlite.csproj. — One of this dimension's main actionable groups (7 issue-level).
Resolve the 1 WriteOnlyPrivateField finding(s) in Explicit Debt — start with TursoRemoteTests.cs. — One of this dimension's main actionable groups (1 issue-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 2 documentation facets pass in full; short on: F2 example. 150 document(s) read across 10 unit(s).
Documentation: no build, run or usage example · ×2bindings/dotnet/src/Turso.Data/README.md:1
What to do
Resolve the 2 Documentation finding(s) in Documentation Quality — start with README.md (2). — One of this dimension's main actionable groups (2 recommendation-level).
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.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.
Resolve the 1 No ADRs found finding(s) in ADR Quality. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D22 · Internal API Consistency10.0 / 10Exemplary○ Nothing flagged
What it measures: Whether the internal API surface is consistent and coherent.
Method: Judged by language model at low temperature over a sample of the public API surface (IsPackable or .Contracts types). Sampled, advisory; confidence discounted by model uncertainty.
0 API inconsistencies among 10 exposed members measured against a convention their peers follow.
✓ On the Gold path — maintain.
Detailed fixes: d22_recommendation.md.
Do you agree with this assessment?
D24 · Comment Value8.2 / 10Strong✓ Tool-verified
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Every inline C# comment compared word by word with the identifiers, literals and constructs of the code it annotates (taken from the syntax); a comment whose words that code already contains is redundant, as are closing-brace labels and generator template text. Comments giving a reason or a reference are kept; other scripts and languages are not judged. Deterministic, exhaustive, advisory.
Resolve the 1 redundant comment finding(s) in Comment Value — start with Program.cs. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d24_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.
12 finding(s): 0 critical, 12 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
REDACTED
What to do
Resolve the 8 REDACTED finding(s) in Secrets (history) — start with REDACTED (2), REDACTED, REDACTED. — One of this dimension's main actionable groups (8 issue-level).
Resolve the 4 High secret finding(s) in Secrets (history) — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
786 finding(s): 0 critical, 743 high, 15 medium, 28 low. 375 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 53 file(s) — `bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs` (line 243), `bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.Aggregates.cs` (lines 121–128, line 193, line 207), `bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.Collations.cs` (lines 58–59, line 81), `bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.Functions.cs` (lines 295–296, line 343), `bindings/dotnet/src/Turso.Data/TursoAutomaticSyncCoordinator.cs` (line 30, line 89, line 102, …), … (+48 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. In 25 of those file(s) — `bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.Aggregates.cs`, `bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.Collations.cs`, `bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.Functions.cs`, `bindings/dotnet/src/Turso.Data/TursoAutomaticSyncStatus.cs`, `bindings/dotnet/src/Turso.Data/TursoRemoteClient.cs`, … (+20 more) — the break is a C# primary constructor, which semgrep's grammar cannot parse and which hides the type from every rule scoped to it; those files were re-scanned from a shadow copy with the constructor's parameter list blanked (line and column preserving), which restores the type to the rules, and 0 additional row(s) came from that pass. Only the header's own parameter list is unread in them. In 2 of those file(s) — `bindings/dotnet/src/Turso.Tests/TursoEfRemoteReplicaTests.cs`, `bindings/dotnet/src/Turso.Tests/TursoRemoteStreamRecoveryTests.cs` — the break is at a TYPE DECLARATION (a C# primary constructor semgrep's grammar cannot parse), so the loss is wider than the named lines: rules scoped to that type see no type to scope to and are blind over its whole body, while rules matching statements keep working there. Absence of a type-scoped finding in those types is not evidence of anything. Separately, one or more rules could not re-parse an embedded snippet in 18 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
+ 30 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 182 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (86), REDACTED (26), REDACTED (16). — One of this dimension's main actionable groups (182 issue-level).
Resolve the 1 REDACTED finding(s) charged to Static Analysis (SAST) — the other 375 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (376 issue-level, 1 of them charged here).
Resolve the 73 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (21), REDACTED (10), REDACTED (9). — One of this dimension's main actionable groups (73 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 Medium CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (4), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 6 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (6 issue-level).
Resolve the 1 Critical vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 19 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (6), REDACTED (4), REDACTED (3). — One of this dimension's main actionable groups (19 warning-level).
Resolve the 16 High IaC finding(s) in IaC & Container Security — start with REDACTED (5), REDACTED (4), REDACTED (3). — One of this dimension's main actionable groups (16 issue-level).
Resolve the 13 Low IaC finding(s) in IaC & Container Security — start with REDACTED (9), REDACTED (3), REDACTED. — One of this dimension's main actionable groups (13 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.
17 of 707 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is extensions/fuzzy/src/translit.rs. Counted over 707 of the 933 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 2 Orphaned knowledge finding(s) in Knowledge Freshness — start with translit.rs, JDBC4DatabaseMetaData.java. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 15 Orphaned file finding(s) in Knowledge Freshness — start with JDBC4PreparedStatement.java, JDBC4Statement.java, JDBC4Connection.java. — One of this dimension's main actionable groups (15 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 5 Change coupling finding(s) in Change Coupling — start with fmt.rs, cli.rs, lexer.rs. — One of this dimension's main actionable groups (5 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 6 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 13 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (13 warning-level).
Resolve the 6 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. 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.
2 end-of-life runtime(s) and 0 end-of-life framework(s), read from 23 platform declaration(s) and 20 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 2 End-of-life runtime finding(s) in Platform End-of-Life — start with Turso.Tests.csproj, rust-toolchain.toml. — One of this dimension's main actionable groups (2 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.
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 singleton services avoid mutable shared instance state that concurrent callers would race on.
Method: Roslyn scan: singleton field mutations unguarded by lock or Interlocked, per type; syntax-based guard detection. Deterministic, traceable per field.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
The namespaces Turso.Raw ↔ Turso.Raw.Public depend on each other. The lightest dependency in the cycle is Turso.Raw.Public → Turso.Raw (Turso.Raw.Public.StartOperationDelegate → Turso.Raw.TursoStatusCode, 4 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — bindings/dotnet/src/Turso.Raw/Public/TursoSyncBindings.cs:418
What to do
Break namespace cycles inside a project by moving the shared type to a namespace both sides can use, or by inverting the back edge behind an interface.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether 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.
`ITursoPlatformClient` declares 49 members: `ListDatabasesAsync`, `CreateDatabaseAsync`, `GetDatabaseAsync`, `DeleteDatabaseAsync`, `GetDatabaseConfigurationAsync`, `UpdateDatabaseConfigurationAsync`, `ListDatabaseInstancesAsync`, `GetDatabaseInstanceAsync`, `CreateDatabaseTokenAsync`, `GetDatabaseUsageAsync`, `GetDatabaseStatsAsync`, `InvalidateDatabaseTokensAsync`, `ListGroupsAsync`, `CreateGroupAsync`, `GetGroupAsync`, `DeleteGroupAsync`, `GetGroupConfigurationAsync`, `UpdateGroupConfigurationAsync`, `TransferGroupAsync`, `UnarchiveGroupAsync`, `AddLocationToGroupAsync`, `RemoveLocationFromGroupAsync`, `UpdateGroupDatabasesAsync`, `CreateGroupTokenAsync`, `InvalidateGroupTokensAsync`, `ListLocationsAsync`, `ListOrganizationsAsync`, `GetOrganizationAsync`, `UpdateOrganizationAsync`, `ListOrganizationPlansAsync`, `ListOrganizationInvoicesAsync`, `GetOrganizationSubscriptionAsync`, `GetOrganizationUsageAsync`, `ListOrganizationMembersAsync`, `AddOrganizationMemberAsync`, `GetOrganizationMemberAsync`, `UpdateMemberRoleAsync`, `RemoveOrganizationMemberAsync`, `ValidateAPITokenAsync`, `ListAPITokensAsync`, and 9 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. (×3) — bindings/dotnet/src/Turso.Platform.Client/obj/net8.0/TursoPlatformClient.generated.cs:29, bindings/dotnet/src/Turso.Platform.Client/obj/net9.0/TursoPlatformClient.generated.cs:29, bindings/dotnet/src/Turso.Platform.Client/obj/net10.0/TursoPlatformClient.generated.cs:29
`NativeStatement` declares 22 required operations: `bindPositionalNull`, `bindPositionalInt`, `bindPositionalDouble`, `bindPositionalBlob`, `bindPositionalText`, `execute`, `step`, `runIo`, `reset`, `finalize`, `nChange`, `columnCount`, `columnName`, `rowValueKind`, `rowValueBytesCount`, `rowValueBytesPtr`, `rowValueText`, `rowValueInt`, `rowValueDouble`, `namedPosition`, `parametersCount`, `getAllRows`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — bindings/react-native/src/types.ts:39
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
`SortedChunk.read` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — core/vdbe/sorter.rs:776
What to do
Keep query handlers read-only — move the writes/event-publishes into a command handler so reads stay safe to retry, cache, and route to a read replica.
Do you agree with this assessment?
C1 · Data Protection0.0 / 10Critical✓ Tool-verified
Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
No data-protection or encryption usage (ASP.NET Data Protection, AES, column encryption, PBKDF2) was found — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.
What to do
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Skip if delegated to infra (Postgres TDE, KMS, etc.).
Enforce HTTPS (UseHttpsRedirection / RequireHttpsMetadata) so data in transit is always encrypted.
Other · Event-Driven — Whether state changes and message publishes are atomic (a transactional outbox) rather than a crash-unsafe dual write.
Method: Roslyn semantic scan (event-driven gated): event-handler methods scanned for DB-save plus bus-publish without a transactional outbox reference. Deterministic, semantic-resolved.
`Schema.handle_schema_row` performs two independent DURABLE writes — a durable state write (`dbsp_state_roots.insert`, :3068) and a second independent durable store write — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox). — core/schema.rs:2976
What to do
Adopt the transactional outbox pattern so DB writes and message publishes commit atomically — no lost or phantom events on a crash.
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords: members that only throw a "not implemented" exception, methods that take inputs and return a constant, async methods that never await, dead `if (false)` / `#if false` branches, and skeleton types most of whose members are holes. A real, objective slice of technical debt.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`GetCustomAttributes`'s body only throws NotSupportedException — sometimes a deliberate contract, often an unfinished stub. Confirm it's intentional. (×2) — bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:633, bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:636
`IsDefined`'s body only throws NotSupportedException — sometimes a deliberate contract, often an unfinished stub. Confirm it's intentional. — bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:639
A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something. — bindings/dotnet/src/Turso.Tests/TursoTests.cs:304
What to do
Clear the softer debt: remove commented-out code and dead branches, re-enable or delete skipped tests, and replace blanket warning suppressions with targeted ones.
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 8 of 14 project(s) that lack one — worth up to 1.1 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.
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 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.
Do you agree with this assessment?
P5 · DR & Backup7.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
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 29 use(s) across 38,417 production line(s) (~0.8/1k). More Span/Memory, pooling (ArrayPool/ObjectPool), stackalloc and ValueTask on the allocation-heavy paths climbs this toward 10.
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.
`run` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — perf/fts/src/main.rs:68
`fs.existsSync` in `analyzeCorruption` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:25, REDACTED:30
`fs.existsSync` in `runPythonTool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:155
`fs.existsSync` in `preserveCorruptDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×3) — REDACTED:271, REDACTED:279, REDACTED:284
`fs.mkdirSync` in `preserveCorruptDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. — REDACTED:272
`fs.copyFileSync` in `preserveCorruptDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs. (×2) — REDACTED:280, REDACTED:285
19 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
`.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). (×13) — bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:190, bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:163, bindings/dotnet/src/Turso.Data/TursoAutomaticSyncCoordinator.cs:49, …
`.GetAwaiter() .GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). (×6) — bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:275, bindings/dotnet/src/Turso.Data/TursoConnection.cs:367, bindings/dotnet/src/Turso.Data/TursoConnection.cs:395, …
`await using … = state.Batch` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. (×3) — bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:109, bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:173, bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:215
`await using … = await ExecuteDbDataReaderAsync( CommandBehavior.Default, cancellati...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:140
`await using … = await state.Batch .ExecuteReaderAsync(behavior & ~CommandBehavior.C...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:221
`await using … = await ExecuteManagedAsync("ExecuteNonQuery", CommandBehavior.Defaul...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:224
`await using … = await ExecuteManagedAsync("ExecuteScalar", CommandBehavior.Default,...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:240
`await using … = await command .ExecuteReaderAsync(CommandBehavior.Default, cancella...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:395
`await using … = new global::Turso.TursoCommand(_connection!.ManagedConnection) { Co...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:356
`await using … = await ExecuteDbDataReaderAsync(CommandBehavior.Default, cancellatio...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`. — bindings/dotnet/src/Turso.Data/TursoBatch.cs:99
What to do
Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
TypeScript/JavaScript: use the promise APIs (fs/promises, a promisified child_process.execFile, the async zlib/crypto functions) and await them instead of the *Sync variants.
Make the call chain async end-to-end and await it — never block on a Task with .Wait()/.GetAwaiter().GetResult().
Do you agree with this assessment?
R1 · Type Safety8.7 / 10Exemplary✓ Tool-verified
React / JS · Code Health — How much of the frontend is typed TypeScript vs untyped JavaScript.
Method: Frontend file inventory: the share of typed TypeScript vs untyped JavaScript across the source tree. Deterministic, exhaustive over frontend files.
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.
9 duplicated blocks under bindings/javascript/sync/packages/ have copies in at least two of the sibling directories common, native, wasm — 8 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — bindings/javascript/sync/packages/native/promise.ts:64
7 of the duplicated blocks reported below have copies in at least two of the sibling directories bindings, serverless under the repository root. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — bindings/javascript/packages/common/promise.ts:151
5 of the duplicated blocks reported below have copies in at least two of the sibling directories packages, sync under bindings/javascript/. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on. — bindings/javascript/packages/wasm/index-vite-dev-hack.ts:6
bindings/javascript/sync/packages/wasm/promise-bundle.ts:1 · bindings/javascript/sync/packages/wasm/promise-default.ts:1 · bindings/javascript/sync/packages/wasm/promise-turbopack-hack.ts:1 · bindings/javascript/sync/packages/wasm/promise-vite-dev-hack.ts:1 — these 4 files are line-for-line copies of one another — 223 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done. — bindings/javascript/sync/packages/wasm/promise-bundle.ts:1
testing/simulator/simulator-docker-runner/github.ts:28 · testing/sqlancer/sqlancer-runner/github.ts:5 — the two spans are one implementation copied and then locally edited — 700 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. — testing/simulator/simulator-docker-runner/github.ts:28
bindings/javascript/sync/packages/native/promise.ts:64 · bindings/javascript/sync/packages/wasm/promise-bundle.ts:66 · bindings/javascript/sync/packages/wasm/promise-default.ts:66 · bindings/javascript/sync/packages/wasm/promise-turbopack-hack.ts:66 · +1 more site(s) not listed — the 5 copies are spread across 5 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. — bindings/javascript/sync/packages/native/promise.ts:64
testing/simulator/simulator-docker-runner/slack.ts:27 · testing/sqlancer/sqlancer-runner/slack.ts:33 — the two spans are one implementation copied and then locally edited — 437 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. — testing/simulator/simulator-docker-runner/slack.ts:27
bindings/javascript/sync/packages/native/promise.ts:210 · bindings/javascript/sync/packages/wasm/promise-bundle.ts:224 · bindings/javascript/sync/packages/wasm/promise-default.ts:224 · bindings/javascript/sync/packages/wasm/promise-turbopack-hack.ts:224 · +1 more site(s) not listed — the 5 copies are spread across 5 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. — bindings/javascript/sync/packages/native/promise.ts:210
serverless/javascript/src/connection.ts:186 · serverless/javascript/src/connection.ts:652 — the two spans are one implementation copied and then locally edited — 464 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one. — serverless/javascript/src/connection.ts:186
bindings/javascript/packages/common/compat.ts:5 · bindings/javascript/packages/common/promise.ts:6 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. — bindings/javascript/packages/common/compat.ts:5
bindings/javascript/packages/wasm/promise-bundle.ts:5 · bindings/javascript/packages/wasm/promise-turbopack-hack.ts:5 · bindings/javascript/packages/wasm/promise-vite-dev-hack.ts:5 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — bindings/javascript/packages/wasm/promise-bundle.ts:5
bindings/javascript/packages/common/promise.ts:571 · bindings/javascript/packages/common/promise.ts:1037 — 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/javascript/packages/common/promise.ts:571
testing/simulator/simulator-docker-runner/levenshtein.ts:7 · testing/sqlancer/sqlancer-runner/levenshtein.ts:8 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — testing/simulator/simulator-docker-runner/levenshtein.ts:7
bindings/javascript/packages/common/compat.ts:68 · bindings/javascript/packages/common/promise.ts:117 — 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. — bindings/javascript/packages/common/compat.ts:68
bindings/javascript/packages/wasm/promise-bundle.ts:18 · bindings/javascript/packages/wasm/promise-default.ts:22 · bindings/javascript/packages/wasm/promise-turbopack-hack.ts:18 · bindings/javascript/packages/wasm/promise-vite-dev-hack.ts:18 — the 4 copies are spread across 4 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. — bindings/javascript/packages/wasm/promise-bundle.ts:18
bindings/javascript/packages/wasm/index-vite-dev-hack.ts:6 · bindings/javascript/sync/packages/wasm/index-vite-dev-hack.ts:14 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — bindings/javascript/packages/wasm/index-vite-dev-hack.ts:6
bindings/javascript/packages/common/compat.ts:225 · bindings/javascript/packages/common/promise.ts:651 — 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. — bindings/javascript/packages/common/compat.ts:225
bindings/javascript/packages/common/promise.ts:151 · serverless/javascript/src/session.ts:57 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — bindings/javascript/packages/common/promise.ts:151
serverless/javascript/src/session.ts:215 · serverless/javascript/src/session.ts:729 — 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. — serverless/javascript/src/session.ts:215
bindings/javascript/packages/common/promise.ts:694 · bindings/javascript/packages/common/promise.ts:995 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — bindings/javascript/packages/common/promise.ts:694
bindings/javascript/sync/packages/wasm/index-bundle.ts:11 · bindings/javascript/sync/packages/wasm/index-default.ts:9 · bindings/javascript/sync/packages/wasm/index-turbopack-hack.ts:11 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported. — bindings/javascript/sync/packages/wasm/index-bundle.ts:11
bindings/javascript/packages/common/promise.ts:403 · bindings/javascript/packages/common/promise.ts:471 · bindings/javascript/sync/packages/native/promise.ts:285 · bindings/javascript/sync/packages/wasm/promise-bundle.ts:295 · +5 more site(s) not listed — the 9 copies are spread across 7 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. — bindings/javascript/packages/common/promise.ts:403
bindings/javascript/packages/wasm/index-bundle.ts:5 · bindings/javascript/packages/wasm/index-default.ts:3 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — bindings/javascript/packages/wasm/index-bundle.ts:5
bindings/javascript/sync/packages/native/promise.ts:140 · bindings/javascript/sync/packages/wasm/promise-bundle.ts:141 · bindings/javascript/sync/packages/wasm/promise-default.ts:141 · bindings/javascript/sync/packages/wasm/promise-turbopack-hack.ts:141 · +1 more site(s) not listed — the 5 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 5 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete. — bindings/javascript/sync/packages/native/promise.ts:140
bindings/javascript/packages/wasm/index-turbopack-hack.ts:6 · bindings/javascript/sync/packages/wasm/index-turbopack-hack.ts:6 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — bindings/javascript/packages/wasm/index-turbopack-hack.ts:6
bindings/javascript/sync/packages/native/promise.ts:299 · bindings/javascript/sync/packages/wasm/promise-bundle.ts:309 · bindings/javascript/sync/packages/wasm/promise-default.ts:309 · bindings/javascript/sync/packages/wasm/promise-turbopack-hack.ts:309 · +1 more site(s) not listed — the 5 copies are spread across 5 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. — bindings/javascript/sync/packages/native/promise.ts:299
bindings/javascript/packages/native/compat.ts:5 · bindings/javascript/packages/native/promise.ts:5 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — bindings/javascript/packages/native/compat.ts:5
bindings/javascript/packages/wasm/index-default.ts:6 · bindings/javascript/packages/wasm/index-turbopack-hack.ts:8 · bindings/javascript/sync/packages/wasm/index-turbopack-hack.ts:8 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — bindings/javascript/packages/wasm/index-default.ts:6
bindings/javascript/packages/common/compat.ts:466 · bindings/javascript/packages/common/promise.ts:1259 — 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. — bindings/javascript/packages/common/compat.ts:466
bindings/javascript/packages/common/promise.ts:1251 · bindings/javascript/packages/common/promise.ts:1294 · bindings/javascript/packages/common/promise.ts:1332 · bindings/javascript/packages/common/promise.ts:1370 — 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. — bindings/javascript/packages/common/promise.ts:1251
bindings/javascript/sync/packages/common/run.ts:298 · bindings/javascript/sync/packages/common/run.ts:312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — bindings/javascript/sync/packages/common/run.ts:298
bindings/javascript/sync/packages/native/turso-server.ts:103 · bindings/javascript/sync/packages/wasm/turso-server-setup.ts:50 — 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. — bindings/javascript/sync/packages/native/turso-server.ts:103
bindings/javascript/packages/common/promise.ts:968 · serverless/javascript/src/connection.ts:627 — 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. — bindings/javascript/packages/common/promise.ts:968
bindings/javascript/packages/common/async-lock.ts:17 · bindings/react-native/src/AsyncLock.ts:28 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. — bindings/javascript/packages/common/async-lock.ts:17
bindings/javascript/packages/common/compat.ts:139 · bindings/javascript/packages/common/promise.ts:326 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — bindings/javascript/packages/common/compat.ts:139
bindings/javascript/packages/common/compat.ts:267 · bindings/javascript/packages/common/compat.ts:323 — 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/javascript/packages/common/compat.ts:267
bindings/javascript/packages/common/promise.ts:1291 · bindings/javascript/packages/common/promise.ts:1329 · bindings/javascript/packages/common/promise.ts:1367 — 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. — bindings/javascript/packages/common/promise.ts:1291
bindings/javascript/packages/wasm-common/index.ts:48 · bindings/javascript/packages/wasm-common/index.ts:66 — 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/javascript/packages/wasm-common/index.ts:48
bindings/javascript/sync/packages/common/remote-writer.ts:88 · bindings/javascript/sync/packages/common/remote-writer.ts:104 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. — bindings/javascript/sync/packages/common/remote-writer.ts:88
serverless/javascript/src/compat.ts:288 · serverless/javascript/src/connection.ts:26 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are. — serverless/javascript/src/compat.ts:288
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.
transition has cyclomatic complexity 37 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — bindings/javascript/turso-sql-split.mjs:137
executeOpLocal has cyclomatic complexity 29 and cognitive complexity 47; 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. — serverless/javascript/differential/parity.test.mjs:457
batch has cyclomatic complexity 27 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. — serverless/javascript/src/session.ts:501
_buildOpArb has cyclomatic complexity 27 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — serverless/javascript/differential/parity.test.mjs:275
(anonymous) has cyclomatic complexity 26 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — serverless/javascript/differential/parity.test.mjs:688
process has cyclomatic complexity 25 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — bindings/javascript/sync/packages/common/run.ts:25
nextToken has cyclomatic complexity 25 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — bindings/javascript/turso-sql-split.mjs:56
batch has cyclomatic complexity 21 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — bindings/javascript/packages/common/compat.ts:288
(anonymous) has cyclomatic complexity 20 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — serverless/javascript/differential/parity.test.mjs:1022
main has cyclomatic complexity 19 and cognitive complexity 52; 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. — testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.ts:510
cellsEqual has cyclomatic complexity 19 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. — serverless/javascript/differential/parity.test.mjs:120
processHttpRequest has cyclomatic complexity 17 and cognitive complexity 23; 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. — bindings/react-native/src/internal/ioProcessor.ts:156
buildSql has cyclomatic complexity 17 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — serverless/javascript/differential/parity.test.mjs:409
executeBatch has cyclomatic complexity 15 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — bindings/javascript/packages/common/promise.ts:757
processCursorEntries has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — serverless/javascript/src/session.ts:393
encodeValue has cyclomatic complexity 14 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — serverless/javascript/src/protocol.ts:124
_buildValueArbs has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — serverless/javascript/differential/parity.test.mjs:212
iterate has cyclomatic complexity 13 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — serverless/javascript/src/statement.ts:259
trackAutocommit has cyclomatic complexity 13 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes. — serverless/javascript/src/session.ts:286
(anonymous) has cyclomatic complexity 13 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive 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. — bindings/javascript/packages/common/promise.ts:819
What to do
Break down the listed branch-heavy functions; aim P95 cyclomatic ≤ 5.
Do you agree with this assessment?
R3 · Large Files5.9 / 10Adequate✓ 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.
bindings/javascript/packages/common/promise.ts has 1327 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — bindings/javascript/packages/common/promise.ts:1
serverless/javascript/src/session.ts has 731 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — serverless/javascript/src/session.ts:1
serverless/javascript/src/connection.ts has 725 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — serverless/javascript/src/connection.ts:1
serverless/javascript/src/compat.ts has 571 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — serverless/javascript/src/compat.ts:1
testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.ts has 549 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.ts:1
bindings/javascript/packages/common/compat.ts has 526 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — bindings/javascript/packages/common/compat.ts:1
bindings/javascript/packages/wasm-common/index.ts has 457 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — bindings/javascript/packages/wasm-common/index.ts:1
bindings/react-native/src/Database.ts has 424 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module. — bindings/react-native/src/Database.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 Coverage5.0 / 10Adequate✓ 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. (×34) — testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.ts:1, bindings/react-native/src/Database.ts:1, bindings/react-native/src/Statement.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 Code8.0 / 10Strong✓ Tool-verified
React / JS · Code Health — Files unreachable from every application/tooling/test entry point, and exports nothing imports (module-graph reachability, D-386).
Method: Dead code: files unreachable from every application/tooling/test entry point plus exports nothing imports, via module-graph reachability. Deterministic, exhaustive over the import graph.
2 file(s) (~1330 LoC) were excluded from dead-code analysis — declare main/module/exports or a conventional entry (src/index.*, an REDACTED script) so reachability can see this package. — serverless/javascript/differential
Nothing imports this binding — it is safe to review for removal. (×38) — bindings/javascript/packages/wasm/index-bundle.ts:18, bindings/javascript/packages/wasm/index-bundle.ts:20, bindings/javascript/packages/wasm/index-bundle.ts:21, …
Nothing imports THIS copy of 'GeneratorHolder' — but bindings/javascript/sync/packages/wasm/index-default.ts:24 in the same directory exports that same name, and it is the copy every import site resolves to. Grepping the name therefore finds live callers that do not reach this binding: it is the dead half of a duplicated pair, left behind when the API moved. Delete it here and keep bindings/javascript/sync/packages/wasm/index-default.ts's, or, if this one is meant to be the survivor, repoint the importers before removing the other. — bindings/javascript/sync/packages/wasm/index-bundle.ts:26
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 bindings/javascript/packages/wasm-common/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. (×2)
Only test files import it (first: testing/conformance/javascript/__test__/compat.test.js:40) — move it to devDependencies. — testing/conformance/javascript/package.json:22
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.
Do you agree with this assessment?
X1 · Async correctness4.1 / 10Weak✓ Tool-verified
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.
Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process. (×19) — bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:190, bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:163, bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:274, …
`SqliteCommand.ExecuteNonQuery` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll). — bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:222
`SqliteCommand.ExecuteScalar` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll). — bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:238
`SqliteCommand.Execute` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll). — bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:253
`SqliteTransaction.Commit` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll). — bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:102
`SqliteTransaction.Execute` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll). (×2) — bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:165, bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:350
`TursoSyncDatabase.ReleaseConnection` is a synchronous helper that blocks (`SemaphoreSlim.Wait`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll). (×2) — bindings/dotnet/src/Turso.Data/TursoConnection.cs:542, bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:140
`TursoReplicaRegistry.ReleaseReference` is a synchronous helper that blocks (`SemaphoreSlim.Wait`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll). — bindings/dotnet/src/Turso.Data/TursoReplicaRegistry.cs:68
`TursoReplicaRegistry.DisposeHolder` is a synchronous helper that blocks (`SemaphoreSlim.Wait`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll). — bindings/dotnet/src/Turso.Data/TursoReplicaRegistry.cs:146
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 document10.0 / 10Exemplary○ Nothing flagged
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.
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 async methods accept a CancellationToken so work can be cancelled (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 74/77 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
No CancellationToken parameter — the body observes an ambient token instead (a field or a context object), so the work does stop on cancellation, but a caller cannot cancel this call independently of the owner that created that token. — bindings/dotnet/src/Turso.Data/TursoReplicaRegistry.cs:73
No CancellationToken parameter — this work can't be stopped early once started. (×2) — bindings/dotnet/src/Turso.Serverless.Client/TursoServerlessConnection.cs:140, bindings/dotnet/src/Turso.Serverless.Client/TursoSession.cs:290
What to do
Thread a CancellationToken through async methods so work stops promptly on cancellation.
Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `ArgumentNullException` tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
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 `foreach` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is enumerating invalidates the enumerator it is holding, so the next `MoveNext` throws `InvalidOperationException` 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. (×10) — bindings/dotnet/src/Turso.Data/TursoAutomaticSyncCoordinator.cs:203, bindings/dotnet/src/Turso.Data/TursoConnection.cs:791, bindings/dotnet/src/Turso.Data/TursoReplicaRegistry.cs:140, …
An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else). (×2) — bindings/dotnet/src/Turso.Serverless.Client/TursoServerlessConnection.cs:232, bindings/dotnet/src/Turso.Serverless.Client/TursoSession.cs:304
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.
Do you agree with this assessment?
X32 · Type resolved by simple name across every loaded assembly10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a plugin lookup names the type it means — searching every assembly loaded into the process for a candidate whose SIMPLE name equals a string supplied at runtime, and taking the first one found, is decided by assembly LOAD ORDER rather than by this source, so the same name can resolve to a different type on the next run.
Method: Roslyn syntax only, no semantic model: every invocation of `First`/`FirstOrDefault`/`Single`/`SingleOrDefault` whose OWN expression subtree contains both a `GetAssemblies()` call and a `GetTypes()`/`GetExportedTypes()` call — a single-element pick out of every type loaded into the process. A nested selector in the same chain sees no `GetAssemblies()` in its own subtree and is outside the population, so one lookup counts once however many links its chain has. A finding additionally needs both remaining halves: the selector must be `First`/`FirstOrDefault` (`Single`/`SingleOrDefault` reports the ambiguity rather than resolving it, and is counted and never reported), and the chain must carry an `==` comparison of `<lambda parameter>.Name` against something that is not a literal. The receiver must be a plain identifier bound by one of the chain’s own lambdas, which places `assembly.GetName().Name == "X"` outside the rule by construction. One exemption: a `.Name` test joined by `&&` to a `FullName`/`AssemblyQualifiedName` test on the same identifier is spared; joined by `||` it is not. 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 nullable reference types are enabled and not undermined by heavy `!` suppression.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
~0.6 `!` suppressions per 1k syntax nodes — 53 suppression(s) across the 83182 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.
What to do
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
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 — 5 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.
P12 CI test-gate honesty — 3 observation(s) recorded · 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.
SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 17 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 6 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 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.
C3 Audit Trail — Repo shows no audit-logging mechanism (IAuditable, an immutable audit log, an EF SaveChanges interceptor) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
C4 Data Retention — Repo shows no data-retention / TTL / cleanup mechanism for personal data — absence of evidence is not evidence of a working control. Define retention periods and a purge/cleanup job (or TTL) in code, or document where retention is enforced, so this dimension can be scored.
C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
Not included — 38 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — no DI registrations detected
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — compose up failed (exit 15 — the compose project is invalid) — error while interpolating services.tursodb.volumes.[]: required variable MAIN_GIT_DIR is missing a value: run .devcontainer/init-env.sh to generate .devcontainer/.env; 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.
C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
D11 Test Reliability — Test reliability not scored — polyglot repository, one half's runner produced no measurement
D12 Dependency Hygiene — Dependency hygiene not measured
D18 Solution Shape — D18 scores the shape of a C#/VB .NET solution, but this repository's production source is mostly .c, .cpp, .go, .java, .kt, .mm, .py, .rs, .swift, .tcl, .ts, .tsx, which the C#/VB workspace does not load — the projects that loaded are an immaterial minority, so solution shape was not assessed for this repository. Not scored — this is a gap in the analyzer's reach, not a verdict about this repository.
D21 Naming Consistency — Naming consistency is measured on C# only; Go, Java, JavaScript, Kotlin, Python, Rust, Swift, TypeScript, html not measured.
D23 Boundary Type-Coupling — Cross-context type coupling could not be assessed — this codebase's bounded contexts are neither declared nor inferable.
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) — 24 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 — IL not measured — the analyzer's build of the target did not succeed
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 dependency cycles — architectural integrity not assessed
D8 Code Coverage — Coverage not measured — .NET and JavaScript/TypeScript suite
DM1 Domain Modelling — applicable but not scored (3 signals for this style, 2 needed — the count is met but a required primary signal is absent): 1 aggregate root(s) (types guarding their own state behind command methods — this language has no AggregateRoot base to inherit); 172 value object(s); 1 domain event(s); its domain events are published by services or handlers — no domain entity raises one; no aggregate is declared and no domain structure surrounds the state-guarding types: not claimed as DDD
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — no mutating command handlers or message consumers detected — idempotency check not applicable
P2 Observability — This repo is a library, not a deployed service — it has no process to operate, so production observability (structured logging, tracing/metrics, health checks) is N/A. A library may log via an injected ILogger, but the absence of operational telemetry is not a defect here. If it grows a host (web API, worker), the dimension reactivates.
P7 Outbound HTTP resilience — not applicable — this isn't a service/API/worker
P8 Schema migrations — EF Core is used, but the schema-migration mechanism could not be identified — this check only recognises EF migrations, so any other migration runner reads as an absence. Our limit, not a verdict on this repository.
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.
S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
EmptyCatchBlock bindings/dotnet/src/Turso.Data/TursoAutomaticSyncCoordinator.cs:203— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock bindings/dotnet/src/Turso.Data/TursoConnection.cs:791— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock bindings/dotnet/src/Turso.Data/TursoReplicaRegistry.cs:140— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:370— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:432— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:447— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:471— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:485— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:548— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock bindings/dotnet/src/Turso.Serverless.Client/HranaHttp.cs:68— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock bindings/dotnet/src/Turso.Serverless.Client/TursoServerlessConnection.cs:232— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock bindings/dotnet/src/Turso.Serverless.Client/TursoSession.cs:304— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
NoWarnInCsproj bindings/dotnet/src/Turso.Data/Turso.Data.csproj:21— 1591 — this project generates an XML documentation file as a build output, so its documentation is something it PUBLISHES to whoever consumes the assembly, and this entry switches off a rule whose only job is to report that documentation missing or malformed. The two decisions sit in the same file and the quiet one wins: the documentation this project ships has holes exactly where the rule would have pointed, no build says so, and the people who meet the gap are downstream — in their editor, at the moment they are trying to use the member. Write the documentation the rule is asking for and drop the code from the list; where only some elements genuinely cannot carry it, narrow the suppression to those sites and give each one its reason, so the rest of the API stays covered. If the documentation was never meant to be consumed, the honest fix is the other line — stop generating the file, so the project no longer publishes something it is choosing not to check.
NoWarnInCsproj bindings/dotnet/src/Turso.Data.Sqlite/Turso.Data.Sqlite.csproj:22— 1591 — this project generates an XML documentation file as a build output, so its documentation is something it PUBLISHES to whoever consumes the assembly, and this entry switches off a rule whose only job is to report that documentation missing or malformed. The two decisions sit in the same file and the quiet one wins: the documentation this project ships has holes exactly where the rule would have pointed, no build says so, and the people who meet the gap are downstream — in their editor, at the moment they are trying to use the member. Write the documentation the rule is asking for and drop the code from the list; where only some elements genuinely cannot carry it, narrow the suppression to those sites and give each one its reason, so the rest of the API stays covered. If the documentation was never meant to be consumed, the honest fix is the other line — stop generating the file, so the project no longer publishes something it is choosing not to check.
NoWarnInCsproj bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Turso.EntityFrameworkCore.Sqlite.csproj:21— 1591 — this project generates an XML documentation file as a build output, so its documentation is something it PUBLISHES to whoever consumes the assembly, and this entry switches off a rule whose only job is to report that documentation missing or malformed. The two decisions sit in the same file and the quiet one wins: the documentation this project ships has holes exactly where the rule would have pointed, no build says so, and the people who meet the gap are downstream — in their editor, at the moment they are trying to use the member. Write the documentation the rule is asking for and drop the code from the list; where only some elements genuinely cannot carry it, narrow the suppression to those sites and give each one its reason, so the rest of the API stays covered. If the documentation was never meant to be consumed, the honest fix is the other line — stop generating the file, so the project no longer publishes something it is choosing not to check.
NoWarnInCsproj bindings/dotnet/src/Turso.Platform.Client/Turso.Platform.Client.csproj:21— 1591 — this project generates an XML documentation file as a build output, so its documentation is something it PUBLISHES to whoever consumes the assembly, and this entry switches off a rule whose only job is to report that documentation missing or malformed. The two decisions sit in the same file and the quiet one wins: the documentation this project ships has holes exactly where the rule would have pointed, no build says so, and the people who meet the gap are downstream — in their editor, at the moment they are trying to use the member. Write the documentation the rule is asking for and drop the code from the list; where only some elements genuinely cannot carry it, narrow the suppression to those sites and give each one its reason, so the rest of the API stays covered. If the documentation was never meant to be consumed, the honest fix is the other line — stop generating the file, so the project no longer publishes something it is choosing not to check.
NoWarnInCsproj bindings/dotnet/src/Turso.Raw/Turso.Raw.csproj:20— 1591 — this project generates an XML documentation file as a build output, so its documentation is something it PUBLISHES to whoever consumes the assembly, and this entry switches off a rule whose only job is to report that documentation missing or malformed. The two decisions sit in the same file and the quiet one wins: the documentation this project ships has holes exactly where the rule would have pointed, no build says so, and the people who meet the gap are downstream — in their editor, at the moment they are trying to use the member. Write the documentation the rule is asking for and drop the code from the list; where only some elements genuinely cannot carry it, narrow the suppression to those sites and give each one its reason, so the rest of the API stays covered. If the documentation was never meant to be consumed, the honest fix is the other line — stop generating the file, so the project no longer publishes something it is choosing not to check.
NoWarnInCsproj bindings/dotnet/src/Turso.Serverless.Client/Turso.Serverless.Client.csproj:21— 1591 — this project generates an XML documentation file as a build output, so its documentation is something it PUBLISHES to whoever consumes the assembly, and this entry switches off a rule whose only job is to report that documentation missing or malformed. The two decisions sit in the same file and the quiet one wins: the documentation this project ships has holes exactly where the rule would have pointed, no build says so, and the people who meet the gap are downstream — in their editor, at the moment they are trying to use the member. Write the documentation the rule is asking for and drop the code from the list; where only some elements genuinely cannot carry it, narrow the suppression to those sites and give each one its reason, so the rest of the API stays covered. If the documentation was never meant to be consumed, the honest fix is the other line — stop generating the file, so the project no longer publishes something it is choosing not to check.
NoWarnInCsproj bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Turso.EntityFrameworkCore.Sqlite.csproj:21— EF1001 — this warning is switched off for the WHOLE project, in every file it builds, including code written years from now: nothing at the call site records that the rule was ever silenced, so the next reader has no reason to look here. Fix what the rule is reporting and drop the code from the list, or — if some occurrences really are legitimate — narrow the suppression to those sites and give each one its reason, so the rule keeps protecting the rest of the project.
Orphaned knowledge extensions/fuzzy/src/translit.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge bindings/java/src/main/java/tech/turso/jdbc4/JDBC4DatabaseMetaData.java:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Namespace dependency cycle bindings/dotnet/src/Turso.Raw/Public/TursoSyncBindings.cs:418— The namespaces Turso.Raw ↔ Turso.Raw.Public depend on each other. The lightest dependency in the cycle is Turso.Raw.Public → Turso.Raw (Turso.Raw.Public.StartOperationDelegate → Turso.Raw.TursoStatusCode, 4 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
AX9 · CQS / query purity· Query writes persistent state on the read path · ×1
Query writes persistent state on the read path: SortedChunk.read core/vdbe/sorter.rs:776— `SortedChunk.read` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
WriteOnlyPrivateField bindings/dotnet/src/Turso.Tests/TursoRemoteTests.cs:1438— private Task _serverTask — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
Dual write (no outbox): Schema.handle_schema_row core/schema.rs:2976— `Schema.handle_schema_row` performs two independent DURABLE writes — a durable state write (`dbsp_state_roots.insert`, :3068) and a second independent durable store write — in one command path with no shared transaction or outbox. A crash between the two leaves the stores diverged (one write committed, the other lost) or emits a phantom record. Wrap both in one transaction, or record the second write in the same store and dispatch it afterwards (a transactional outbox).
turso_core::vdbe::execute::op_function (cognitive 718) core/vdbe/execute.rs:10212— turso_core::vdbe::execute::op_function has cognitive complexity 718 (threshold 15). Drivers by points: if/else 122 (360 pts), match/switch 86 (259 pts), loops 18 (91 pts), boolean chains 8 (nesting depth added 484). 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.
turso_core::translate::alter::translate_alter_table (cognitive 346) REDACTED:729— turso_core::translate::alter::translate_alter_table has cognitive complexity 346 (threshold 15). Drivers by points: if/else 106 (257 pts), loops 19 (46 pts), boolean chains 23, match/switch 7 (20 pts) (nesting depth added 191). 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.
turso_core::vdbe::execute::op_transaction_inner (cognitive 331) core/vdbe/execute.rs:4737— turso_core::vdbe::execute::op_transaction_inner has cognitive complexity 331 (threshold 15). Drivers by points: if/else 70 (275 pts), match/switch 8 (36 pts), boolean chains 19, loops 1 (nesting depth added 233). 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.
turso_core::translate::emitter::update::emit_update_insns (cognitive 244) core/translate/emitter/update.rs:1098— turso_core::translate::emitter::update::emit_update_insns has cognitive complexity 244 (threshold 15). Drivers by points: if/else 105 (186 pts), loops 12 (26 pts), boolean chains 20, match/switch 8 (12 pts) (nesting depth added 99). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_core::schema::create_table (cognitive 203) core/schema.rs:5612— turso_core::schema::create_table has cognitive complexity 203 (threshold 15). Drivers by points: if/else 48 (144 pts), match/switch 8 (26 pts), loops 11 (25 pts), boolean chains 8 (nesting depth added 128). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_core::translate::pragma::query_pragma (cognitive 201) core/translate/pragma.rs:860— turso_core::translate::pragma::query_pragma has cognitive complexity 201 (threshold 15). Drivers by points: if/else 43 (98 pts), loops 23 (58 pts), match/switch 19 (42 pts), boolean chains 3 (nesting depth added 113). 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.
turso_core::translate::expr::binding::bind_and_rewrite_expr (cognitive 189) core/translate/expr/binding.rs:116— turso_core::translate::expr::binding::bind_and_rewrite_expr has cognitive complexity 189 (threshold 15). Drivers by points: if/else 44 (137 pts), loops 9 (42 pts), match/switch 3 (6 pts), boolean chains 4 (nesting depth added 129). 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.
turso_core::translate::optimizer::constraints::constraints_from_where_clause (cognitive 182) core/translate/optimizer/constraints.rs:713— turso_core::translate::optimizer::constraints::constraints_from_where_clause has cognitive complexity 182 (threshold 15). Drivers by points: if/else 31 (116 pts), match/switch 9 (39 pts), loops 6 (14 pts), boolean chains 13 (nesting depth added 123). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_core::vdbe::value::pattern_compare (cognitive 178) core/vdbe/value.rs:1643— turso_core::vdbe::value::pattern_compare has cognitive complexity 178 (threshold 15). Drivers by points: if/else 34 (141 pts), loops 5 (19 pts), boolean chains 12, match/switch 2 (6 pts) (nesting depth added 125). 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.
turso_core::translate::expr::translator::translate_function_call_expr (cognitive 158) core/translate/expr/translator.rs:875— turso_core::translate::expr::translator::translate_function_call_expr has cognitive complexity 158 (threshold 15). Drivers by points: if/else 36 (104 pts), loops 15 (44 pts), match/switch 5 (9 pts), boolean chains 1 (nesting depth added 101). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_core::translate::upsert::emit_upsert (cognitive 156) core/translate/upsert.rs:484— turso_core::translate::upsert::emit_upsert has cognitive complexity 156 (threshold 15). Drivers by points: if/else 67 (122 pts), loops 11 (26 pts), boolean chains 7, match/switch 1 (nesting depth added 70). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_core::translate::optimizer::join::join_lhs_and_rhs (cognitive 155) core/translate/optimizer/join.rs:483— turso_core::translate::optimizer::join::join_lhs_and_rhs has cognitive complexity 155 (threshold 15). Drivers by points: if/else 41 (122 pts), boolean chains 19, loops 4 (8 pts), match/switch 2 (6 pts) (nesting depth added 89). 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.
turso_core::translate::select::prepare_one_select_plan (cognitive 154) core/translate/select.rs:282— turso_core::translate::select::prepare_one_select_plan has cognitive complexity 154 (threshold 15). Drivers by points: if/else 33 (90 pts), loops 15 (37 pts), match/switch 6 (17 pts), boolean chains 10 (nesting depth added 90). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
turso_core::translate::optimizer::join::compute_best_join_order_with_context (cognitive 146) core/translate/optimizer/join.rs:1273— turso_core::translate::optimizer::join::compute_best_join_order_with_context has cognitive complexity 146 (threshold 15). Drivers by points: if/else 36 (110 pts), loops 9 (25 pts), match/switch 4 (9 pts), boolean chains 2 (nesting depth added 95). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_core::vdbe::execute::op_insert (cognitive 146) core/vdbe/execute.rs:13040— turso_core::vdbe::execute::op_insert has cognitive complexity 146 (threshold 15). Drivers by points: if/else 48 (124 pts), match/switch 9 (16 pts), boolean chains 5, loops 1 (nesting depth added 83). 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.
turso_core::functions::datetime::parse_arithmetic_modifier (cognitive 137) core/functions/datetime.rs:648— turso_core::functions::datetime::parse_arithmetic_modifier has cognitive complexity 137 (threshold 15). Drivers by points: if/else 53 (129 pts), boolean chains 8 (nesting depth added 76). 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.
turso_core::json::jsonb::unescape_string (cognitive 130) core/json/jsonb.rs:4086— turso_core::json::jsonb::unescape_string has cognitive complexity 130 (threshold 15). Drivers by points: if/else 24 (110 pts), loops 4 (16 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 100). 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.
turso_core::vdbe::execute::seek_internal::inner (cognitive 129) core/vdbe/execute.rs:6816— turso_core::vdbe::execute::seek_internal::inner has cognitive complexity 129 (threshold 15). Drivers by points: match/switch 17 (65 pts), if/else 25 (60 pts), boolean chains 3, loops 1 (nesting depth added 83). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
turso_core::vdbe::execute::op_alter_column (cognitive 121) core/vdbe/execute.rs:18059— turso_core::vdbe::execute::op_alter_column has cognitive complexity 121 (threshold 15). Drivers by points: if/else 34 (81 pts), loops 19 (38 pts), boolean chains 2 (nesting depth added 66). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_core::storage::btree::integrity_check (cognitive 119) REDACTED:8364— turso_core::storage::btree::integrity_check has cognitive complexity 119 (threshold 15). Drivers by points: if/else 34 (101 pts), loops 4 (9 pts), match/switch 2 (5 pts), boolean chains 4 (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.
turso_core::vdbe::execute::update_agg_payload (cognitive 110) core/vdbe/execute.rs:7590— turso_core::vdbe::execute::update_agg_payload has cognitive complexity 110 (threshold 15). Drivers by points: if/else 39 (80 pts), match/switch 10 (23 pts), loops 1 (5 pts), boolean chains 2 (nesting depth added 58). 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.
turso_core::translate::insert::translate_insert (cognitive 107) core/translate/insert.rs:246— turso_core::translate::insert::translate_insert has cognitive complexity 107 (threshold 15). Drivers by points: if/else 59 (74 pts), boolean chains 21, loops 5 (8 pts), match/switch 2 (4 pts) (nesting depth added 20). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
turso_core::translate::schema::validate (cognitive 105) core/translate/schema.rs:745— turso_core::translate::schema::validate has cognitive complexity 105 (threshold 15). Drivers by points: if/else 19 (65 pts), loops 8 (22 pts), match/switch 3 (15 pts), boolean chains 3 (nesting depth added 72). 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.
turso_core::translate::expr::translator::translate_column_expr (cognitive 100) core/translate/expr/translator.rs:2389— turso_core::translate::expr::translator::translate_column_expr has cognitive complexity 100 (threshold 15). Drivers by points: if/else 43 (91 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 50). 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.
turso_core::vdbe::vacuum::vacuum_in_place_step (cognitive 98) core/vdbe/vacuum.rs:1797— turso_core::vdbe::vacuum::vacuum_in_place_step has cognitive complexity 98 (threshold 15). Drivers by points: if/else 27 (80 pts), match/switch 4 (11 pts), loops 3 (7 pts) (nesting depth added 64). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_core::vdbe::execute::op_function (cyclomatic 380) core/vdbe/execute.rs:10212— turso_core::vdbe::execute::op_function has cyclomatic complexity 380 (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.
turso_core::vdbe::explain::insn_to_row (cyclomatic 265) core/vdbe/explain.rs:52— turso_core::vdbe::explain::insn_to_row has cyclomatic complexity 265 (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.
turso_core::dialect::sqlite::resolve_builtin_function (cyclomatic 235) core/dialect/sqlite/mod.rs:218— turso_core::dialect::sqlite::resolve_builtin_function has cyclomatic complexity 235 (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.
turso_core::translate::alter::translate_alter_table (cyclomatic 147) REDACTED:729— turso_core::translate::alter::translate_alter_table has cyclomatic complexity 147 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::translate::expr::translator::translate_function_call_expr (cyclomatic 134) core/translate/expr/translator.rs:875— turso_core::translate::expr::translator::translate_function_call_expr has cyclomatic complexity 134 (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.
turso_core::translate::pragma::query_pragma (cyclomatic 130) core/translate/pragma.rs:860— turso_core::translate::pragma::query_pragma has cyclomatic complexity 130 (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.
turso_core::translate::emitter::update::emit_update_insns (cyclomatic 123) core/translate/emitter/update.rs:1098— turso_core::translate::emitter::update::emit_update_insns has cyclomatic complexity 123 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::vdbe::execute::op_transaction_inner (cyclomatic 102) core/vdbe/execute.rs:4737— turso_core::vdbe::execute::op_transaction_inner has cyclomatic complexity 102 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::translate::pragma::update_pragma (cyclomatic 96) core/translate/pragma.rs:334— turso_core::translate::pragma::update_pragma has cyclomatic complexity 96 (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.
turso_core::schema::create_table (cyclomatic 84) core/schema.rs:5612— turso_core::schema::create_table 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.
turso_core::translate::insert::translate_insert (cyclomatic 79) core/translate/insert.rs:246— turso_core::translate::insert::translate_insert has cyclomatic complexity 79 (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.
turso_core::translate::upsert::emit_upsert (cyclomatic 70) core/translate/upsert.rs:484— turso_core::translate::upsert::emit_upsert has cyclomatic complexity 70 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::vdbe::execute::update_agg_payload (cyclomatic 69) core/vdbe/execute.rs:7590— turso_core::vdbe::execute::update_agg_payload has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::translate::expr::binding::bind_and_rewrite_expr (cyclomatic 65) core/translate/expr/binding.rs:116— turso_core::translate::expr::binding::bind_and_rewrite_expr has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::translate::select::prepare_one_select_plan (cyclomatic 65) core/translate/select.rs:282— turso_core::translate::select::prepare_one_select_plan has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::translate::optimizer::constraints::constraints_from_where_clause (cyclomatic 61) core/translate/optimizer/constraints.rs:713— turso_core::translate::optimizer::constraints::constraints_from_where_clause has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::translate::expr::vectors::expr_vector_size (cyclomatic 60) core/translate/expr/vectors.rs:4— turso_core::translate::expr::vectors::expr_vector_size has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::functions::datetime::exec_strftime (cyclomatic 59) core/functions/datetime.rs:1262— turso_core::functions::datetime::exec_strftime has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::vdbe::execute::op_insert (cyclomatic 59) core/vdbe/execute.rs:13040— turso_core::vdbe::execute::op_insert has cyclomatic complexity 59 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::translate::translate_inner (cyclomatic 56) core/translate/mod.rs:175— turso_core::translate::translate_inner has cyclomatic complexity 56 (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.
turso_core::translate::optimizer::join::join_lhs_and_rhs (cyclomatic 55) core/translate/optimizer/join.rs:483— turso_core::translate::optimizer::join::join_lhs_and_rhs has cyclomatic complexity 55 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::translate::optimizer::apply_table_access_plan (cyclomatic 53) core/translate/optimizer/mod.rs:3090— turso_core::translate::optimizer::apply_table_access_plan has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::vdbe::execute::op_alter_column (cyclomatic 53) core/vdbe/execute.rs:18059— turso_core::vdbe::execute::op_alter_column has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_core::vdbe::vacuum::vacuum_target_build_step (cyclomatic 53) core/vdbe/vacuum.rs:588— turso_core::vdbe::vacuum::vacuum_target_build_step has cyclomatic complexity 53 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
turso_core::vdbe::value::pattern_compare (cyclomatic 51) core/vdbe/value.rs:1643— turso_core::vdbe::value::pattern_compare has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FunctionTooLong: turso_core::vdbe::explain::insn_to_row core/vdbe/explain.rs:52— FunctionTooLong — turso_core::vdbe::explain::insn_to_row runs 2436 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 2336 over it, 24.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.
FunctionTooLong: turso_core::vdbe::execute::op_function core/vdbe/execute.rs:10212— FunctionTooLong — turso_core::vdbe::execute::op_function runs 1731 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 1631 over it, 17.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::translate::emitter::update::emit_update_insns core/translate/emitter/update.rs:1098— FunctionTooLong — turso_core::translate::emitter::update::emit_update_insns runs 1102 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 1002 over it, 11.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: turso_core::translate::alter::translate_alter_table REDACTED:729— FunctionTooLong — turso_core::translate::alter::translate_alter_table runs 1048 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 948 over it, 10.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::translate::expr::translator::translate_function_call_expr core/translate/expr/translator.rs:875— FunctionTooLong — turso_core::translate::expr::translator::translate_function_call_expr runs 997 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 897 over it, 9.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::translate::upsert::emit_upsert core/translate/upsert.rs:484— FunctionTooLong — turso_core::translate::upsert::emit_upsert runs 866 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 766 over it, 8.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::translate::pragma::query_pragma core/translate/pragma.rs:860— FunctionTooLong — turso_core::translate::pragma::query_pragma runs 794 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 694 over it, 7.94× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::incremental::vdbe_maintenance::aggregate::emit_group_aggregate_rows core/incremental/vdbe_maintenance/aggregate.rs:104— FunctionTooLong — turso_core::incremental::vdbe_maintenance::aggregate::emit_group_aggregate_rows runs 769 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 669 over it, 7.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::translate::insert::translate_insert core/translate/insert.rs:246— FunctionTooLong — turso_core::translate::insert::translate_insert runs 650 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 550 over it, 6.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: turso_core::incremental::vdbe_maintenance::set_op::emit_deduplicating_set_op core/incremental/vdbe_maintenance/set_op.rs:309— FunctionTooLong — turso_core::incremental::vdbe_maintenance::set_op::emit_deduplicating_set_op runs 617 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 517 over it, 6.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.
FunctionTooLong: turso_core::schema::create_table core/schema.rs:5612— FunctionTooLong — turso_core::schema::create_table runs 485 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 385 over it, 4.85× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::translate::schema::translate_drop_table core/translate/schema.rs:1947— FunctionTooLong — turso_core::translate::schema::translate_drop_table runs 484 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 384 over it, 4.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: turso_core::translate::optimizer::constraints::constraints_from_where_clause core/translate/optimizer/constraints.rs:713— FunctionTooLong — turso_core::translate::optimizer::constraints::constraints_from_where_clause runs 470 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 370 over it, 4.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::translate::select::prepare_one_select_plan core/translate/select.rs:282— FunctionTooLong — turso_core::translate::select::prepare_one_select_plan runs 451 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 351 over it, 4.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.
FunctionTooLong: turso_core::translate::optimizer::join::join_lhs_and_rhs core/translate/optimizer/join.rs:483— FunctionTooLong — turso_core::translate::optimizer::join::join_lhs_and_rhs runs 419 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 319 over it, 4.19× 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: turso_core::incremental::vdbe_maintenance::join::emit_semi_or_anti_join core/incremental/vdbe_maintenance/join.rs:730— FunctionTooLong — turso_core::incremental::vdbe_maintenance::join::emit_semi_or_anti_join runs 405 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 305 over it, 4.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: turso_core::vdbe::execute::op_transaction_inner core/vdbe/execute.rs:4737— FunctionTooLong — turso_core::vdbe::execute::op_transaction_inner runs 389 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 289 over it, 3.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::translate::optimizer::apply_table_access_plan core/translate/optimizer/mod.rs:3090— FunctionTooLong — turso_core::translate::optimizer::apply_table_access_plan runs 386 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 286 over it, 3.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::translate::pragma::update_pragma core/translate/pragma.rs:334— FunctionTooLong — turso_core::translate::pragma::update_pragma runs 382 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 282 over it, 3.82× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::storage::btree::integrity_check REDACTED:8364— FunctionTooLong — turso_core::storage::btree::integrity_check runs 363 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 263 over it, 3.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::incremental::vdbe_maintenance::arrangement::emit_output_arrangement core/incremental/vdbe_maintenance/arrangement.rs:28— FunctionTooLong — turso_core::incremental::vdbe_maintenance::arrangement::emit_output_arrangement runs 338 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 238 over it, 3.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: turso_core::translate::integrity_check::translate_integrity_check_for_schema core/translate/integrity_check.rs:180— FunctionTooLong — turso_core::translate::integrity_check::translate_integrity_check_for_schema runs 337 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 237 over it, 3.37× 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: turso_core::dialect::sqlite::resolve_builtin_function core/dialect/sqlite/mod.rs:218— FunctionTooLong — turso_core::dialect::sqlite::resolve_builtin_function runs 319 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 219 over it, 3.19× 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: turso_core::translate::translate_inner core/translate/mod.rs:175— FunctionTooLong — turso_core::translate::translate_inner runs 319 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 219 over it, 3.19× 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: turso_core::vdbe::execute::op_insert core/vdbe/execute.rs:13040— FunctionTooLong — turso_core::vdbe::execute::op_insert runs 310 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 210 over it, 3.10× 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: vdbe/execute.rs core/vdbe/execute.rs— FileTooLong — 13969 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 333 free functions. The bar is 500 significant lines; this is 13469 over it, 27.94× 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 — 6667 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 65% of them inside a single declaration: BTreeCursor (7 blocks, 873-8118), declaring 31 free functions. The bar is 500 significant lines; this is 6167 over it, 13.33× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: REDACTED REDACTED— FileTooLong — 6563 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 6063 over it, 13.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: core/schema.rs core/schema.rs— FileTooLong — 5007 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 4507 over it, 10.01× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 4782 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 71% of them inside a single declaration: PostgreSQLTranslator (2 blocks, 25-5044), declaring 77 free functions. The bar is 500 significant lines; this is 4282 over it, 9.56× 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: REDACTED REDACTED— FileTooLong — 4541 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 75 free functions. The bar is 500 significant lines; this is 4041 over it, 9.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: storage/pager.rs core/storage/pager.rs— FileTooLong — 3936 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 3436 over it, 7.87× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/parser.rs sqlite/parser/src/parser.rs— FileTooLong — 3664 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: Parser (3 blocks, 183-5495). The bar is 500 significant lines; this is 3164 over it, 7.33× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: storage/wal.rs core/storage/wal.rs— FileTooLong — 3640 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 3140 over it, 7.28× 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: optimizer/mod.rs core/translate/optimizer/mod.rs— FileTooLong — 3284 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 57 free functions. The bar is 500 significant lines; this is 2784 over it, 6.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: core/connection.rs core/connection.rs— FileTooLong — 3084 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 92% of them inside a single declaration: Connection (3 blocks, 363-5018). The bar is 500 significant lines; this is 2584 over it, 6.17× 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: translate/insert.rs core/translate/insert.rs— FileTooLong — 3076 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 42 free functions. The bar is 500 significant lines; this is 2576 over it, 6.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: core/util.rs core/util.rs— FileTooLong — 2818 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 93 free functions. The bar is 500 significant lines; this is 2318 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: src/database_sync_operations.rs sync/engine/src/database_sync_operations.rs— FileTooLong — 2813 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 96 free functions. The bar is 500 significant lines; this is 2313 over it, 5.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: json/jsonb.rs core/json/jsonb.rs— FileTooLong — 2733 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 62% of them inside a single declaration: Jsonb (4 blocks, 189-3525). The bar is 500 significant lines; this is 2233 over it, 5.47× 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: vdbe/mod.rs core/vdbe/mod.rs— FileTooLong — 2609 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 2109 over it, 5.22× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: REDACTED REDACTED— FileTooLong — 2602 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 2102 over it, 5.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: translate/plan.rs core/translate/plan.rs— FileTooLong — 2599 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 2099 over it, 5.20× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/lib.rs bindings/c/src/lib.rs— FileTooLong — 2543 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 181 free functions. The bar is 500 significant lines; this is 2043 over it, 5.09× 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: vdbe/explain.rs core/vdbe/explain.rs— FileTooLong — 2498 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 1998 over it, 5.00× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: expr/translator.rs core/translate/expr/translator.rs— FileTooLong — 2470 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 1970 over it, 4.94× 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: database/checkpoint_state_machine.rs core/mvcc/database/checkpoint_state_machine.rs— FileTooLong — 2422 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 78% of them inside a single declaration: CheckpointStateMachine (4 blocks, 287-3674). The bar is 500 significant lines; this is 1922 over it, 4.84× 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: translate/window.rs core/translate/window.rs— FileTooLong — 2410 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 1910 over it, 4.82× 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 — 2403 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 66% of them inside a single declaration: FtsCursor (4 blocks, 1019-3742). The bar is 500 significant lines; this is 1903 over it, 4.81× 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: core/types.rs core/types.rs— FileTooLong — 2358 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 1858 over it, 4.72× 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.
Hotspot: core/vdbe/execute.rs core/vdbe/execute.rs:10212— core/vdbe/execute.rs changed 227 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 380 in turso_core::vdbe::execute::op_function at line 10212. 9 of those changes were fix/bug commits, and the other 218 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/vdbe/execute.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:2887— REDACTED changed 182 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in PostgreSQLTranslator::translate_expr at line 2887. 3 of those changes were fix/bug commits, and the other 179 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02: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: REDACTED REDACTED:3111— REDACTED changed 86 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in CommitStateMachine::step at line 3111. 6 of those changes were fix/bug commits, and the other 80 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02: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: core/vdbe/explain.rs core/vdbe/explain.rs:52— core/vdbe/explain.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 265 in turso_core::vdbe::explain::insn_to_row at line 52. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/vdbe/explain.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:3604— REDACTED changed 81 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 87 in BTreeCursor::balance_non_root at line 3604. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02: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: core/vdbe/mod.rs core/vdbe/mod.rs:3458— core/vdbe/mod.rs changed 89 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in Program::abort at line 3458. 3 of those changes were fix/bug commits, and the other 86 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/vdbe/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: core/schema.rs core/schema.rs:5612— core/schema.rs changed 77 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 84 in turso_core::schema::create_table at line 5612. 4 of those changes were fix/bug commits, and the other 73 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/schema.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:729— REDACTED changed 43 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 147 in turso_core::translate::alter::translate_alter_table at line 729. 1 of those changes was a fix/bug commit, and the other 42 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02: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: core/translate/expr/translator.rs core/translate/expr/translator.rs:875— core/translate/expr/translator.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 134 in turso_core::translate::expr::translator::translate_function_call_expr at line 875. 3 of those changes were fix/bug commits, and the other 32 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/translate/expr/translator.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: core/translate/emitter/update.rs core/translate/emitter/update.rs:1098— core/translate/emitter/update.rs changed 37 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 123 in turso_core::translate::emitter::update::emit_update_insns at line 1098. 1 of those changes was a fix/bug commit, and the other 36 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-28..2026-10-26, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-28 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/translate/emitter/update.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: core/translate/optimizer/mod.rs core/translate/optimizer/mod.rs:3970— core/translate/optimizer/mod.rs changed 79 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 54 in Expr::is_nonnull at line 3970. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/translate/optimizer/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: core/mvcc/database/checkpoint_state_machine.rs core/mvcc/database/checkpoint_state_machine.rs:2465— core/mvcc/database/checkpoint_state_machine.rs changed 35 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 108 in CheckpointStateMachine::step_inner at line 2465. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/mvcc/database/checkpoint_state_machine.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: core/translate/insert.rs core/translate/insert.rs:246— core/translate/insert.rs changed 47 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 79 in turso_core::translate::insert::translate_insert at line 246. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/translate/insert.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: core/translate/pragma.rs core/translate/pragma.rs:860— core/translate/pragma.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 130 in turso_core::translate::pragma::query_pragma at line 860. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/translate/pragma.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: core/dialect/sqlite/mod.rs core/dialect/sqlite/mod.rs:218— core/dialect/sqlite/mod.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 235 in turso_core::dialect::sqlite::resolve_builtin_function at line 218. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/dialect/sqlite/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: core/vdbe/builder.rs core/vdbe/builder.rs:1711— core/vdbe/builder.rs changed 40 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in ProgramBuilder::resolve_labels at line 1711. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/vdbe/builder.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: core/storage/pager.rs core/storage/pager.rs:4537— core/storage/pager.rs changed 55 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in Pager::commit_wal_inner at line 4537. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/storage/pager.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: core/json/jsonb.rs core/json/jsonb.rs:2698— core/json/jsonb.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 67 in Jsonb::navigate_to_segment at line 2698. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/json/jsonb.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: core/translate/optimizer/join.rs core/translate/optimizer/join.rs:483— core/translate/optimizer/join.rs changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 55 in turso_core::translate::optimizer::join::join_lhs_and_rhs at line 483. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/translate/optimizer/join.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: core/translate/optimizer/constraints.rs core/translate/optimizer/constraints.rs:713— core/translate/optimizer/constraints.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in turso_core::translate::optimizer::constraints::constraints_from_where_clause at line 713. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/translate/optimizer/constraints.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: core/translate/select.rs core/translate/select.rs:282— core/translate/select.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 65 in turso_core::translate::select::prepare_one_select_plan at line 282. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/translate/select.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: core/database.rs core/database.rs:1972— core/database.rs changed 44 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in Database::header_validation at line 1972. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/database.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: core/function.rs core/function.rs:1141— core/function.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 119 in ScalarFunc::fmt at line 1141. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/function.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:1401— REDACTED changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in FtsCursor::drive_open at line 1401. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02: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: core/translate/upsert.rs core/translate/upsert.rs:484— core/translate/upsert.rs changed 23 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 70 in turso_core::translate::upsert::emit_upsert at line 484. 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 05:32:56 +02:00' --until='2026-10-26 05:32:56 +02:00' --full-history --no-merges -- core/translate/upsert.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
MethodTooLong: Property.interactions testing/simulator/generation/property.rs:294— MethodTooLong — interactions runs 890 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 790 over it, 8.90× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BTreeCursor.balance_non_root REDACTED:3604— MethodTooLong — balance_non_root runs 816 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 716 over it, 8.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CheckpointStateMachine.step_inner core/mvcc/database/checkpoint_state_machine.rs:2465— MethodTooLong — step_inner runs 721 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 621 over it, 7.21× 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: DatabaseSyncEngine.apply_changes_internal sync/engine/src/database_sync_engine.rs:2183— MethodTooLong — apply_changes_internal runs 700 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 600 over it, 7.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Stmt.to_tokens sqlite/parser/src/ast/fmt.rs:248— MethodTooLong — to_tokens runs 517 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 417 over it, 5.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: VectorSparseInvertedIndexMethodCursor.query_start core/index_method/toy_vector_sparse_ivf.rs:1042— MethodTooLong — query_start runs 430 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 330 over it, 4.30× 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: MvStore.recover_process_frame REDACTED:9732— MethodTooLong — recover_process_frame runs 375 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 275 over it, 3.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: InitLoop.emit core/translate/main_loop/init.rs:40— MethodTooLong — emit runs 370 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 270 over it, 3.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: SequenceCorrectnessProperty.finish_op testing/concurrent-simulator/properties.rs:1190— MethodTooLong — finish_op runs 367 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 267 over it, 3.67× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Jsonb.navigate_to_segment core/json/jsonb.rs:2698— MethodTooLong — navigate_to_segment runs 361 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 261 over it, 3.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CommitStateMachine.step REDACTED:3111— MethodTooLong — step runs 361 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 261 over it, 3.61× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: EmitWindow.emit_window_step core/translate/window.rs:1384— MethodTooLong — emit_window_step runs 304 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 204 over it, 3.04× 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: FtsCursor.drive_open REDACTED:1401— MethodTooLong — drive_open runs 303 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 203 over it, 3.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BTreeCursor.post_balance_non_root_validation REDACTED:4991— MethodTooLong — post_balance_non_root_validation runs 289 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 189 over it, 2.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PostgreSQLTranslator.translate_expr REDACTED:2887— MethodTooLong — translate_expr runs 278 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 178 over it, 2.78× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Database.header_validation core/database.rs:1972— MethodTooLong — header_validation runs 250 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 150 over it, 2.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: BTreeCursor.delete REDACTED:7028— MethodTooLong — delete runs 245 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 145 over it, 2.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Program.abort core/vdbe/mod.rs:3458— MethodTooLong — abort runs 224 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 124 over it, 2.24× 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: PgConstraintTable.load_rows REDACTED:1642— MethodTooLong — load_rows runs 224 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 124 over it, 2.24× 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: Expr.to_tokens sqlite/parser/src/ast/fmt.rs:890— MethodTooLong — to_tokens runs 215 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 115 over it, 2.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Jsonb.deserialize_string core/json/jsonb.rs:1802— MethodTooLong — deserialize_string runs 211 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 111 over it, 2.11× 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: VectorSparseInvertedIndexMethodCursor.delete core/index_method/toy_vector_sparse_ivf.rs:770— MethodTooLong — delete runs 210 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 110 over it, 2.10× 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.parse_primary_expression postgres/parser/parser.rs:953— MethodTooLong — parse_primary_expression runs 208 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 108 over it, 2.08× 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: VectorSparseInvertedIndexMethodCursor.insert core/index_method/toy_vector_sparse_ivf.rs:505— MethodTooLong — insert runs 206 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 106 over it, 2.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.
MethodTooLong: PreparedHashBuild.emit core/translate/main_loop/hash.rs:230— MethodTooLong — emit runs 197 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Duplicated block (10 lines × 2) core/functions/printf.rs:1113— core/functions/printf.rs:1113-1122 | core/functions/printf.rs:1177-1186 — both copies are in the same file, so extract the block into 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) core/incremental/vdbe_maintenance/arrangement.rs:140— core/incremental/vdbe_maintenance/arrangement.rs:140-149 | core/incremental/vdbe_maintenance/consolidate.rs:89-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 (10 lines × 2) core/incremental/vdbe_maintenance/arrangement.rs:388— core/incremental/vdbe_maintenance/arrangement.rs:388-397 | core/incremental/vdbe_maintenance/set_op.rs:180-189 — 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) core/index_method/toy_vector_sparse_ivf.rs:1334— core/index_method/toy_vector_sparse_ivf.rs:1334-1343 | core/index_method/toy_vector_sparse_ivf.rs:1352-1361 — both copies are in the same file, so extract the block into 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) core/io/io_uring.rs:859— core/io/io_uring.rs:859-868 | core/io/unix.rs:502-511 — before extracting anything, compare `core/io/io_uring.rs` and `core/io/unix.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 lines × 2) core/json/jsonb.rs:1138— core/json/jsonb.rs:1138-1147 | core/json/jsonb.rs:1198-1207 — both copies are in the same file, so extract the block into 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) core/json/jsonb.rs:1656— core/json/jsonb.rs:1656-1665 | core/json/jsonb.rs:1754-1763 — both copies are in the same file, so extract the block into 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) core/json/mod.rs:320— core/json/mod.rs:320-329 | core/json/mod.rs:340-349 — both copies are in the same file, so extract the block into 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) core/json/mod.rs:1097— core/json/mod.rs:1097-1106 | core/translate/eqp.rs:598-607 — 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) REDACTED:5660— REDACTED:5660-5669 | REDACTED:5823-5832 — both copies are in the same file, so extract the block into 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) core/schema.rs:2602— core/schema.rs:2602-2611 | core/schema.rs:2732-2741 — both copies are in the same file, so extract the block into 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) core/schema.rs:3777— core/schema.rs:3777-3786 | core/schema.rs:3802-3811 — both copies are in the same file, so extract the block into 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) core/schema.rs:5836— core/schema.rs:5836-5845 | core/schema.rs:6680-6689 — both copies are in the same file, so extract the block into 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) core/statement.rs:1007— core/statement.rs:1007-1016 | core/statement.rs:1040-1049 — both copies are in the same file, so extract the block into 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) REDACTED:2382— REDACTED:2382-2391 | REDACTED:3011-3020 — both copies are in the same file, so extract the block into 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) core/storage/sqlite3_ondisk.rs:858— core/storage/sqlite3_ondisk.rs:858-867 | core/storage/sqlite3_ondisk.rs:896-905 — both copies are in the same file, so extract the block into 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) core/translate/emitter/mod.rs:1755— core/translate/emitter/mod.rs:1755-1764 | core/translate/emitter/mod.rs:1875-1884 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/translate/expr/translator.rs:1548— core/translate/expr/translator.rs:1548-1557 | core/translate/expr/translator.rs:1841-1852 — both copies are in the same file, so extract the block into 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) core/translate/expr/walk.rs:70— core/translate/expr/walk.rs:70-79 | core/translate/expr/walk.rs:405-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 (10 lines × 2) core/translate/index.rs:1351— core/translate/index.rs:1351-1362 | core/translate/schema.rs:2479-2488 — before extracting anything, compare `core/translate/index.rs` and `core/translate/schema.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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) core/translate/plan.rs:2786— core/translate/plan.rs:2786-2795 | core/translate/plan.rs:2799-2808 — both copies are in the same file, so extract the block into 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) core/translate/planner.rs:2111— core/translate/planner.rs:2111-2120 | core/translate/planner.rs:2153-2162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) core/translate/schema.rs:1089— core/translate/schema.rs:1089-1101 | core/translate/values.rs:105-114 — 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) core/translate/view.rs:297— core/translate/view.rs:297-306 | core/translate/view.rs:444-453 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:1426— core/vdbe/execute.rs:1426-1435 | core/vdbe/execute.rs:14500-14509 — both copies are in the same file, so extract the block into 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) bindings/c/src/lib.rs:2212— bindings/c/src/lib.rs:2212-2222 | bindings/c/src/lib.rs:2283-2293 — both copies are in the same file, so extract the block into 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) bindings/rust/src/transaction.rs:202— bindings/rust/src/transaction.rs:202-212 | serverless/rust/transaction.rs:193-203 — 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) REDACTED:2253— REDACTED:2253-2263 | REDACTED:2266-2276 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) core/connection.rs:695— core/connection.rs:695-705 | core/connection.rs:746-756 — both copies are in the same file, so extract the block into 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) core/incremental/vdbe_maintenance/aggregate.rs:1041— core/incremental/vdbe_maintenance/aggregate.rs:1041-1051 | core/incremental/vdbe_maintenance/arrangement.rs:412-422 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/arrangement.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 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) core/incremental/vdbe_maintenance/arrangement.rs:405— core/incremental/vdbe_maintenance/arrangement.rs:405-415 | core/incremental/vdbe_maintenance/linear.rs:123-133 — 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) core/io/memory.rs:60— core/io/memory.rs:60-70 | core/io/memory_yield.rs:65-75 — 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) core/json/jsonb.rs:1986— core/json/jsonb.rs:1986-1996 | core/json/jsonb.rs:2060-2070 — both copies are in the same file, so extract the block into 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) core/mvcc/cursor.rs:1418— core/mvcc/cursor.rs:1418-1428 | core/mvcc/cursor.rs:1507-1517 — both copies are in the same file, so extract the block into 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) REDACTED:10077— REDACTED:10077-10087 | REDACTED:10228-10238 — both copies are in the same file, so extract the block into 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) core/mvcc/persistent_storage/logical_log.rs:1139— core/mvcc/persistent_storage/logical_log.rs:1139-1149 | sync/engine/src/database_sync_operations.rs:1025-1035 — 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) REDACTED:5223— REDACTED:5223-5233 | REDACTED:5303-5313 — both copies are in the same file, so extract the block into 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) core/storage/shared_wal_coordination.rs:2478— core/storage/shared_wal_coordination.rs:2478-2488 | core/storage/shared_wal_coordination.rs:2527-2537 — both copies are in the same file, so extract the block into 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) core/time/mod.rs:795— core/time/mod.rs:795-805 | core/time/mod.rs:809-819 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) core/translate/aggregation.rs:659— core/translate/aggregation.rs:659-669 | core/translate/aggregation.rs:681-691 — both copies are in the same file, so extract the block into 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) REDACTED:1048— REDACTED:1048-1058 | REDACTED:1336-1346 — both copies are in the same file, so extract the block into 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) core/translate/compound_select.rs:599— core/translate/compound_select.rs:599-609 | core/translate/recursive_cte.rs:131-141 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) core/translate/expr/arrays.rs:238— core/translate/expr/arrays.rs:238-248 | core/translate/expr/arrays.rs:309-319 — both copies are in the same file, so extract the block into 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) core/translate/fkeys.rs:1277— core/translate/fkeys.rs:1277-1287 | core/translate/insert.rs:3993-4003 — before extracting anything, compare `core/translate/fkeys.rs` and `core/translate/insert.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 130 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) core/translate/index.rs:1368— core/translate/index.rs:1368-1379 | core/translate/schema.rs:2346-2356 — before extracting anything, compare `core/translate/index.rs` and `core/translate/schema.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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) core/translate/insert.rs:3204— core/translate/insert.rs:3204-3214 | core/translate/insert.rs:3354-3367 — both copies are in the same file, so extract the block into 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) core/translate/insert.rs:3750— core/translate/insert.rs:3750-3760 | core/translate/sequence.rs:763-773 — before extracting anything, compare `core/translate/insert.rs` and `core/translate/sequence.rs` as WHOLE FILES: this scan already matched 5 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 (11 lines × 2) core/translate/optimizer/unnest.rs:1084— core/translate/optimizer/unnest.rs:1084-1094 | core/translate/optimizer/unnest.rs:1098-1108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) core/translate/planner.rs:2267— core/translate/planner.rs:2267-2277 | core/translate/planner.rs:2293-2303 — both copies are in the same file, so extract the block into 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) core/translate/schema.rs:2923— core/translate/schema.rs:2923-2933 | core/translate/schema.rs:2940-2950 — both copies are in the same file, so extract the block into 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) bindings/rust/src/value.rs:371— bindings/rust/src/value.rs:371-378 | serverless/rust/value.rs:335-342 — before extracting anything, compare `bindings/rust/src/value.rs` and `serverless/rust/value.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) core/incremental/vdbe_maintenance/aggregate.rs:243— core/incremental/vdbe_maintenance/aggregate.rs:243-253 | core/translate/schema.rs:2323-2330 — 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) core/incremental/vdbe_maintenance/arrangement.rs:125— core/incremental/vdbe_maintenance/arrangement.rs:125-132 | core/incremental/vdbe_maintenance/join.rs:989-996 — before extracting anything, compare `core/incremental/vdbe_maintenance/arrangement.rs` and `core/incremental/vdbe_maintenance/join.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 (8 lines × 2) REDACTED:7482— REDACTED:7482-7489 | REDACTED:7522-7529 — both copies are in the same file, so extract the block into 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) REDACTED:9403— REDACTED:9403-9410 | REDACTED:10348-10355 — both copies are in the same file, so extract the block into 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) REDACTED:10150— REDACTED:10150-10157 | REDACTED:10169-10176 — both copies are in the same file, so extract the block into 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) REDACTED:5511— REDACTED:5511-5518 | REDACTED:5549-5556 — both copies are in the same file, so extract the block into 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) core/storage/encryption.rs:951— core/storage/encryption.rs:951-958 | core/storage/encryption.rs:976-983 — both copies are in the same file, so extract the block into 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) REDACTED:292— REDACTED:292-299 | REDACTED:381-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/translate/eqp.rs:593— core/translate/eqp.rs:593-600 | core/vdbe/array.rs:218-225 — 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) core/translate/expr/translator.rs:2922— core/translate/expr/translator.rs:2922-2929 | core/translate/expr/translator.rs:2978-2985 — both copies are in the same file, so extract the block into 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) core/translate/optimizer/constraints.rs:859— core/translate/optimizer/constraints.rs:859-866 | core/translate/optimizer/constraints.rs:962-969 — both copies are in the same file, so extract the block into 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) core/translate/optimizer/lift_common_subexpressions.rs:319— core/translate/optimizer/lift_common_subexpressions.rs:319-326 | core/translate/optimizer/lift_common_subexpressions.rs:334-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 (8 lines × 2) core/translate/subquery.rs:1881— core/translate/subquery.rs:1881-1888 | core/translate/subquery.rs:2011-2018 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) core/translate/subquery.rs:1957— core/translate/subquery.rs:1957-1964 | core/translate/window.rs:1127-1138 — 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) core/translate/trigger_exec.rs:420— core/translate/trigger_exec.rs:420-427 | core/translate/trigger_exec.rs:1320-1327 — both copies are in the same file, so extract the block into 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) core/translate/trigger_exec.rs:1337— core/translate/trigger_exec.rs:1337-1344 | core/translate/trigger_exec.rs:1365-1372 — both copies are in the same file, so extract the block into 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) core/translate/window.rs:3372— core/translate/window.rs:3372-3379 | core/translate/window.rs:3509-3516 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:11469— core/vdbe/execute.rs:11469-11476 | core/vdbe/execute.rs:11480-11487 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:18470— core/vdbe/execute.rs:18470-18477 | core/vdbe/execute.rs:18481-18488 — both copies are in the same file, so extract the block into 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) core/vdbe/explain.rs:1204— core/vdbe/explain.rs:1204-1213 | core/vdbe/explain.rs:1231-1238 — both copies are in the same file, so extract the block into 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) core/vdbe/hash_table.rs:451— core/vdbe/hash_table.rs:451-458 | core/vdbe/hash_table.rs:464-471 — both copies are in the same file, so extract the block into 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) core/vdbe/hash_table.rs:1304— core/vdbe/hash_table.rs:1304-1311 | core/vdbe/hash_table.rs:1340-1347 — both copies are in the same file, so extract the block into 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) core/vdbe/mod.rs:3120— core/vdbe/mod.rs:3120-3131 | core/vdbe/mod.rs:3137-3144 — both copies are in the same file, so extract the block into 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) core/vector/operations/jaccard.rs:68— core/vector/operations/jaccard.rs:68-75 | core/vector/operations/jaccard.rs:80-87 — both copies are in the same file, so extract the block into 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) core/functions/datetime.rs:690— core/functions/datetime.rs:690-698 | core/functions/datetime.rs:797-805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/incremental/vdbe_maintenance/arrangement.rs:400— core/incremental/vdbe_maintenance/arrangement.rs:400-409 | core/incremental/vdbe_maintenance/consolidate.rs:281-289 — 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) core/index_method/toy_vector_sparse_ivf.rs:867— core/index_method/toy_vector_sparse_ivf.rs:867-876 | core/index_method/toy_vector_sparse_ivf.rs:953-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.
Duplicated block (9 lines × 2) core/io/io_uring.rs:728— core/io/io_uring.rs:728-736 | core/io/unix.rs:306-314 — before extracting anything, compare `core/io/io_uring.rs` and `core/io/unix.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 lines × 2) core/mvcc/database/checkpoint_state_machine.rs:2979— core/mvcc/database/checkpoint_state_machine.rs:2979-2987 | core/mvcc/database/checkpoint_state_machine.rs:3125-3133 — both copies are in the same file, so extract the block into 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) REDACTED:2233— REDACTED:2233-2241 | REDACTED:2310-2323 — both copies are in the same file, so extract the block into 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) core/mvcc/persistent_storage/logical_log.rs:3111— core/mvcc/persistent_storage/logical_log.rs:3111-3120 | core/mvcc/persistent_storage/logical_log.rs:3302-3310 — both copies are in the same file, so extract the block into 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) core/statement.rs:438— core/statement.rs:438-446 | core/statement.rs:1167-1175 — both copies are in the same file, so extract the block into 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) core/time/internal.rs:432— core/time/internal.rs:432-440 | core/time/internal.rs:441-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/translate/compound_select.rs:350— core/translate/compound_select.rs:350-358 | core/translate/compound_select.rs:471-479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/translate/expr/walk.rs:121— core/translate/expr/walk.rs:121-129 | core/translate/expr/walk.rs:456-464 — both copies are in the same file, so extract the block into 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) core/translate/optimizer/mod.rs:1617— core/translate/optimizer/mod.rs:1617-1625 | core/translate/schema.rs:2296-2304 — 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) REDACTED:495— REDACTED:495-503 | core/translate/upsert.rs:1735-1743 — 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) core/translate/values.rs:57— core/translate/values.rs:57-65 | core/translate/values.rs:146-154 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) core/translate/view.rs:77— core/translate/view.rs:77-85 | core/translate/view.rs:367-375 — both copies are in the same file, so extract the block into 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) core/util.rs:3523— core/util.rs:3523-3531 | core/util.rs:3553-3561 — both copies are in the same file, so extract the block into 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) core/util.rs:3521— core/util.rs:3521-3530 | core/util.rs:3532-3540 — both copies are in the same file, so extract the block into 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) core/util.rs:3552— core/util.rs:3552-3560 | core/util.rs:3562-3570 — both copies are in the same file, so extract the block into 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) core/util.rs:3578— core/util.rs:3578-3586 | core/util.rs:3588-3596 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:17822— core/vdbe/execute.rs:17822-17831 | core/vdbe/execute.rs:17872-17880 — both copies are in the same file, so extract the block into 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) core/vdbe/value.rs:339— core/vdbe/value.rs:339-347 | core/vdbe/value.rs:944-952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) macros/src/lib.rs:868— macros/src/lib.rs:868-876 | macros/src/lib.rs:918-926 — both copies are in the same file, so extract the block into 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) REDACTED:72— REDACTED:72-80 | REDACTED:95-103 — both copies are in the same file, so extract the block into 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) postgres/frontend/functions.rs:1037— postgres/frontend/functions.rs:1037-1045 | postgres/frontend/functions.rs:1051-1059 — both copies are in the same file, so extract the block into 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) postgres/parser/parser.rs:1819— postgres/parser/parser.rs:1819-1827 | postgres/parser/parser.rs:1831-1839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) bindings/c/src/lib.rs:2883— bindings/c/src/lib.rs:2883-2887 | bindings/c/src/lib.rs:2937-2941 — both copies are in the same file, so extract the block into 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) bindings/rust/src/value.rs:350— bindings/rust/src/value.rs:350-354 | serverless/rust/value.rs:314-318 — before extracting anything, compare `bindings/rust/src/value.rs` and `serverless/rust/value.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) core/connection.rs:1711— core/connection.rs:1711-1715 | core/connection.rs:1768-1772 — both copies are in the same file, so extract the block into 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) core/connection.rs:1846— core/connection.rs:1846-1850 | core/connection.rs:1900-1904 — both copies are in the same file, so extract the block into 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) core/io/vfs.rs:23— core/io/vfs.rs:23-27 | core/io/vfs.rs:36-40 — both copies are in the same file, so extract the block into 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) core/json/jsonb.rs:4093— core/json/jsonb.rs:4093-4097 | postgres/frontend/copy.rs:79-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 (5 lines × 2) core/mvcc/persistent_storage/logical_log.rs:3402— core/mvcc/persistent_storage/logical_log.rs:3402-3406 | core/mvcc/persistent_storage/logical_log.rs:3423-3427 — both copies are in the same file, so extract the block into 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) core/percentile.rs:155— core/percentile.rs:155-160 | core/vdbe/execute.rs:8474-8478 — 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) REDACTED:2270— REDACTED:2270-2274 | REDACTED:2841-2845 — both copies are in the same file, so extract the block into 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) core/storage/shared_wal_coordination.rs:1343— core/storage/shared_wal_coordination.rs:1343-1347 | core/storage/shared_wal_coordination.rs:1956-1960 — both copies are in the same file, so extract the block into 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) core/storage/shared_wal_coordination.rs:1504— core/storage/shared_wal_coordination.rs:1504-1508 | core/storage/shared_wal_coordination.rs:1549-1553 — both copies are in the same file, so extract the block into 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) core/storage/shared_wal_coordination.rs:1686— core/storage/shared_wal_coordination.rs:1686-1690 | core/storage/shared_wal_coordination.rs:1707-1711 — both copies are in the same file, so extract the block into 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) core/translate/expr/condition.rs:459— core/translate/expr/condition.rs:459-463 | core/translate/expr/condition.rs:476-480 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) core/translate/optimizer/mod.rs:4473— core/translate/optimizer/mod.rs:4473-4477 | core/translate/optimizer/mod.rs:4538-4542 — both copies are in the same file, so extract the block into 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) core/translate/pragma.rs:362— core/translate/pragma.rs:362-366 | core/translate/pragma.rs:378-382 — both copies are in the same file, so extract the block into 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) core/translate/window.rs:2276— core/translate/window.rs:2276-2280 | core/translate/window.rs:2661-2665 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:581— core/vdbe/execute.rs:581-585 | core/vdbe/execute.rs:621-625 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) core/vdbe/execute.rs:3609— core/vdbe/execute.rs:3609-3613 | core/vdbe/execute.rs:3678-3682 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:7913— core/vdbe/execute.rs:7913-7917 | core/vdbe/execute.rs:7925-7929 — both copies are in the same file, so extract the block into 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) postgres/parser/lexer.rs:470— postgres/parser/lexer.rs:470-474 | postgres/parser/lexer.rs:526-530 — both copies are in the same file, so extract the block into 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) REDACTED:4101— REDACTED:4101-4105 | REDACTED:4124-4128 — both copies are in the same file, so extract the block into 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) sql_generation/model/query/predicate.rs:39— sql_generation/model/query/predicate.rs:39-43 | sql_generation/model/query/predicate.rs:54-58 — both copies are in the same file, so extract the block into 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) sqlite/parser/src/lexer.rs:567— sqlite/parser/src/lexer.rs:567-571 | sqlite/parser/src/lexer.rs:587-591 — both copies are in the same file, so extract the block into 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) sqlite/parser/src/parser.rs:5342— sqlite/parser/src/parser.rs:5342-5346 | sqlite/parser/src/parser.rs:5355-5359 — both copies are in the same file, so extract the block into 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) testing/concurrent-simulator/lib.rs:827— testing/concurrent-simulator/lib.rs:827-832 | testing/concurrent-simulator/multiprocess.rs:319-323 — 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 (13 lines × 2) cli/sync_server.rs:386— cli/sync_server.rs:386-398 | cli/sync_server.rs:550-562 — both copies are in the same file, so extract the block into 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) core/connection.rs:1827— core/connection.rs:1827-1839 | core/connection.rs:1877-1889 — both copies are in the same file, so extract the block into 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) core/incremental/vdbe_maintenance/linear.rs:41— core/incremental/vdbe_maintenance/linear.rs:41-53 | core/incremental/vdbe_maintenance/linear.rs:393-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 (13 lines × 2) core/incremental/vdbe_maintenance/linear.rs:460— core/incremental/vdbe_maintenance/linear.rs:460-472 | core/incremental/vdbe_maintenance/stream.rs:258-270 — before extracting anything, compare `core/incremental/vdbe_maintenance/linear.rs` and `core/incremental/vdbe_maintenance/stream.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) core/index_method/toy_vector_sparse_ivf.rs:745— core/index_method/toy_vector_sparse_ivf.rs:745-757 | core/index_method/toy_vector_sparse_ivf.rs:1017-1029 — both copies are in the same file, so extract the block into 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) core/mvcc/persistent_storage/logical_log.rs:2207— core/mvcc/persistent_storage/logical_log.rs:2207-2219 | core/mvcc/persistent_storage/logical_log.rs:2342-2354 — both copies are in the same file, so extract the block into 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) core/schema.rs:7188— core/schema.rs:7188-7200 | core/schema.rs:7242-7254 — both copies are in the same file, so extract the block into 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) core/storage/pager.rs:5938— core/storage/pager.rs:5938-5950 | core/storage/pager.rs:5972-5984 — both copies are in the same file, so extract the block into 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) core/storage/shared_wal_coordination.rs:2034— core/storage/shared_wal_coordination.rs:2034-2046 | core/storage/shared_wal_coordination.rs:2063-2075 — both copies are in the same file, so extract the block into 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) core/translate/analyze.rs:283— core/translate/analyze.rs:283-295 | core/translate/analyze.rs:307-319 — both copies are in the same file, so extract the block into 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) core/translate/emitter/delete.rs:380— core/translate/emitter/delete.rs:380-392 | core/translate/emitter/delete.rs:465-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) core/translate/emitter/delete.rs:880— core/translate/emitter/delete.rs:880-892 | core/translate/emitter/update.rs:2598-2610 — before extracting anything, compare `core/translate/emitter/delete.rs` and `core/translate/emitter/update.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. 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) core/translate/emitter/mod.rs:369— core/translate/emitter/mod.rs:369-381 | core/translate/emitter/mod.rs:397-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 (13 lines × 2) core/translate/insert.rs:1489— core/translate/insert.rs:1489-1501 | core/translate/insert.rs:3198-3210 — both copies are in the same file, so extract the block into 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) core/translate/insert.rs:1851— core/translate/insert.rs:1851-1863 | core/translate/trigger.rs:617-631 — 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 (13 lines × 2) core/translate/pragma.rs:1124— core/translate/pragma.rs:1124-1136 | core/translate/pragma.rs:1280-1292 — both copies are in the same file, so extract the block into 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) core/translate/result_row.rs:297— core/translate/result_row.rs:297-309 | core/translate/values.rs:349-361 — 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 (13 lines × 2) core/translate/upsert.rs:1200— core/translate/upsert.rs:1200-1212 | core/translate/upsert.rs:1359-1371 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) core/vdbe/execute.rs:4229— core/vdbe/execute.rs:4229-4241 | core/vdbe/execute.rs:4275-4287 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) core/vdbe/execute.rs:4916— core/vdbe/execute.rs:4916-4928 | core/vdbe/execute.rs:5004-5016 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:7793— core/vdbe/execute.rs:7793-7805 | core/vdbe/execute.rs:9282-9294 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:12008— core/vdbe/execute.rs:12008-12020 | core/vdbe/execute.rs:12300-12312 — both copies are in the same file, so extract the block into 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) core/vdbe/hash_table.rs:1708— core/vdbe/hash_table.rs:1708-1720 | core/vdbe/hash_table.rs:1724-1736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) core/vdbe/value.rs:740— core/vdbe/value.rs:740-752 | core/vdbe/value.rs:764-776 — both copies are in the same file, so extract the block into 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) core/vector/operations/text.rs:183— core/vector/operations/text.rs:183-195 | core/vector/operations/text.rs:207-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 (7 lines × 2) core/incremental/vdbe_maintenance/members.rs:186— core/incremental/vdbe_maintenance/members.rs:186-192 | core/incremental/vdbe_maintenance/sink.rs:74-80 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) core/incremental_blob.rs:451— core/incremental_blob.rs:451-457 | core/incremental_blob.rs:505-511 — both copies are in the same file, so extract the block into 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) REDACTED:2939— REDACTED:2939-2945 | REDACTED:2987-2993 — both copies are in the same file, so extract the block into 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) core/mvcc/cursor.rs:940— core/mvcc/cursor.rs:940-946 | core/mvcc/cursor.rs:1028-1034 — both copies are in the same file, so extract the block into 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) core/schema.rs:4651— core/schema.rs:4651-4657 | core/schema.rs:4795-4801 — both copies are in the same file, so extract the block into 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) core/storage/wal.rs:5880— core/storage/wal.rs:5880-5887 | core/storage/wal.rs:5959-5965 — both copies are in the same file, so extract the block into 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) REDACTED:4788— REDACTED:4788-4794 | REDACTED:5320-5326 — both copies are in the same file, so extract the block into 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) core/translate/emitter/delete.rs:519— core/translate/emitter/delete.rs:519-525 | core/translate/emitter/delete.rs:946-952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) core/translate/expr/emission.rs:155— core/translate/expr/emission.rs:155-161 | core/translate/select.rs:537-543 — 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) core/translate/optimizer/multi_index.rs:236— core/translate/optimizer/multi_index.rs:236-242 | core/translate/optimizer/multi_index.rs:279-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) core/translate/select.rs:1504— core/translate/select.rs:1504-1510 | core/translate/select.rs:1593-1599 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:17514— core/vdbe/execute.rs:17514-17520 | core/vdbe/execute.rs:17597-17603 — both copies are in the same file, so extract the block into 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) core/vdbe/hash_table.rs:1524— core/vdbe/hash_table.rs:1524-1530 | core/vdbe/hash_table.rs:2863-2869 — both copies are in the same file, so extract the block into 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) extensions/ipaddr/src/lib.rs:59— extensions/ipaddr/src/lib.rs:59-65 | extensions/ipaddr/src/lib.rs:72-78 — both copies are in the same file, so extract the block into 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) macros/src/ext/vfs_derive.rs:133— macros/src/ext/vfs_derive.rs:133-139 | macros/src/ext/vfs_derive.rs:160-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 (7 lines × 2) postgres/client/lib.rs:274— postgres/client/lib.rs:274-280 | postgres/regress/main.rs:1601-1607 — before extracting anything, compare `postgres/client/lib.rs` and `postgres/regress/main.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) REDACTED:3662— REDACTED:3662-3668 | REDACTED:3728-3734 — both copies are in the same file, so extract the block into 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) REDACTED:4108— REDACTED:4108-4114 | REDACTED:4131-4137 — both copies are in the same file, so extract the block into 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) REDACTED:4756— REDACTED:4756-4762 | REDACTED:4771-4777 — both copies are in the same file, so extract the block into 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) sql_generation/generation/query.rs:271— sql_generation/generation/query.rs:271-277 | sql_generation/generation/query.rs:341-347 — both copies are in the same file, so extract the block into 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) bindings/python/src/turso_sync.rs:78— bindings/python/src/turso_sync.rs:78-84 | bindings/rust/src/sync.rs:59-65 — 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) core/io/io_uring.rs:840— core/io/io_uring.rs:840-846 | core/io/unix.rs:492-498 — before extracting anything, compare `core/io/io_uring.rs` and `core/io/unix.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 (7 lines × 2) testing/differential-oracle/sql_gen/src/ast.rs:602— testing/differential-oracle/sql_gen/src/ast.rs:602-608 | testing/differential-oracle/sql_gen_prop/cte.rs:48-54 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) testing/differential-oracle/sql_gen/src/ast.rs:906— testing/differential-oracle/sql_gen/src/ast.rs:906-912 | testing/differential-oracle/sql_gen_prop/select.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) testing/differential-oracle/sql_gen/src/schema.rs:344— testing/differential-oracle/sql_gen/src/schema.rs:344-350 | testing/differential-oracle/sql_gen_prop/schema.rs:350-356 — before extracting anything, compare `testing/differential-oracle/sql_gen/src/schema.rs` and `testing/differential-oracle/sql_gen_prop/schema.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) bindings/c/src/lib.rs:2252— bindings/c/src/lib.rs:2252-2257 | bindings/c/src/lib.rs:2260-2265 — both copies are in the same file, so extract the block into 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) core/database.rs:898— core/database.rs:898-903 | core/database.rs:910-915 — both copies are in the same file, so extract the block into 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) core/functions/datetime.rs:528— core/functions/datetime.rs:528-533 | core/functions/datetime.rs:571-576 — both copies are in the same file, so extract the block into 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) core/io/vfs.rs:172— core/io/vfs.rs:172-177 | core/io/vfs.rs:196-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) core/percentile.rs:57— core/percentile.rs:57-62 | core/percentile.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) core/schema.rs:5670— core/schema.rs:5670-5675 | core/schema.rs:5705-5710 — both copies are in the same file, so extract the block into 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) core/storage/encryption.rs:959— core/storage/encryption.rs:959-964 | core/storage/encryption.rs:984-989 — both copies are in the same file, so extract the block into 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) core/storage/shared_wal_coordination.rs:2470— core/storage/shared_wal_coordination.rs:2470-2475 | core/storage/shared_wal_coordination.rs:2517-2522 — both copies are in the same file, so extract the block into 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) core/storage/wal.rs:5800— core/storage/wal.rs:5800-5805 | core/storage/wal.rs:5935-5940 — both copies are in the same file, so extract the block into 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) core/translate/fkeys.rs:2487— core/translate/fkeys.rs:2487-2492 | core/translate/fkeys.rs:2649-2654 — both copies are in the same file, so extract the block into 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) core/vdbe/array.rs:409— core/vdbe/array.rs:409-414 | core/vdbe/array.rs:477-482 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:3745— core/vdbe/execute.rs:3745-3750 | core/vdbe/execute.rs:3804-3809 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:9244— core/vdbe/execute.rs:9244-9249 | core/vdbe/execute.rs:9269-9274 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:11758— core/vdbe/execute.rs:11758-11763 | core/vdbe/execute.rs:11772-11777 — both copies are in the same file, so extract the block into 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) core/vdbe/hash_table.rs:1533— core/vdbe/hash_table.rs:1533-1539 | core/vdbe/hash_table.rs:2871-2876 — both copies are in the same file, so extract the block into 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) core/vector/operations/distance_cos.rs:45— core/vector/operations/distance_cos.rs:45-50 | core/vector/operations/distance_dot.rs:47-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 (6 lines × 2) postgres/cli/main.rs:318— postgres/cli/main.rs:318-323 | postgres/cli/main.rs:574-579 — both copies are in the same file, so extract the block into 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) REDACTED:610— REDACTED:610-615 | REDACTED: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) REDACTED:2711— REDACTED:2711-2716 | REDACTED:2739-2744 — both copies are in the same file, so extract the block into 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) REDACTED:3044— REDACTED:3044-3049 | REDACTED:3068-3073 — both copies are in the same file, so extract the block into 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) sql_generation/generation/predicate/binary.rs:415— sql_generation/generation/predicate/binary.rs:415-420 | sql_generation/generation/predicate/binary.rs:441-446 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) sync/engine/src/database_sync_operations.rs:2530— sync/engine/src/database_sync_operations.rs:2530-2535 | sync/engine/src/database_sync_operations.rs:2575-2580 — both copies are in the same file, so extract the block into 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) testing/differential-oracle/sql_gen/src/generate/stmt.rs:1562— testing/differential-oracle/sql_gen/src/generate/stmt.rs:1562-1567 | testing/differential-oracle/sql_gen/src/generate/stmt.rs:1620-1625 — both copies are in the same file, so extract the block into 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) testing/differential-oracle/sql_gen/src/schema.rs:42— testing/differential-oracle/sql_gen/src/schema.rs:42-47 | testing/differential-oracle/sql_gen_prop/schema.rs:26-31 — before extracting anything, compare `testing/differential-oracle/sql_gen/src/schema.rs` and `testing/differential-oracle/sql_gen_prop/schema.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) testing/simulator/generation/property.rs:870— testing/simulator/generation/property.rs:870-876 | testing/simulator/generation/property.rs:1027-1032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
TooManyMethods: Connection core/connection.rs:363— TooManyMethods — 308 methods, declared across 6 files: core/connection.rs (290), sqlite/attach.rs (12), ext/mod.rs (3), ext/dynamic.rs (1), +2 more file(s). The bar is 30 methods; this is 278 over it, 10.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: JDBC4ResultSet bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:33— TooManyMethods — 215 methods. The bar is 30 methods; this is 185 over it, 7.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MvStore REDACTED:4397— TooManyMethods — 197 methods. The bar is 30 methods; this is 167 over it, 6.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: JDBC4DatabaseMetaData bindings/java/src/main/java/tech/turso/jdbc4/JDBC4DatabaseMetaData.java:17— TooManyMethods — 177 methods. The bar is 30 methods; this is 147 over it, 5.90× 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: Parser sqlite/parser/src/parser.rs:183— TooManyMethods — 158 methods. The bar is 30 methods; this is 128 over it, 5.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Pager core/storage/pager.rs:1610— TooManyMethods — 147 methods. The bar is 30 methods; this is 117 over it, 4.90× 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: SqliteConnection REDACTED— TooManyMethods — 976 significant lines (blank, comment-only and punctuation-only lines excluded), 134 methods, declared across 4 files: REDACTED (90), Turso.Data.Sqlite/SqliteConnection.Functions.cs (26), Turso.Data.Sqlite/SqliteConnection.Aggregates.cs (14), Turso.Data.Sqlite/SqliteConnection.Collations.cs (4). The bar is 30 methods; this is 104 over it, 4.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ProgramBuilder core/vdbe/builder.rs:235— TooManyMethods — 121 methods. The bar is 30 methods; this is 91 over it, 4.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: Schema core/schema.rs:774— TooManyMethods — 118 methods. The bar is 30 methods; this is 88 over it, 3.93× 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: BTreeCursor REDACTED:873— TooManyMethods — 92 methods. The bar is 30 methods; this is 62 over it, 3.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MappedSharedWalCoordination core/storage/shared_wal_coordination.rs:665— 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: SqliteDataReader REDACTED— TooManyMethods — 993 significant lines (blank, comment-only and punctuation-only lines excluded), 86 methods. The bar is 30 methods; this is 56 over it, 2.87× 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: Parser postgres/parser/parser.rs:10— TooManyMethods — 81 methods. The bar is 30 methods; this is 51 over it, 2.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Database core/database.rs:670— TooManyMethods — 80 methods, declared across 2 files: core/database.rs (78), ext/mod.rs (2). The bar is 30 methods; this is 50 over it, 2.67× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Value core/types.rs:544— TooManyMethods — 79 methods, declared across 2 files: vdbe/value.rs (57), core/types.rs (22). The bar is 30 methods; this is 49 over it, 2.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: PostgreSQLTranslator REDACTED:25— TooManyMethods — 71 methods. The bar is 30 methods; this is 41 over it, 2.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Statement core/statement.rs:347— TooManyMethods — 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Limbo REDACTED:138— TooManyMethods — 67 methods. The bar is 30 methods; this is 37 over it, 2.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: JDBC4PreparedStatement bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:22— TooManyMethods — 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PageInner core/storage/pager.rs:127— TooManyMethods — 63 methods. The bar is 30 methods; this is 33 over it, 2.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: SqliteCommand bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs— TooManyMethods — 689 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 30 methods; this is 31 over it, 2.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: JDBC4Connection bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java:13— TooManyMethods — 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: HashTable core/vdbe/hash_table.rs:971— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× 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: StatementProfile testing/differential-oracle/sql_gen_prop/profile.rs:149— TooManyMethods — 56 methods. The bar is 30 methods; this is 26 over it, 1.87× 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: Jsonb core/json/jsonb.rs:189— TooManyMethods — 54 methods. The bar is 30 methods; this is 24 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (12 lines × 2) core/incremental/vdbe_maintenance/aggregate.rs:753— core/incremental/vdbe_maintenance/aggregate.rs:753-764 | core/incremental/vdbe_maintenance/set_op.rs:724-735 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/set_op.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) core/incremental/vdbe_maintenance/aggregate.rs:1018— core/incremental/vdbe_maintenance/aggregate.rs:1018-1029 | core/incremental/vdbe_maintenance/set_op.rs:647-658 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/set_op.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) core/incremental/vdbe_maintenance/join.rs:1001— core/incremental/vdbe_maintenance/join.rs:1001-1012 | core/translate/schema.rs:2385-2396 — 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) core/incremental/vdbe_maintenance/set_op.rs:642— core/incremental/vdbe_maintenance/set_op.rs:642-653 | core/incremental/vdbe_maintenance/set_op.rs:719-730 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) core/index_method/toy_vector_sparse_ivf.rs:548— core/index_method/toy_vector_sparse_ivf.rs:548-559 | core/index_method/toy_vector_sparse_ivf.rs:811-822 — both copies are in the same file, so extract the block into 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) core/percentile.rs:95— core/percentile.rs:95-106 | core/percentile.rs:157-168 — both copies are in the same file, so extract the block into 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) core/storage/shared_wal_coordination.rs:982— core/storage/shared_wal_coordination.rs:982-993 | core/storage/shared_wal_coordination.rs:1050-1061 — both copies are in the same file, so extract the block into 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) core/time/mod.rs:160— core/time/mod.rs:160-171 | core/time/mod.rs:396-407 — both copies are in the same file, so extract the block into 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) REDACTED:1580— REDACTED:1580-1591 | REDACTED:2081-2092 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) REDACTED:2803— REDACTED:2803-2814 | REDACTED:2883-2894 — both copies are in the same file, so extract the block into 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) core/translate/display.rs:128— core/translate/display.rs:128-139 | core/translate/display.rs:245-256 — both copies are in the same file, so extract the block into 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) core/translate/emitter/mod.rs:1678— core/translate/emitter/mod.rs:1678-1689 | core/translate/emitter/mod.rs:1811-1822 — both copies are in the same file, so extract the block into 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) core/translate/emitter/mod.rs:1970— core/translate/emitter/mod.rs:1970-1981 | core/translate/emitter/mod.rs:2024-2035 — both copies are in the same file, so extract the block into 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) core/translate/expr/translator.rs:1478— core/translate/expr/translator.rs:1478-1489 | core/translate/expr/translator.rs:1492-1503 — both copies are in the same file, so extract the block into 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) core/translate/expr/translator.rs:2658— core/translate/expr/translator.rs:2658-2669 | core/translate/expr/translator.rs:2697-2708 — both copies are in the same file, so extract the block into 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) core/translate/fkeys.rs:449— core/translate/fkeys.rs:449-460 | core/translate/fkeys.rs:598-609 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) core/translate/insert.rs:3285— core/translate/insert.rs:3285-3296 | core/translate/insert.rs:3330-3341 — both copies are in the same file, so extract the block into 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) macros/src/ext/vtab_derive.rs:244— macros/src/ext/vtab_derive.rs:244-255 | macros/src/ext/vtab_derive.rs:259-270 — both copies are in the same file, so extract the block into 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) macros/src/lib.rs:1233— macros/src/lib.rs:1233-1244 | macros/src/lib.rs:1355-1366 — both copies are in the same file, so extract the block into 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) postgres/frontend/options.rs:53— postgres/frontend/options.rs:53-64 | postgres/frontend/unnest.rs:51-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) serverless/rust/differential/lib.rs:384— serverless/rust/differential/lib.rs:384-395 | serverless/rust/differential/lib.rs:587-598 — both copies are in the same file, so extract the block into 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) sqlite/parser/src/ast/fmt.rs:497— sqlite/parser/src/ast/fmt.rs:497-508 | sqlite/parser/src/ast/fmt.rs:668-679 — both copies are in the same file, so extract the block into 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) sync/engine/src/database_sync_operations.rs:398— sync/engine/src/database_sync_operations.rs:398-409 | sync/engine/src/database_sync_operations.rs:413-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 (12 lines × 2) testing/differential-oracle/sql_gen/src/trace.rs:491— testing/differential-oracle/sql_gen/src/trace.rs:491-502 | testing/differential-oracle/sql_gen/src/trace.rs:512-523 — both copies are in the same file, so extract the block into 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) testing/simulator/common/mod.rs:5— testing/simulator/common/mod.rs:5-16 | testing/simulator/runner/differential.rs:175-186 — 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.
ClassTooLong: BTreeCursor REDACTED:873— ClassTooLong — 4310 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 92 methods, 7 blocks, lines 873-8118. The bar is 400 significant lines; this is 3910 over it, 10.78× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MvStore REDACTED:4397— ClassTooLong — 3670 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 197 methods, 3 blocks, lines 4397-10556. The bar is 400 significant lines; this is 3270 over it, 9.18× 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 sqlite/parser/src/parser.rs:183— ClassTooLong — 3549 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 158 methods, 3 blocks, lines 183-5495. The bar is 400 significant lines; this is 3149 over it, 8.87× 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: PostgreSQLTranslator REDACTED:25— ClassTooLong — 3416 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 71 methods, 2 blocks, lines 25-5044. The bar is 400 significant lines; this is 3016 over it, 8.54× 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: Connection core/connection.rs:363— ClassTooLong — 2822 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 308 methods, 3 blocks, lines 363-5018. The bar is 400 significant lines; this is 2422 over it, 7.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: Database core/database.rs:670— ClassTooLong — 1903 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 80 methods, 3 blocks, lines 670-3567. The bar is 400 significant lines; this is 1503 over it, 4.76× 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: CheckpointStateMachine core/mvcc/database/checkpoint_state_machine.rs:287— ClassTooLong — 1881 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 50 methods, 4 blocks, lines 287-3674. The bar is 400 significant lines; this is 1481 over it, 4.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: Schema core/schema.rs:774— ClassTooLong — 1821 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 118 methods, 5 blocks, lines 774-3771. The bar is 400 significant lines; this is 1421 over it, 4.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Parser postgres/parser/parser.rs:10— ClassTooLong — 1810 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 81 methods, 2 blocks, lines 10-2759. The bar is 400 significant lines; this is 1410 over it, 4.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Jsonb core/json/jsonb.rs:189— ClassTooLong — 1702 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 54 methods, 4 blocks, lines 189-3525. The bar is 400 significant lines; this is 1302 over it, 4.26× 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: DatabaseSyncEngine sync/engine/src/database_sync_engine.rs:121— ClassTooLong — 1655 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 121-3241. The bar is 400 significant lines; this is 1255 over it, 4.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FtsCursor REDACTED:1019— ClassTooLong — 1578 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 33 methods, 4 blocks, lines 1019-3742. The bar is 400 significant lines; this is 1178 over it, 3.95× 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: HashTable core/vdbe/hash_table.rs:971— ClassTooLong — 1526 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 56 methods, 2 blocks, lines 971-3329. The bar is 400 significant lines; this is 1126 over it, 3.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Limbo REDACTED:138— ClassTooLong — 1378 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 67 methods, 3 blocks, lines 138-2379. The bar is 400 significant lines; this is 978 over it, 3.45× 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: StreamingLogicalLogReader core/mvcc/persistent_storage/logical_log.rs:1652— ClassTooLong — 1291 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. The bar is 400 significant lines; this is 891 over it, 3.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.
ClassTooLong: ProgramBuilder core/vdbe/builder.rs:235— ClassTooLong — 1215 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 121 methods, 2 blocks, lines 235-2530. The bar is 400 significant lines; this is 815 over it, 3.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CommitStateMachine REDACTED:1659— ClassTooLong — 1206 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 6 blocks, lines 1646-3819. The bar is 400 significant lines; this is 806 over it, 3.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MvccLazyCursor core/mvcc/cursor.rs:541— ClassTooLong — 1129 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 25 methods, 6 blocks, lines 156-2322. The bar is 400 significant lines; this is 729 over it, 2.82× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Program core/vdbe/mod.rs:2113— ClassTooLong — 1075 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 34 methods, 5 blocks, lines 1207-3950. The bar is 400 significant lines; this is 675 over it, 2.69× 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: VectorSparseInvertedIndexMethodCursor core/index_method/toy_vector_sparse_ivf.rs:301— ClassTooLong — 941 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 3 methods, 3 blocks, lines 301-1635. The bar is 400 significant lines; this is 541 over it, 2.35× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Statement core/statement.rs:347— ClassTooLong — 899 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 68 methods, 4 blocks, lines 347-1931. The bar is 400 significant lines; this is 499 over it, 2.25× 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: Insn core/vdbe/insn.rs:558— ClassTooLong — 889 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 3 methods, 2 blocks, lines 558-2687. The bar is 400 significant lines; this is 489 over it, 2.22× 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: JDBC4ResultSet bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:33— ClassTooLong — 863 significant lines (blank, comment-only and punctuation-only lines excluded), 215 methods. The bar is 400 significant lines; this is 463 over it, 2.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: JDBC4DatabaseMetaData bindings/java/src/main/java/tech/turso/jdbc4/JDBC4DatabaseMetaData.java:17— ClassTooLong — 725 significant lines (blank, comment-only and punctuation-only lines excluded), 177 methods. The bar is 400 significant lines; this is 325 over it, 1.81× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MultiprocessWhopper testing/concurrent-simulator/multiprocess.rs:206— ClassTooLong — 703 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 28 methods, 3 blocks, lines 206-1207. The bar is 400 significant lines; this is 303 over it, 1.76× 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 (14 lines × 2) core/incremental/vdbe_maintenance/aggregate.rs:1000— core/incremental/vdbe_maintenance/aggregate.rs:1000-1013 | core/incremental/vdbe_maintenance/arrangement.rs:235-248 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/arrangement.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) core/index_method/toy_vector_sparse_ivf.rs:705— core/index_method/toy_vector_sparse_ivf.rs:705-718 | core/index_method/toy_vector_sparse_ivf.rs:978-991 — both copies are in the same file, so extract the block into 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) core/index_method/toy_vector_sparse_ivf.rs:1388— core/index_method/toy_vector_sparse_ivf.rs:1388-1401 | core/index_method/toy_vector_sparse_ivf.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) core/io/io_uring.rs:702— core/io/io_uring.rs:702-715 | core/io/unix.rs:279-292 — before extracting anything, compare `core/io/io_uring.rs` and `core/io/unix.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 (14 lines × 2) core/percentile.rs:80— core/percentile.rs:80-93 | core/percentile.rs:142-155 — both copies are in the same file, so extract the block into 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) REDACTED:2184— REDACTED:2184-2197 | REDACTED:2479-2492 — both copies are in the same file, so extract the block into 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) REDACTED:4224— REDACTED:4224-4239 | REDACTED:4259-4272 — both copies are in the same file, so extract the block into 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) REDACTED:8644— REDACTED:8644-8657 | REDACTED:8728-8741 — both copies are in the same file, so extract the block into 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) core/storage/sqlite3_ondisk.rs:1080— core/storage/sqlite3_ondisk.rs:1080-1093 | core/storage/sqlite3_ondisk.rs:1200-1213 — both copies are in the same file, so extract the block into 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) core/storage/sqlite3_ondisk.rs:1126— core/storage/sqlite3_ondisk.rs:1126-1139 | core/storage/sqlite3_ondisk.rs:1253-1266 — both copies are in the same file, so extract the block into 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) REDACTED:312— REDACTED:312-325 | REDACTED:392-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 (14 lines × 2) REDACTED:1123— REDACTED:1123-1136 | REDACTED:1813-1826 — both copies are in the same file, so extract the block into 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) core/translate/emitter/select.rs:739— core/translate/emitter/select.rs:739-752 | core/translate/emitter/select.rs:761-774 — both copies are in the same file, so extract the block into 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) core/translate/emitter/update.rs:1675— core/translate/emitter/update.rs:1675-1688 | core/translate/emitter/update.rs:2138-2151 — both copies are in the same file, so extract the block into 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) core/translate/expr/condition.rs:461— core/translate/expr/condition.rs:461-474 | core/translate/expr/condition.rs:622-635 — both copies are in the same file, so extract the block into 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) core/translate/expr/condition.rs:478— core/translate/expr/condition.rs:478-491 | core/translate/expr/condition.rs:607-620 — both copies are in the same file, so extract the block into 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) core/translate/expr/translator.rs:1436— core/translate/expr/translator.rs:1436-1450 | core/vdbe/execute.rs:10751-10764 — 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 lines × 2) core/translate/optimizer/access_method.rs:2097— core/translate/optimizer/access_method.rs:2097-2110 | core/translate/optimizer/access_method.rs:2114-2127 — both copies are in the same file, so extract the block into 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) core/translate/optimizer/constraints.rs:919— core/translate/optimizer/constraints.rs:919-932 | core/translate/optimizer/constraints.rs:1022-1035 — both copies are in the same file, so extract the block into 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) core/translate/optimizer/constraints.rs:1066— core/translate/optimizer/constraints.rs:1066-1079 | core/translate/optimizer/constraints.rs:1165-1178 — both copies are in the same file, so extract the block into 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) core/translate/trigger.rs:230— core/translate/trigger.rs:230-243 | core/translate/view.rs:418-431 — before extracting anything, compare `core/translate/trigger.rs` and `core/translate/view.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) core/vdbe/hash_table.rs:1571— core/vdbe/hash_table.rs:1571-1584 | core/vdbe/hash_table.rs:1729-1742 — both copies are in the same file, so extract the block into 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) core/vdbe/hash_table.rs:1991— core/vdbe/hash_table.rs:1991-2004 | core/vdbe/hash_table.rs:2027-2040 — both copies are in the same file, so extract the block into 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) postgres/client/lib.rs:301— postgres/client/lib.rs:301-314 | postgres/regress/main.rs:1387-1400 — before extracting anything, compare `postgres/client/lib.rs` and `postgres/regress/main.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) REDACTED:414— REDACTED:414-427 | REDACTED:450-463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
+ 10 more in this group — see findings.md.
R4 · Test Coverage· No test reaches this file · ×34
No test reaches this file testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.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/react-native/src/Database.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/react-native/src/Statement.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/react-native/src/types.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/javascript/sync/packages/wasm/promise-bundle.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/javascript/sync/packages/wasm/promise-turbopack-hack.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/javascript/sync/packages/wasm/promise-vite-dev-hack.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file bindings/react-native/src/internal/ioProcessor.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 testing/sqlancer/sqlancer-runner/github.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file REDACTED:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file testing/simulator/simulator-docker-runner/docker-entrypoint.simulator.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/react-native/src/index.ts:1— No test imports this module directly or transitively. Import reachability cannot see a test that executes a file by path instead of importing it, nor one that drives it through a running browser by navigating to a URL — if neither does, no test reaches this one.
No test reaches this file testing/simulator/simulator-docker-runner/github.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 testing/sqlancer/sqlancer-runner/slack.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 testing/simulator/simulator-docker-runner/slack.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/react-native/src/internal/asyncOperation.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/javascript/turso-sql-runner.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 bindings/javascript/packages/wasm/promise-bundle.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/javascript/packages/wasm/promise-turbopack-hack.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/javascript/packages/wasm/promise-vite-dev-hack.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 testing/simulator/simulator-docker-runner/logParse.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/javascript/sync/packages/wasm/index-vite-dev-hack.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 testing/sqlancer/sqlancer-runner/levenshtein.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/react-native/src/AsyncLock.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.
Sync-over-async blocking perf/fts/src/main.rs:68— `run` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
Sync-over-async blocking REDACTED:25— `fs.existsSync` in `analyzeCorruption` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:30— `fs.existsSync` in `analyzeCorruption` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:155— `fs.existsSync` in `runPythonTool` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:271— `fs.existsSync` in `preserveCorruptDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:272— `fs.mkdirSync` in `preserveCorruptDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:279— `fs.existsSync` in `preserveCorruptDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:280— `fs.copyFileSync` in `preserveCorruptDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:284— `fs.existsSync` in `preserveCorruptDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking REDACTED:285— `fs.copyFileSync` in `preserveCorruptDatabase` blocks the event loop until it finishes — a blocking call inside async code stalls the event loop — every other request waits for as long as it runs.
Sync-over-async blocking — 19 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:190— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:163— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:275— `.GetAwaiter() .GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data/TursoAutomaticSyncCoordinator.cs:49— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data/TursoBatch.cs:78— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data/TursoBatch.cs:131— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data/TursoCommand.cs:113— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data/TursoCommand.cs:280— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data/TursoConnection.cs:192— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data/TursoConnection.cs:367— `.GetAwaiter() .GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data/TursoConnection.cs:395— `.GetAwaiter() .GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data/TursoConnection.cs:424— `.GetAwaiter() .GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data/TursoConnection.cs:451— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking bindings/dotnet/src/Turso.Data/TursoConnection.cs:494— `.GetAwaiter() .GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Parser::next_token (cognitive 134) sqlite/parser/src/parser.rs:402— Parser::next_token has cognitive complexity 134 (threshold 15). Drivers by points: match/switch 26 (87 pts), if/else 17 (43 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 89). Of this number, 133 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.
Parser::parse_primary_expression (cognitive 69) postgres/parser/parser.rs:953— Parser::parse_primary_expression has cognitive complexity 69 (threshold 15). Drivers by points: if/else 35 (62 pts), loops 1 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 30). 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.
Parser::parse_create_type (cognitive 68) sqlite/parser/src/parser.rs:4874— Parser::parse_create_type has cognitive complexity 68 (threshold 15). Drivers by points: match/switch 13 (40 pts), if/else 11 (23 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 41). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
Parser::validate (cognitive 65) testing/sqltest/src/parser/mod.rs:734— Parser::validate has cognitive complexity 65 (threshold 15). Drivers by points: if/else 20 (45 pts), loops 11 (16 pts), boolean chains 4 (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.
Parser::parse_create_table_args (cognitive 46) sqlite/parser/src/parser.rs:3630— Parser::parse_create_table_args has cognitive complexity 46 (threshold 15). Drivers by points: loops 5 (17 pts), if/else 5 (16 pts), match/switch 5 (12 pts), boolean chains 1 (nesting depth added 30). 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.
Parser::parse_test_or_snapshot (cognitive 38) testing/sqltest/src/parser/mod.rs:295— Parser::parse_test_or_snapshot has cognitive complexity 38 (threshold 15). Drivers by points: if/else 13 (30 pts), loops 2 (3 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::parse_named_column_constraints (cognitive 37) sqlite/parser/src/parser.rs:4193— Parser::parse_named_column_constraints has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (22 pts), match/switch 5 (13 pts), boolean chains 1, loops 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::parse_postfix_expression (cognitive 29) postgres/parser/parser.rs:852— Parser::parse_postfix_expression has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 3 (8 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.
Parser::parse_name_or_function_call_expr (cognitive 29) sqlite/parser/src/parser.rs:2002— Parser::parse_name_or_function_call_expr has cognitive complexity 29 (threshold 15). Drivers by points: if/else 18 (26 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::parse_select_statement (cognitive 22) postgres/parser/parser.rs:100— Parser::parse_select_statement has cognitive complexity 22 (threshold 15). Drivers by points: if/else 21 (22 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Parser::parse_joined_tables (cognitive 22) sqlite/parser/src/parser.rs:2881— Parser::parse_joined_tables has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 7 (21 pts), loops 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.
Parser::parse_order_by_list (cognitive 20) postgres/parser/parser.rs:1471— Parser::parse_order_by_list has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::parse_eid_list (cognitive 20) sqlite/parser/src/parser.rs:2604— Parser::parse_eid_list has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::parse_create_domain (cognitive 20) sqlite/parser/src/parser.rs:5099— Parser::parse_create_domain has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 4 (7 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::parse_single_select_query (cognitive 19) postgres/parser/parser.rs:623— Parser::parse_single_select_query has cognitive complexity 19 (threshold 15). Drivers by points: if/else 18 (19 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Parser::parse_type (cognitive 19) sqlite/parser/src/parser.rs:1282— Parser::parse_type has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), match/switch 3 (6 pts), boolean chains 2, loops 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, 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.
Parser::parse_in_expr (cognitive 19) sqlite/parser/src/parser.rs:2389— Parser::parse_in_expr has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Parser::parse_select_without_cte (cognitive 19) sqlite/parser/src/parser.rs:3408— Parser::parse_select_without_cte has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (7 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Parser::parse_insert_statement (cognitive 18) postgres/parser/parser.rs:197— Parser::parse_insert_statement has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::parse_data_type (cognitive 18) postgres/parser/parser.rs:1757— Parser::parse_data_type has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Parser::parse_alter_table_action (cognitive 18) postgres/parser/parser.rs:2016— Parser::parse_alter_table_action has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Parser::parse_copy_statement (cognitive 18) postgres/parser/parser.rs:2306— Parser::parse_copy_statement has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (4 pts), loops 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.
Parser::parse_frame_opt (cognitive 18) sqlite/parser/src/parser.rs:1491— Parser::parse_frame_opt has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 10 (16 pts), if/else 2 (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Parser::parse_create_sequence (cognitive 18) sqlite/parser/src/parser.rs:5205— Parser::parse_create_sequence has cognitive complexity 18 (threshold 15). Drivers by points: if/else 2 (8 pts), match/switch 3 (8 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.
Parser::parse_explain_statement (cognitive 17) postgres/parser/parser.rs:2247— Parser::parse_explain_statement has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 1 (3 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (16 lines × 2) core/incremental/vdbe_maintenance/aggregate.rs:704— core/incremental/vdbe_maintenance/aggregate.rs:704-719 | core/incremental/vdbe_maintenance/aggregate.rs:901-916 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) core/json/ops.rs:98— core/json/ops.rs:98-113 | core/json/ops.rs:131-146 — both copies are in the same file, so extract the block into 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) core/schema.rs:7347— core/schema.rs:7347-7362 | core/translate/index.rs:1153-1168 — 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) core/time/mod.rs:694— core/time/mod.rs:694-709 | core/time/mod.rs:856-871 — both copies are in the same file, so extract the block into 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) core/translate/display.rs:116— core/translate/display.rs:116-131 | core/translate/display.rs:342-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 (16 lines × 2) core/translate/expr/arrays.rs:221— core/translate/expr/arrays.rs:221-236 | core/translate/expr/arrays.rs:292-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) core/translate/expr/binary.rs:372— core/translate/expr/binary.rs:372-387 | core/translate/expr/translator.rs:490-505 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) core/translate/expr/binary.rs:725— core/translate/expr/binary.rs:725-740 | core/translate/expr/binary.rs:1150-1165 — both copies are in the same file, so extract the block into 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) core/translate/group_by.rs:831— core/translate/group_by.rs:831-846 | core/translate/group_by.rs:889-904 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) core/translate/index.rs:1345— core/translate/index.rs:1345-1360 | core/translate/schema.rs:3146-3161 — before extracting anything, compare `core/translate/index.rs` and `core/translate/schema.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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 lines × 2) core/translate/main_loop/in_seek.rs:54— core/translate/main_loop/in_seek.rs:54-69 | core/translate/main_loop/multi_index.rs:279-294 — before extracting anything, compare `core/translate/main_loop/in_seek.rs` and `core/translate/main_loop/multi_index.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) core/translate/plan.rs:3164— core/translate/plan.rs:3164-3179 | core/translate/plan.rs:3213-3228 — both copies are in the same file, so extract the block into 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) core/translate/subquery.rs:1909— core/translate/subquery.rs:1909-1924 | core/translate/subquery.rs:2039-2054 — both copies are in the same file, so extract the block into 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) core/translate/view.rs:218— core/translate/view.rs:218-233 | core/translate/view.rs:419-434 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) core/types.rs:2905— core/types.rs:2905-2920 | core/types.rs:3000-3015 — both copies are in the same file, so extract the block into 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) core/util.rs:3373— core/util.rs:3373-3388 | core/util.rs:3400-3415 — both copies are in the same file, so extract the block into 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) postgres/cli/main.rs:216— postgres/cli/main.rs:216-231 | postgres/cli/main.rs:586-601 — both copies are in the same file, so extract the block into 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) sync/engine/src/server_proto.rs:387— sync/engine/src/server_proto.rs:387-402 | sync/engine/src/server_proto.rs:510-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 (16 lines × 2) testing/concurrent-simulator/properties.rs:660— testing/concurrent-simulator/properties.rs:660-675 | testing/concurrent-simulator/properties.rs:699-714 — both copies are in the same file, so extract the block into 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) testing/concurrent-simulator/properties.rs:805— testing/concurrent-simulator/properties.rs:805-820 | testing/concurrent-simulator/properties.rs:860-875 — both copies are in the same file, so extract the block into 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) testing/differential-oracle/sql_gen/src/generate/expr.rs:350— testing/differential-oracle/sql_gen/src/generate/expr.rs:350-365 | testing/differential-oracle/sql_gen/src/generate/expr.rs:483-498 — both copies are in the same file, so extract the block into 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) testing/differential-oracle/sql_gen_prop/expression.rs:1397— testing/differential-oracle/sql_gen_prop/expression.rs:1397-1412 | testing/differential-oracle/sql_gen_prop/expression.rs:1446-1461 — both copies are in the same file, so extract the block into 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) testing/simulator/generation/property.rs:147— testing/simulator/generation/property.rs:147-162 | testing/simulator/generation/property.rs:215-230 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) testing/sqltest/src/backends/cli.rs:375— testing/sqltest/src/backends/cli.rs:375-390 | testing/sqltest/src/backends/js.rs:226-241 — before extracting anything, compare `testing/sqltest/src/backends/cli.rs` and `testing/sqltest/src/backends/js.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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 lines × 2) testing/sqltest/src/backends/cli.rs:393— testing/sqltest/src/backends/cli.rs:393-408 | testing/sqltest/src/backends/js.rs:244-259 — before extracting anything, compare `testing/sqltest/src/backends/cli.rs` and `testing/sqltest/src/backends/js.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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) bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:68— bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:68-84 | bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:110-126 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:68` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) bindings/javascript/sync/src/js_protocol_io.rs:257— bindings/javascript/sync/src/js_protocol_io.rs:257-273 | sync/sdk-kit/src/sync_engine_io.rs:329-345 — 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 lines × 2) core/functions/datetime.rs:1174— core/functions/datetime.rs:1174-1190 | core/functions/datetime.rs:1209-1225 — both copies are in the same file, so extract the block into 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) core/incremental/vdbe_maintenance/aggregate.rs:389— core/incremental/vdbe_maintenance/aggregate.rs:389-405 | core/incremental/vdbe_maintenance/aggregate.rs:1086-1102 — both copies are in the same file, so extract the block into 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) core/incremental/vdbe_maintenance/arrangement.rs:287— core/incremental/vdbe_maintenance/arrangement.rs:287-303 | core/incremental/vdbe_maintenance/join.rs:1186-1202 — before extracting anything, compare `core/incremental/vdbe_maintenance/arrangement.rs` and `core/incremental/vdbe_maintenance/join.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 (17 lines × 2) core/mvcc/cursor.rs:1285— core/mvcc/cursor.rs:1285-1301 | core/mvcc/cursor.rs:2186-2202 — both copies are in the same file, so extract the block into 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) core/translate/analyze.rs:217— core/translate/analyze.rs:217-233 | core/translate/trigger.rs:226-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 (17 lines × 2) core/translate/emitter/mod.rs:1699— core/translate/emitter/mod.rs:1699-1715 | core/translate/emitter/mod.rs:1825-1841 — both copies are in the same file, so extract the block into 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) core/translate/emitter/mod.rs:2417— core/translate/emitter/mod.rs:2417-2433 | core/translate/upsert.rs:1816-1832 — 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 lines × 2) core/translate/emitter/update.rs:1499— core/translate/emitter/update.rs:1499-1515 | core/translate/upsert.rs:983-999 — before extracting anything, compare `core/translate/emitter/update.rs` and `core/translate/upsert.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) core/translate/expr/walk.rs:131— core/translate/expr/walk.rs:131-147 | core/translate/expr/walk.rs:466-482 — both copies are in the same file, so extract the block into 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) core/translate/window.rs:3148— core/translate/window.rs:3148-3164 | core/translate/window.rs:3286-3302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) sqlite/parser/src/ast/fmt.rs:572— sqlite/parser/src/ast/fmt.rs:572-588 | sqlite/parser/src/ast/fmt.rs:2364-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 (17 lines × 2) sqlite/parser/src/lexer.rs:423— sqlite/parser/src/lexer.rs:423-439 | sqlite/parser/src/lexer.rs:461-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) sync/engine/src/database_sync_engine.rs:1970— sync/engine/src/database_sync_engine.rs:1970-1986 | sync/engine/src/database_sync_engine.rs:2286-2302 — both copies are in the same file, so extract the block into 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) sync/engine/src/database_sync_operations.rs:234— sync/engine/src/database_sync_operations.rs:234-250 | sync/engine/src/database_sync_operations.rs:535-551 — both copies are in the same file, so extract the block into 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) testing/differential-oracle/sql_gen/src/schema.rs:108— testing/differential-oracle/sql_gen/src/schema.rs:108-124 | testing/differential-oracle/sql_gen_prop/schema.rs:90-106 — before extracting anything, compare `testing/differential-oracle/sql_gen/src/schema.rs` and `testing/differential-oracle/sql_gen_prop/schema.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) testing/sqltest/src/parser/mod.rs:772— testing/sqltest/src/parser/mod.rs:772-788 | testing/sqltest/src/parser/mod.rs:804-820 — both copies are in the same file, so extract the block into 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) core/translate/schema.rs:2825— core/translate/schema.rs:2825-2841 | core/translate/schema.rs:2975-2991 — both copies are in the same file, so extract the block into 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) perf/latency/sqlite_engine.rs:102— perf/latency/sqlite_engine.rs:102-118 | perf/latency/turso_engine.rs:62-78 — before extracting anything, compare `perf/latency/sqlite_engine.rs` and `perf/latency/turso_engine.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) perf/tatp/main.rs:897— perf/tatp/main.rs:897-913 | perf/throughput/main.rs:621-637 — `perf/tatp/main.rs` and `perf/throughput/main.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 18 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (15 lines × 2) core/incremental/vdbe_maintenance/aggregate.rs:168— core/incremental/vdbe_maintenance/aggregate.rs:168-182 | core/incremental/vdbe_maintenance/join.rs:779-793 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/join.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 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) core/incremental/vdbe_maintenance/set_op.rs:544— core/incremental/vdbe_maintenance/set_op.rs:544-558 | core/incremental/vdbe_maintenance/set_op.rs:735-749 — both copies are in the same file, so extract the block into 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) core/incremental/vdbe_maintenance/stream.rs:267— core/incremental/vdbe_maintenance/stream.rs:267-281 | core/incremental/vdbe_maintenance/stream.rs:341-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) core/json/jsonb.rs:1706— core/json/jsonb.rs:1706-1720 | core/json/jsonb.rs:1770-1784 — both copies are in the same file, so extract the block into 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) core/mvcc/database/checkpoint_state_machine.rs:3159— core/mvcc/database/checkpoint_state_machine.rs:3159-3173 | core/mvcc/database/checkpoint_state_machine.rs:3183-3197 — both copies are in the same file, so extract the block into 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) core/storage/wal.rs:2192— core/storage/wal.rs:2192-2206 | core/storage/wal.rs:2222-2236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) core/translate/display.rs:668— core/translate/display.rs:668-682 | core/translate/display.rs:788-802 — both copies are in the same file, so extract the block into 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) core/translate/fkeys.rs:311— core/translate/fkeys.rs:311-325 | core/translate/insert.rs:4341-4355 — before extracting anything, compare `core/translate/fkeys.rs` and `core/translate/insert.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 130 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) core/translate/index.rs:1415— core/translate/index.rs:1415-1429 | core/translate/schema.rs:2091-2105 — before extracting anything, compare `core/translate/index.rs` and `core/translate/schema.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 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) core/translate/schema.rs:340— core/translate/schema.rs:340-354 | core/translate/schema.rs:649-663 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:2984— core/vdbe/execute.rs:2984-2998 | core/vdbe/execute.rs:3400-3414 — both copies are in the same file, so extract the block into 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) core/vector/operations/distance_cos.rs:98— core/vector/operations/distance_cos.rs:98-112 | core/vector/operations/distance_cos.rs:143-157 — both copies are in the same file, so extract the block into 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) serverless/rust/differential/lib.rs:353— serverless/rust/differential/lib.rs:353-367 | serverless/rust/differential/lib.rs:572-586 — both copies are in the same file, so extract the block into 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) sqlite/parser/src/ast/fmt.rs:422— sqlite/parser/src/ast/fmt.rs:422-436 | sqlite/parser/src/ast/fmt.rs:445-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 (15 lines × 2) sync/engine/src/types.rs:373— sync/engine/src/types.rs:373-387 | sync/engine/src/types.rs:416-430 — both copies are in the same file, so extract the block into 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) sync/sdk-kit/src/rsapi.rs:293— sync/sdk-kit/src/rsapi.rs:293-307 | sync/sdk-kit/src/rsapi.rs:348-362 — both copies are in the same file, so extract the block into 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) testing/simulator/generation/property.rs:786— testing/simulator/generation/property.rs:786-800 | testing/simulator/generation/property.rs:1011-1025 — both copies are in the same file, so extract the block into 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) REDACTED:553— REDACTED:553-567 | REDACTED:1040-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 (15 lines × 2) core/storage/pager.rs:4107— core/storage/pager.rs:4107-4123 | core/storage/pager.rs:4153-4167 — both copies are in the same file, so extract the block into 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) REDACTED:1726— REDACTED:1726-1740 | REDACTED:4588-4602 — both copies are in the same file, so extract the block into 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) bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:237— bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:237-251 | bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:256-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
PostgreSQLTranslator::translate_target_list (cognitive 65) REDACTED:2810— PostgreSQLTranslator::translate_target_list has cognitive complexity 65 (threshold 15). Drivers by points: if/else 14 (56 pts), match/switch 2 (8 pts), loops 1 (nesting depth added 48). 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.
PostgreSQLTranslator::translate_expr (cognitive 60) REDACTED:2887— PostgreSQLTranslator::translate_expr has cognitive complexity 60 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 9 (24 pts), loops 2 (7 pts), boolean chains 1 (nesting depth added 36). 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.
PostgreSQLTranslator::translate_create_table (cognitive 54) REDACTED:264— PostgreSQLTranslator::translate_create_table has cognitive complexity 54 (threshold 15). Drivers by points: if/else 17 (40 pts), match/switch 3 (7 pts), loops 4 (6 pts), boolean chains 1 (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.
PostgreSQLTranslator::translate_on_conflict (cognitive 37) REDACTED:4552— PostgreSQLTranslator::translate_on_conflict has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (27 pts), match/switch 4 (8 pts), loops 1 (2 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostgreSQLTranslator::translate_create_sequence (cognitive 35) REDACTED:4809— PostgreSQLTranslator::translate_create_sequence has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostgreSQLTranslator::translate_range_function (cognitive 33) REDACTED:2244— PostgreSQLTranslator::translate_range_function has cognitive complexity 33 (threshold 15). Drivers by points: if/else 13 (17 pts), match/switch 6 (12 pts), boolean chains 4 (nesting depth added 10). Of this number, 32 points are the body's own statements and 1 belongs to one function item inside it that branches. 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.
PostgreSQLTranslator::translate_create_table_column (cognitive 31) REDACTED:510— PostgreSQLTranslator::translate_create_table_column has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4, match/switch 2 (4 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostgreSQLTranslator::translate_values (cognitive 25) REDACTED:1640— PostgreSQLTranslator::translate_values has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 16). 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.
PostgreSQLTranslator::has_distinct_output_names (cognitive 22) REDACTED:1984— PostgreSQLTranslator::has_distinct_output_names has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 1 (3 pts), loops 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostgreSQLTranslator::translate_insert (cognitive 21) REDACTED:1507— PostgreSQLTranslator::translate_insert has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, 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.
PostgreSQLTranslator::translate_func_call (cognitive 21) REDACTED:3847— PostgreSQLTranslator::translate_func_call has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (17 pts), boolean chains 2, match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PostgreSQLTranslator::translate_frame_options (cognitive 21) REDACTED:4060— PostgreSQLTranslator::translate_frame_options has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20 (21 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PostgreSQLTranslator::translate_create_domain (cognitive 21) REDACTED:4944— PostgreSQLTranslator::translate_create_domain has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 2 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostgreSQLTranslator::translate_select (cognitive 18) REDACTED:1811— PostgreSQLTranslator::translate_select has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (12 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PostgreSQLTranslator::translate_alter_table (cognitive 17) REDACTED:805— PostgreSQLTranslator::translate_alter_table has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (10 pts), if/else 6 (7 pts) (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.
PostgreSQLTranslator::flatten_join_tree (cognitive 17) REDACTED:2698— PostgreSQLTranslator::flatten_join_tree has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12, match/switch 3 (5 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.
PostgreSQLTranslator::translate_order_by (cognitive 17) REDACTED:4676— PostgreSQLTranslator::translate_order_by has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 2 (4 pts), loops 1 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PostgreSQLTranslator::translate_update (cognitive 16) REDACTED:1694— PostgreSQLTranslator::translate_update has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostgreSQLTranslator::translate_set_operation (cognitive 16) REDACTED:1918— PostgreSQLTranslator::translate_set_operation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), boolean chains 4, loops 2 (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.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:190— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:163— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:274— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoAutomaticSyncCoordinator.cs:49— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoBatch.cs:78— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoBatch.cs:131— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoCommand.cs:113— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoCommand.cs:280— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoConnection.cs:192— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoConnection.cs:357— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoConnection.cs:393— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoConnection.cs:422— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoConnection.cs:451— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoConnection.cs:487— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoConnection.cs:500— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoConnection.cs:669— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoConnection.cs:677— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:880— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:883— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
BTreeCursor::balance_non_root (cognitive 311) REDACTED:3604— BTreeCursor::balance_non_root has cognitive complexity 311 (threshold 15). Drivers by points: if/else 75 (224 pts), loops 21 (67 pts), match/switch 4 (14 pts), boolean chains 6 (nesting depth added 205). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeCursor::post_balance_non_root_validation (cognitive 174) REDACTED:4991— BTreeCursor::post_balance_non_root_validation has cognitive complexity 174 (threshold 15). Drivers by points: if/else 38 (132 pts), loops 7 (17 pts), match/switch 5 (17 pts), boolean chains 8 (nesting depth added 116). 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.
BTreeCursor::delete (cognitive 85) REDACTED:7028— BTreeCursor::delete has cognitive complexity 85 (threshold 15). Drivers by points: if/else 24 (62 pts), match/switch 5 (14 pts), loops 2 (6 pts), boolean chains 3 (nesting depth added 51). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeCursor::destroy_btree_contents (cognitive 79) REDACTED:5606— BTreeCursor::destroy_btree_contents has cognitive complexity 79 (threshold 15). Drivers by points: if/else 13 (42 pts), match/switch 9 (36 pts), loops 1 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeCursor::insert_into_page (cognitive 64) REDACTED:3162— BTreeCursor::insert_into_page has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (55 pts), match/switch 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 39). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeCursor::count (cognitive 62) REDACTED:7482— BTreeCursor::count has cognitive complexity 62 (threshold 15). Drivers by points: if/else 12 (41 pts), match/switch 4 (15 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeCursor::get_prev_record (cognitive 56) REDACTED:1453— BTreeCursor::get_prev_record has cognitive complexity 56 (threshold 15). Drivers by points: if/else 18 (46 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeCursor::get_next_record (cognitive 42) REDACTED:1759— BTreeCursor::get_next_record has cognitive complexity 42 (threshold 15). Drivers by points: if/else 12 (29 pts), match/switch 3 (9 pts), boolean chains 3, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeCursor::balance (cognitive 39) REDACTED:3401— BTreeCursor::balance has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 2 (6 pts), boolean chains 4, match/switch 1 (2 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.
BTreeCursor::indexbtree_seek_impl (cognitive 37) REDACTED:2962— BTreeCursor::indexbtree_seek_impl has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 3 (5 pts), boolean chains 2, loops 1 (nesting depth added 16). Of this number, 36 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeCursor::tablebtree_leaf_search::leaf_search (cognitive 36) REDACTED:2691— BTreeCursor::tablebtree_leaf_search::leaf_search has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 3 (7 pts), boolean chains 4, 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.
BTreeCursor::indexbtree_move_to_inner (cognitive 29) REDACTED:2364— BTreeCursor::indexbtree_move_to_inner has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 4 (8 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.
BTreeCursor::move_to_rightmost (cognitive 27) REDACTED:1991— BTreeCursor::move_to_rightmost has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (21 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeCursor::clear_overflow_pages (cognitive 27) REDACTED:5499— BTreeCursor::clear_overflow_pages has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 1 (2 pts), boolean chains 1, 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.
BTreeCursor::tablebtree_move_inner (cognitive 24) REDACTED:2117— BTreeCursor::tablebtree_move_inner has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 4 (8 pts), loops 1 (nesting depth added 10). Of this number, 14 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeCursor::next (cognitive 19) REDACTED:6744— BTreeCursor::next has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeCursor::process_overflow_read (cognitive 18) REDACTED:1617— BTreeCursor::process_overflow_read has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 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.
BTreeCursor::seek_end (cognitive 17) REDACTED:7851— BTreeCursor::seek_end has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (5 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×17
Members sharing a duplicated core (4 members, 50+ identical tokens) cli/mcp_server.rs:725— cli/mcp_server.rs:725-736 | cli/mcp_server.rs:738-749 | cli/mcp_server.rs:751-762 | cli/mcp_server.rs:764-775 — 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) core/incremental/vdbe_maintenance/aggregate.rs:118— core/incremental/vdbe_maintenance/aggregate.rs:118-1116 | core/incremental/vdbe_maintenance/arrangement.rs:35-464 | core/incremental/vdbe_maintenance/members.rs:50-92 | core/incremental/vdbe_maintenance/set_op.rs:319-1111 — 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) core/io/generic.rs:19— core/io/generic.rs:19-33 | core/io/io_uring.rs:460-483 | core/io/unix.rs:50-73 | sync/engine/src/sparse_io.rs:23-36 — 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) core/json/jsonb.rs:347— core/json/jsonb.rs:347-406 | core/json/jsonb.rs:426-490 | core/json/jsonb.rs:512-571 | core/json/jsonb.rs:593-652 — 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) core/storage/encryption.rs:465— core/storage/encryption.rs:465-477 | core/storage/encryption.rs:480-492 | core/storage/encryption.rs:495-507 | core/storage/encryption.rs:515-527 — 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) core/time/mod.rs:879— core/time/mod.rs:879-903 | core/time/mod.rs:906-930 | core/time/mod.rs:933-957 | core/time/mod.rs:960-984 — 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) core/translate/emitter/mod.rs:2414— core/translate/emitter/mod.rs:2414-2472 | core/translate/emitter/update.rs:1114-2732 | core/translate/upsert.rs:1765-1798 | core/translate/upsert.rs:1810-1838 — 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) core/vdbe/execute.rs:7164— core/vdbe/execute.rs:7164-7204 | core/vdbe/execute.rs:7228-7268 | core/vdbe/execute.rs:7276-7316 | core/vdbe/execute.rs:7324-7364 — 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) core/vdbe/hash_table.rs:2205— core/vdbe/hash_table.rs:2205-2220 | core/vdbe/hash_table.rs:2224-2251 | core/vdbe/hash_table.rs:2255-2291 | core/vdbe/hash_table.rs:2296-2321 — 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) core/vector/mod.rs:122— core/vector/mod.rs:122-135 | core/vector/mod.rs:137-150 | core/vector/mod.rs:152-165 | core/vector/mod.rs:167-180 — 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) core/vector/operations/distance_cos.rs:14— core/vector/operations/distance_cos.rs:14-41 | core/vector/operations/distance_dot.rs:14-41 | core/vector/operations/distance_l2.rs:14-43 | core/vector/operations/jaccard.rs:6-33 — 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) postgres/parser/parser.rs:100— postgres/parser/parser.rs:100-194 | postgres/parser/parser.rs:268-304 | postgres/parser/parser.rs:307-340 | postgres/parser/parser.rs:623-705 — 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) sync/engine/src/database_sync_operations.rs:1920— sync/engine/src/database_sync_operations.rs:1920-2091 | sync/engine/src/database_sync_operations.rs:2099-2194 | sync/engine/src/database_sync_operations.rs:2213-2294 | sync/engine/src/database_sync_operations.rs:3417-3503 — 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) testing/sqltest/src/backends/cli.rs:113— testing/sqltest/src/backends/cli.rs:113-150 | testing/sqltest/src/backends/js.rs:79-115 | testing/sqltest/src/backends/rust.rs:107-160 | testing/sqltest/src/backends/tursopg.rs:71-169 — 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) bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:173— bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:173-190 | bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:194-211 | bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:215-232 | bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:344-365 — 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) REDACTED:1250— REDACTED:1250-1272 | REDACTED:2074-2185 | REDACTED:2504-2582 | REDACTED:3125-3157 — 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) REDACTED:2908— REDACTED:2908-2973 | REDACTED:2980-3026 | REDACTED:3062-3117 | REDACTED:3374-3410 — 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 (18 lines × 2) bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:352— bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:352-369 | bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:430-447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/ext/mod.rs:137— core/ext/mod.rs:137-154 | core/ext/mod.rs:205-222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/functions/string.rs:13— core/functions/string.rs:13-30 | core/functions/string.rs:52-69 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/index_method/toy_vector_sparse_ivf.rs:644— core/index_method/toy_vector_sparse_ivf.rs:644-661 | core/index_method/toy_vector_sparse_ivf.rs:944-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.
Duplicated block (18 lines × 2) REDACTED:5065— REDACTED:5065-5082 | REDACTED:5084-5101 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) REDACTED:8434— REDACTED:8434-8451 | REDACTED:8506-8523 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/translate/fkeys.rs:1304— core/translate/fkeys.rs:1304-1321 | core/translate/insert.rs:4111-4128 — before extracting anything, compare `core/translate/fkeys.rs` and `core/translate/insert.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 130 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 lines × 2) core/translate/optimizer/constraints.rs:841— core/translate/optimizer/constraints.rs:841-858 | core/translate/optimizer/constraints.rs:944-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.
Duplicated block (18 lines × 2) core/translate/optimizer/constraints.rs:1081— core/translate/optimizer/constraints.rs:1081-1098 | core/translate/optimizer/constraints.rs:1180-1197 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/translate/pragma.rs:1401— core/translate/pragma.rs:1401-1418 | core/translate/pragma.rs:1466-1483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) core/util.rs:2873— core/util.rs:2873-2890 | core/util.rs:3679-3696 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) macros/src/ext/vfs_derive.rs:29— macros/src/ext/vfs_derive.rs:29-46 | macros/src/ext/vfs_derive.rs:54-71 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) postgres/parser/parser.rs:278— postgres/parser/parser.rs:278-295 | postgres/parser/parser.rs:315-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:175— bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:175-192 | bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:203-220 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:175` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) bindings/python/turso/lib.py:235— bindings/python/turso/lib.py:235-252 | serverless/python/turso_serverless/connection.py:82-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) REDACTED:1146— REDACTED:1146-1163 | REDACTED:2335-2352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) REDACTED:673— REDACTED:673-684 | bindings/dotnet/src/Turso.Data/TursoDataReader.cs:192-202 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:673` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) bindings/c/src/lib.rs:1288— bindings/c/src/lib.rs:1288-1298 | bindings/c/src/lib.rs:1392-1403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) REDACTED:1571— REDACTED:1571-1581 | REDACTED:1738-1749 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) core/functions/datetime.rs:805— core/functions/datetime.rs:805-815 | core/functions/datetime.rs:826-837 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) core/incremental/vdbe_maintenance/join.rs:1302— core/incremental/vdbe_maintenance/join.rs:1302-1313 | core/translate/insert.rs:1215-1225 — 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–12 lines × 2) core/mvcc/database/checkpoint_state_machine.rs:3002— core/mvcc/database/checkpoint_state_machine.rs:3002-3012 | core/mvcc/database/checkpoint_state_machine.rs:3153-3164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) core/mvcc/database/checkpoint_state_machine.rs:3025— core/mvcc/database/checkpoint_state_machine.rs:3025-3035 | core/mvcc/database/checkpoint_state_machine.rs:3177-3188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) core/mvcc/persistent_storage/logical_log.rs:2941— core/mvcc/persistent_storage/logical_log.rs:2941-2952 | core/mvcc/persistent_storage/logical_log.rs:3241-3251 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) core/translate/fkeys.rs:1229— core/translate/fkeys.rs:1229-1240 | core/translate/fkeys.rs:1400-1410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) core/translate/schema.rs:225— core/translate/schema.rs:225-236 | core/translate/schema.rs:238-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 (11–12 lines × 2) core/translate/schema.rs:2053— core/translate/schema.rs:2053-2063 | core/translate/schema.rs:2171-2182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) core/vdbe/execute.rs:3837— core/vdbe/execute.rs:3837-3847 | core/vdbe/execute.rs:3922-3933 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) sql_generation/generation/predicate/binary.rs:251— sql_generation/generation/predicate/binary.rs:251-261 | sql_generation/generation/predicate/binary.rs:318-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) testing/concurrent-simulator/lib.rs:1131— testing/concurrent-simulator/lib.rs:1131-1142 | testing/concurrent-simulator/lib.rs:1466-1476 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) REDACTED:3253— REDACTED:3253-3264 | REDACTED:3331-3341 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
sqltest::run_tests (cognitive 48) testing/sqltest/src/main.rs:229— sqltest::run_tests has cognitive complexity 48 (threshold 15). Drivers by points: if/else 22 (34 pts), match/switch 7 (9 pts), loops 3 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sqltest::runner::run_single (cognitive 40) testing/sqltest/src/runner/mod.rs:460— sqltest::runner::run_single has cognitive complexity 40 (threshold 15). Drivers by points: if/else 14 (25 pts), match/switch 6 (11 pts), loops 3, 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.
sqltest::check_files (cognitive 35) testing/sqltest/src/main.rs:532— sqltest::check_files has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 4 (8 pts), match/switch 2 (8 pts) (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sqltest::tcl_converter::parser::parse_tcl_file (cognitive 34) testing/sqltest/src/tcl_converter/parser.rs:514— sqltest::tcl_converter::parser::parse_tcl_file has cognitive complexity 34 (threshold 15). Drivers by points: loops 5 (16 pts), match/switch 3 (11 pts), if/else 2 (6 pts), boolean chains 1 (nesting depth added 23). 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.
sqltest::convert_single_file (cognitive 33) testing/sqltest/src/main.rs:726— sqltest::convert_single_file has cognitive complexity 33 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (5 pts), match/switch 2 (4 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
sqltest::tcl_converter::write_test (cognitive 29) testing/sqltest/src/tcl_converter/mod.rs:135— sqltest::tcl_converter::write_test has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (8 pts), match/switch 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.
sqltest::snapshot::find_all_pending_snapshots::scan_dir (cognitive 28) testing/sqltest/src/snapshot/mod.rs:528— sqltest::snapshot::find_all_pending_snapshots::scan_dir has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
sqltest::snapshot::format_explain_output (cognitive 25) testing/sqltest/src/snapshot/mod.rs:790— sqltest::snapshot::format_explain_output has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (21 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.
sqltest::tcl_converter::parser::extract_tests_from_block (cognitive 24) testing/sqltest/src/tcl_converter/parser.rs:374— sqltest::tcl_converter::parser::extract_tests_from_block has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 3 (8 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sqltest::parser::lexer::extract_block_content (cognitive 23) testing/sqltest/src/parser/lexer.rs:8— sqltest::parser::lexer::extract_block_content has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (19 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sqltest::snapshot::format_explain_query_plan_output (cognitive 21) testing/sqltest/src/snapshot/mod.rs:960— sqltest::snapshot::format_explain_query_plan_output has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 3 (4 pts) (nesting depth added 7). Most of this is not in the body itself: 9 of the 21 points are its own statements and the rest belongs to one function item inside it that branches (format_node). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
sqltest::convert_files (cognitive 18) testing/sqltest/src/main.rs:651— sqltest::convert_files has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 2 (8 pts), if/else 4 (5 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sqltest::snapshot::find_pending_snapshots (cognitive 16) testing/sqltest/src/snapshot/mod.rs:498— sqltest::snapshot::find_pending_snapshots has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 1 (2 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
sqltest::tcl_converter::parser::clean_expected (cognitive 16) testing/sqltest/src/tcl_converter/parser.rs:662— sqltest::tcl_converter::parser::clean_expected has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sql_gen::generate::select::generate_select_impl_inner (cognitive 86) testing/differential-oracle/sql_gen/src/generate/select.rs:245— sql_gen::generate::select::generate_select_impl_inner has cognitive complexity 86 (threshold 15). Drivers by points: if/else 36 (58 pts), boolean chains 11, match/switch 8 (10 pts), loops 2 (7 pts) (nesting depth added 29). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sql_gen::generate::select::generate_aggregate_call (cognitive 31) testing/differential-oracle/sql_gen/src/generate/select.rs:595— sql_gen::generate::select::generate_aggregate_call has cognitive complexity 31 (threshold 15). Drivers by points: if/else 18 (22 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
sql_gen::generate::stmt::generate_update_sets (cognitive 29) testing/differential-oracle/sql_gen/src/generate/stmt.rs:497— sql_gen::generate::stmt::generate_update_sets has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 3, match/switch 1 (3 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.
sql_gen::generate::stmt::generate_create_table (cognitive 28) testing/differential-oracle/sql_gen/src/generate/stmt.rs:746— sql_gen::generate::stmt::generate_create_table has cognitive complexity 28 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 3 (4 pts), boolean chains 2, 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.
sql_gen::generate::select::generate_join_clauses (cognitive 25) testing/differential-oracle/sql_gen/src/generate/select.rs:1339— sql_gen::generate::select::generate_join_clauses has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (17 pts), boolean chains 4, match/switch 2 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sql_gen::generate::select::generate_select_columns (cognitive 23) testing/differential-oracle/sql_gen/src/generate/select.rs:806— sql_gen::generate::select::generate_select_columns has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 2, loops 1 (2 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sql_gen::generate::stmt::collect_capability_allowed_stmts (cognitive 22) testing/differential-oracle/sql_gen/src/generate/stmt.rs:65— sql_gen::generate::stmt::collect_capability_allowed_stmts has cognitive complexity 22 (threshold 15). Drivers by points: if/else 22. 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.
sql_gen::generate::stmt::generate_update (cognitive 20) testing/differential-oracle/sql_gen/src/generate/stmt.rs:369— sql_gen::generate::stmt::generate_update has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sql_gen::generate::select::generate_supported_correlation_predicate (cognitive 19) testing/differential-oracle/sql_gen/src/generate/select.rs:94— sql_gen::generate::select::generate_supported_correlation_predicate has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (11 pts), if/else 3 (8 pts) (nesting depth added 11). 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.
sql_gen::trace::build_coverage_tree (cognitive 19) testing/differential-oracle/sql_gen/src/trace.rs:326— sql_gen::trace::build_coverage_tree has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (12 pts), if/else 3 (7 pts) (nesting depth added 12). 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.
sql_gen::generate::stmt::generate_insert_values (cognitive 17) testing/differential-oracle/sql_gen/src/generate/stmt.rs:321— sql_gen::generate::stmt::generate_insert_values has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sql_gen::generate::select::generate_select_impl (cognitive 16) testing/differential-oracle/sql_gen/src/generate/select.rs:169— sql_gen::generate::select::generate_select_impl has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, loops 1 (2 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sql_gen::generate::select::generate_window_function (cognitive 16) testing/differential-oracle/sql_gen/src/generate/select.rs:946— sql_gen::generate::select::generate_window_function has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 3, match/switch 1 (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.
Duplicated block (8 lines × 3) core/ext/mod.rs:124— core/ext/mod.rs:124-131 | core/ext/mod.rs:160-167 | core/ext/mod.rs:192-199 — 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) REDACTED:1534— REDACTED:1534-1542 | REDACTED:2028-2036 | REDACTED:2703-2710 — 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) core/translate/main_loop/seek.rs:425— core/translate/main_loop/seek.rs:425-432 | core/translate/main_loop/seek.rs:434-441 | core/translate/main_loop/seek.rs:443-450 — 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) core/translate/schema.rs:1865— core/translate/schema.rs:1865-1872 | core/translate/schema.rs:2732-2739 | core/translate/view.rs:415-422 — before extracting anything, compare `core/translate/schema.rs` and `core/translate/view.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 (8 lines × 3) core/vdbe/vacuum.rs:769— core/vdbe/vacuum.rs:769-776 | core/vdbe/vacuum.rs:1023-1030 | core/vdbe/vacuum.rs:1069-1076 — 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) bindings/java/rs_src/turso_connection.rs:47— bindings/java/rs_src/turso_connection.rs:47-54 | bindings/java/rs_src/turso_db.rs:231-238 | bindings/java/rs_src/turso_statement.rs:94-101 — 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 (8 lines × 3) testing/simulator/generation/property.rs:314— testing/simulator/generation/property.rs:314-321 | testing/simulator/generation/property.rs:390-399 | testing/simulator/generation/property.rs:526-535 — 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) postgres/regress/describe.rs:229— postgres/regress/describe.rs:229-236 | postgres/regress/describe.rs:671-678 | postgres/regress/describe.rs:699-706 — 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) core/storage/sqlite3_ondisk.rs:1027— core/storage/sqlite3_ondisk.rs:1027-1034 | core/storage/sqlite3_ondisk.rs:1059-1066 | core/storage/sqlite3_ondisk.rs:1095-1102 — 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) bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:141— bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:141-148 | bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:152-159 | bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:163-170 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `x` to `Date` in one and `Time` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (8 lines × 3) perf/latency/main.rs:546— perf/latency/main.rs:546-553 | perf/tatp/main.rs:1043-1050 | perf/throughput/main.rs:767-774 — `perf/latency/main.rs` and `perf/tatp/main.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (8 lines × 3) REDACTED:2859— REDACTED:2859-2866 | REDACTED:3250-3257 | REDACTED:3267-3274 — 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) perf/latency/main.rs:563— perf/latency/main.rs:563-570 | perf/tatp/main.rs:866-873 | perf/throughput/main.rs:589-596 — `perf/latency/main.rs` and `perf/tatp/main.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
BTreeCursor::balance_non_root (cyclomatic 87) REDACTED:3604— BTreeCursor::balance_non_root has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BTreeCursor::post_balance_non_root_validation (cyclomatic 60) REDACTED:4991— BTreeCursor::post_balance_non_root_validation has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BTreeCursor::delete (cyclomatic 39) REDACTED:7028— BTreeCursor::delete has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BTreeCursor::destroy_btree_contents (cyclomatic 29) REDACTED:5606— BTreeCursor::destroy_btree_contents 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.
BTreeCursor::insert_into_page (cyclomatic 26) REDACTED:3162— BTreeCursor::insert_into_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.
BTreeCursor::get_prev_record (cyclomatic 25) REDACTED:1453— BTreeCursor::get_prev_record 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.
BTreeCursor::tablebtree_leaf_search::leaf_search (cyclomatic 25) REDACTED:2691— BTreeCursor::tablebtree_leaf_search::leaf_search 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.
BTreeCursor::indexbtree_seek_impl (cyclomatic 22) REDACTED:2962— BTreeCursor::indexbtree_seek_impl has cyclomatic complexity 22 (threshold 15). Of this number, 17 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BTreeCursor::count (cyclomatic 21) REDACTED:7482— BTreeCursor::count 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.
BTreeCursor::get_next_record (cyclomatic 19) REDACTED:1759— BTreeCursor::get_next_record 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.
BTreeCursor::balance (cyclomatic 18) REDACTED:3401— BTreeCursor::balance 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.
BTreeCursor::indexbtree_move_to_inner (cyclomatic 16) REDACTED:2364— BTreeCursor::indexbtree_move_to_inner has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Parser::next_token (cyclomatic 54) sqlite/parser/src/parser.rs:402— Parser::next_token has cyclomatic complexity 54 (threshold 15). Of this number, 53 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.
Parser::parse_primary_expression (cyclomatic 40) postgres/parser/parser.rs:953— Parser::parse_primary_expression 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.
Parser::validate (cyclomatic 34) testing/sqltest/src/parser/mod.rs:734— Parser::validate has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Parser::parse_data_type (cyclomatic 31) postgres/parser/parser.rs:1757— Parser::parse_data_type 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.
Parser::parse_create_type (cyclomatic 29) sqlite/parser/src/parser.rs:4874— Parser::parse_create_type has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Parser::parse_test_or_snapshot (cyclomatic 29) testing/sqltest/src/parser/mod.rs:295— Parser::parse_test_or_snapshot 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::parse_named_column_constraints (cyclomatic 23) sqlite/parser/src/parser.rs:4193— Parser::parse_named_column_constraints 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.
Parser::parse_frame_opt (cyclomatic 21) sqlite/parser/src/parser.rs:1491— Parser::parse_frame_opt 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.
Parser::parse_expr_inner (cyclomatic 21) sqlite/parser/src/parser.rs:2183— Parser::parse_expr_inner has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Parser::parse_create_table_args (cyclomatic 20) sqlite/parser/src/parser.rs:3630— Parser::parse_create_table_args has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: Parser::parse_stmt (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Parser::parse_postfix_expression (cyclomatic 16) postgres/parser/parser.rs:852— Parser::parse_postfix_expression 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: Parser::parse_statement (cyclomatic 30) 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.
Parser::parse_type (cyclomatic 16) sqlite/parser/src/parser.rs:1282— Parser::parse_type has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: Parser::parse_stmt (cyclomatic 21) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
MvStore::recover_process_frame (cognitive 158) REDACTED:9732— MvStore::recover_process_frame has cognitive complexity 158 (threshold 15). Drivers by points: if/else 41 (131 pts), match/switch 10 (21 pts), boolean chains 4, loops 2 (nesting depth added 101). 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.
MvStore::maybe_complete_interrupted_checkpoint_nonblock (cognitive 80) REDACTED:9086— MvStore::maybe_complete_interrupted_checkpoint_nonblock has cognitive complexity 80 (threshold 15). Drivers by points: if/else 18 (54 pts), match/switch 7 (24 pts), boolean chains 1, loops 1 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MvStore::delete_from_table_or_index (cognitive 55) REDACTED:5652— MvStore::delete_from_table_or_index has cognitive complexity 55 (threshold 15). Drivers by points: if/else 15 (40 pts), loops 4 (10 pts), boolean chains 4, match/switch 1 (nesting depth added 31). 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.
MvStore::maybe_recover_logical_log (cognitive 50) REDACTED:9513— MvStore::maybe_recover_logical_log has cognitive complexity 50 (threshold 15). Drivers by points: if/else 13 (36 pts), match/switch 3 (9 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MvStore::rollback_savepoint_changes (cognitive 39) REDACTED:7441— MvStore::rollback_savepoint_changes has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (27 pts), loops 6 (11 pts), boolean chains 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MvStore::begin_exclusive_tx_with_checkpoint_read_guard (cognitive 35) REDACTED:6431— MvStore::begin_exclusive_tx_with_checkpoint_read_guard has cognitive complexity 35 (threshold 15). Drivers by points: if/else 20 (32 pts), boolean chains 2, match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MvStore::bootstrap_nonblock (cognitive 31) REDACTED:5145— MvStore::bootstrap_nonblock has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 2 (5 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.
MvStore::rollback_tx_inner (cognitive 21) REDACTED:7105— MvStore::rollback_tx_inner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 4, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MvStore::gc_incremental (cognitive 21) REDACTED:8140— MvStore::gc_incremental has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (16 pts), boolean chains 3, loops 1, match/switch 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MvStore::gc_index_incremental (cognitive 19) REDACTED:8285— MvStore::gc_index_incremental has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MvStore::gc_version_chain (cognitive 18) REDACTED:8518— MvStore::gc_version_chain has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 8, 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.
MvStore::acquire_exclusive_tx (cognitive 16) REDACTED:7650— MvStore::acquire_exclusive_tx has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
limbo_sim::run_simulator (cognitive 39) testing/simulator/main.rs:157— limbo_sim::run_simulator has cognitive complexity 39 (threshold 15). Drivers by points: if/else 15 (32 pts), loops 1 (3 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
limbo_sim::runner::differential::execute_interactions (cognitive 21) testing/simulator/runner/differential.rs:58— limbo_sim::runner::differential::execute_interactions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
limbo_sim::runner::doublecheck::execute_plans (cognitive 21) testing/simulator/runner/doublecheck.rs:81— limbo_sim::runner::doublecheck::execute_plans has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (4 pts), match/switch 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
limbo_sim::generation::property::run_integrity_check (cognitive 20) testing/simulator/generation/property.rs:1919— limbo_sim::generation::property::run_integrity_check has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (7 pts), 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.
limbo_sim::runner::execution::execute_interactions (cognitive 19) testing/simulator/runner/execution.rs:108— limbo_sim::runner::execution::execute_interactions has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
limbo_sim::runner::execution::execute_interaction_rusqlite (cognitive 19) testing/simulator/runner/execution.rs:417— limbo_sim::runner::execution::execute_interaction_rusqlite has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
limbo_sim::generation::property::read_user_table_names (cognitive 18) testing/simulator/generation/property.rs:1842— limbo_sim::generation::property::read_user_table_names has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
limbo_sim::generation::property::property_insert_values_select (cognitive 17) testing/simulator/generation/property.rs:2057— limbo_sim::generation::property::property_insert_values_select has cognitive complexity 17 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 1 (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.
limbo_sim::runner::execution::execute_interaction_turso (cognitive 17) testing/simulator/runner/execution.rs:229— limbo_sim::runner::execution::execute_interaction_turso has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
limbo_sim::runner::doublecheck::compare_results (cognitive 16) testing/simulator/runner/doublecheck.rs:179— limbo_sim::runner::doublecheck::compare_results has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 3 (6 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.
limbo_sim::runner::execution::finish_turso_query (cognitive 16) testing/simulator/runner/execution.rs:326— limbo_sim::runner::execution::finish_turso_query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 3, match/switch 1 (2 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.
limbo_sim::runner::execution::execute_query_rusqlite (cognitive 16) testing/simulator/runner/execution.rs:504— limbo_sim::runner::execution::execute_query_rusqlite has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (11 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Swallowed exception (empty catch) bindings/dotnet/src/Turso.Data/TursoAutomaticSyncCoordinator.cs:203— 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) bindings/dotnet/src/Turso.Data/TursoConnection.cs:791— 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) bindings/dotnet/src/Turso.Data/TursoReplicaRegistry.cs:140— 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) bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:370— 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) bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:432— 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) bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:447— 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) bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:471— 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) bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:485— 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) bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:548— 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) bindings/dotnet/src/Turso.Serverless.Client/HranaHttp.cs:68— 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) bindings/dotnet/src/Turso.Serverless.Client/TursoServerlessConnection.cs:232— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else).
Swallowed exception (empty catch) bindings/dotnet/src/Turso.Serverless.Client/TursoSession.cs:304— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else).
PostgreSQLTranslator::translate_expr (cyclomatic 53) REDACTED:2887— PostgreSQLTranslator::translate_expr has cyclomatic complexity 53 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PostgreSQLTranslator::translate_binary_expr (cyclomatic 37) REDACTED:3444— PostgreSQLTranslator::translate_binary_expr 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.
PostgreSQLTranslator::translate_create_table (cyclomatic 30) REDACTED:264— PostgreSQLTranslator::translate_create_table 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.
PostgreSQLTranslator::translate_create_table_column (cyclomatic 27) REDACTED:510— PostgreSQLTranslator::translate_create_table_column 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.
PostgreSQLTranslator::translate_range_function (cyclomatic 26) REDACTED:2244— PostgreSQLTranslator::translate_range_function has cyclomatic complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PostgreSQLTranslator::translate_create_sequence (cyclomatic 23) REDACTED:4809— PostgreSQLTranslator::translate_create_sequence 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: turso_pg_parser::translator::expression_name (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
PostgreSQLTranslator::flatten_join_tree (cyclomatic 21) REDACTED:2698— PostgreSQLTranslator::flatten_join_tree 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. This is NOT this file's highest cyclomatic complexity: turso_pg_parser::translator::expression_name (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
PostgreSQLTranslator::translate_alter_table (cyclomatic 19) REDACTED:805— PostgreSQLTranslator::translate_alter_table has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: turso_pg_parser::translator::expression_name (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
PostgreSQLTranslator::translate_a_expr (cyclomatic 19) REDACTED:3304— PostgreSQLTranslator::translate_a_expr has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: turso_pg_parser::translator::expression_name (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
PostgreSQLTranslator::translate_func_call (cyclomatic 18) REDACTED:3847— PostgreSQLTranslator::translate_func_call 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. This is NOT this file's highest cyclomatic complexity: turso_pg_parser::translator::expression_name (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
PostgreSQLTranslator::translate_frame_options (cyclomatic 16) REDACTED:4060— PostgreSQLTranslator::translate_frame_options 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: turso_pg_parser::translator::expression_name (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Duplicated block (10 lines × 3) REDACTED:546— REDACTED:546-555 | REDACTED:1033-1042 | bindings/dotnet/src/Turso.Data/TursoDataReader.cs:351-360 — 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 (10 lines × 3) bindings/java/rs_src/turso_statement.rs:164— bindings/java/rs_src/turso_statement.rs:164-173 | bindings/java/rs_src/turso_statement.rs:192-201 | bindings/java/rs_src/turso_statement.rs:220-229 — 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) core/incremental/vdbe_maintenance/aggregate.rs:764— core/incremental/vdbe_maintenance/aggregate.rs:764-773 | core/incremental/vdbe_maintenance/set_op.rs:730-739 | core/incremental/vdbe_maintenance/sink.rs:150-161 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/set_op.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) core/incremental/vdbe_maintenance/linear.rs:462— core/incremental/vdbe_maintenance/linear.rs:462-471 | core/incremental/vdbe_maintenance/source.rs:177-186 | core/incremental/vdbe_maintenance/stream.rs:260-269 — before extracting anything, compare `core/incremental/vdbe_maintenance/linear.rs` and `core/incremental/vdbe_maintenance/stream.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) core/time/internal.rs:146— core/time/internal.rs:146-155 | core/time/internal.rs:160-169 | core/time/internal.rs:174-183 — 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) core/translate/display.rs:126— core/translate/display.rs:126-135 | core/translate/display.rs:243-252 | core/translate/display.rs:352-361 — 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) core/vdbe/execute.rs:13207— core/vdbe/execute.rs:13207-13216 | core/vdbe/execute.rs:13229-13238 | core/vdbe/execute.rs:13397-13406 — 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) testing/simulator/generation/property.rs:882— testing/simulator/generation/property.rs:882-891 | testing/simulator/generation/property.rs:958-967 | testing/simulator/generation/property.rs:1038-1047 — 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) testing/simulator/main.rs:499— testing/simulator/main.rs:499-508 | testing/simulator/runner/differential.rs:26-35 | testing/simulator/runner/doublecheck.rs:22-31 — before extracting anything, compare `testing/simulator/runner/differential.rs` and `testing/simulator/runner/doublecheck.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 128 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) core/index_method/toy_vector_sparse_ivf.rs:523— core/index_method/toy_vector_sparse_ivf.rs:523-532 | core/index_method/toy_vector_sparse_ivf.rs:786-795 | core/index_method/toy_vector_sparse_ivf.rs:1556-1565 — 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) core/vdbe/explain.rs:2675— core/vdbe/explain.rs:2675-2684 | core/vdbe/explain.rs:2736-2745 | core/vdbe/explain.rs:2752-2761 — 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) REDACTED:9375— REDACTED:9375-9381 | REDACTED:9460-9465 | REDACTED:10406-10411 — 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) core/time/internal.rs:425— core/time/internal.rs:425-430 | core/time/internal.rs:433-438 | core/time/internal.rs:442-447 — 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) core/translate/window.rs:1389— core/translate/window.rs:1389-1395 | core/translate/window.rs:3371-3376 | core/translate/window.rs:3508-3513 — 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) testing/simulator/runner/file.rs:145— testing/simulator/runner/file.rs:145-150 | testing/simulator/runner/file.rs:171-176 | testing/simulator/runner/file.rs:229-235 — 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) testing/sqltest/src/backends/cli.rs:410— testing/sqltest/src/backends/cli.rs:410-415 | testing/sqltest/src/backends/js.rs:261-266 | testing/sqltest/src/backends/rust.rs:447-453 — before extracting anything, compare `testing/sqltest/src/backends/cli.rs` and `testing/sqltest/src/backends/js.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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) REDACTED:1647— REDACTED:1647-1652 | REDACTED:2110-2115 | REDACTED:2144-2149 — 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) perf/latency/main.rs:535— perf/latency/main.rs:535-540 | perf/tatp/main.rs:1020-1025 | perf/throughput/main.rs:744-749 — `perf/latency/main.rs` and `perf/tatp/main.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 3) perf/latency/main.rs:601— perf/latency/main.rs:601-606 | perf/tatp/main.rs:897-902 | perf/throughput/main.rs:621-626 — `perf/latency/main.rs` and `perf/tatp/main.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 3) perf/latency/main.rs:650— perf/latency/main.rs:650-655 | perf/tatp/main.rs:955-960 | perf/throughput/main.rs:679-684 — `perf/latency/main.rs` and `perf/tatp/main.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 3) perf/latency/main.rs:523— perf/latency/main.rs:523-528 | perf/tatp/main.rs:1008-1013 | perf/throughput/main.rs:732-737 — `perf/latency/main.rs` and `perf/tatp/main.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6 lines × 3) testing/cli_tests/collate.py:115— testing/cli_tests/collate.py:115-120 | testing/cli_tests/update.py:99-104 | testing/cli_tests/write.py:138-143 — 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) core/functions/printf.rs:1118— core/functions/printf.rs:1118-1122 | core/functions/printf.rs:1140-1144 | core/functions/printf.rs:1182-1186 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) core/storage/sqlite3_ondisk.rs:1555— core/storage/sqlite3_ondisk.rs:1555-1559 | core/storage/wal.rs:5880-5884 | core/storage/wal.rs:5959-5963 — 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 (5 lines × 3) postgres/cli/main.rs:213— postgres/cli/main.rs:213-217 | postgres/cli/main.rs:293-297 | postgres/cli/main.rs:354-358 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) sync/sdk-kit/src/rsapi.rs:296— sync/sdk-kit/src/rsapi.rs:296-300 | sync/sdk-kit/src/rsapi.rs:351-355 | sync/sdk-kit/src/rsapi.rs:412-416 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) testing/simulator/generation/property.rs:309— testing/simulator/generation/property.rs:309-313 | testing/simulator/generation/property.rs:385-389 | testing/simulator/generation/property.rs:521-525 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) core/functions/printf.rs:1113— core/functions/printf.rs:1113-1117 | core/functions/printf.rs:1135-1139 | core/functions/printf.rs:1177-1181 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) postgres/cli/main.rs:208— postgres/cli/main.rs:208-212 | postgres/cli/main.rs:288-292 | postgres/cli/main.rs:349-353 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) core/index_method/toy_vector_sparse_ivf.rs:171— core/index_method/toy_vector_sparse_ivf.rs:171-175 | core/index_method/toy_vector_sparse_ivf.rs:176-180 | core/index_method/toy_vector_sparse_ivf.rs:206-210 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) perf/latency/main.rs:634— perf/latency/main.rs:634-638 | perf/tatp/main.rs:973-977 | perf/throughput/main.rs:697-701 — `perf/latency/main.rs` and `perf/tatp/main.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 7 separate duplicated blocks between them, totalling at least 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (5 lines × 3) REDACTED:2678— REDACTED:2678-2682 | REDACTED:2703-2707 | REDACTED:2739-2743 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) REDACTED:852— REDACTED:852-859 | REDACTED:909-914 | REDACTED:924-928 — 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.
TooManyFields: Connection core/connection.rs:363— TooManyFields — 73 stored fields beside 308 methods. The bar is 30 stored fields; this is 43 over it, 2.43× 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: ProgramState core/vdbe/mod.rs:1034— TooManyFields — 61 stored fields beside 39 methods. The bar is 30 stored fields; this is 31 over it, 2.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: CheckpointStateMachine core/mvcc/database/checkpoint_state_machine.rs:287— TooManyFields — 55 stored fields beside 50 methods. The bar is 30 stored fields; this is 25 over it, 1.83× 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: ProgramBuilder core/vdbe/builder.rs:235— TooManyFields — 44 stored fields beside 121 methods. The bar is 30 stored fields; this is 14 over it, 1.47× 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: FtsCursor REDACTED:1019— TooManyFields — 44 stored fields beside 33 methods. The bar is 30 stored fields; this is 14 over it, 1.47× 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: MvStore REDACTED:4397— TooManyFields — 41 stored fields beside 197 methods. The bar is 30 stored fields; this is 11 over it, 1.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: BTreeCursor REDACTED:873— TooManyFields — 38 stored fields beside 92 methods. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: SimulatorCLI testing/simulator/runner/cli.rs:34— TooManyFields — 38 stored fields beside 1 method. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: SharedWalCoordinationMapHeader core/storage/shared_wal_coordination.rs:544— TooManyFields — 37 stored fields. The bar is 30 stored fields; this is 7 over it, 1.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Pager core/storage/pager.rs:1610— TooManyFields — 33 stored fields beside 147 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
Duplicated block (19 lines × 2) core/functions/printf.rs:537— core/functions/printf.rs:537-555 | core/functions/printf.rs:1007-1025 — both copies are in the same file, so extract the block into 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) core/functions/printf.rs:744— core/functions/printf.rs:744-762 | core/functions/printf.rs:775-793 — both copies are in the same file, so extract the block into 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) core/incremental/vdbe_maintenance/linear.rs:196— core/incremental/vdbe_maintenance/linear.rs:196-214 | core/incremental/vdbe_maintenance/set_op.rs:190-208 — before extracting anything, compare `core/incremental/vdbe_maintenance/linear.rs` and `core/incremental/vdbe_maintenance/set_op.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 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) core/json/jsonb.rs:3456— core/json/jsonb.rs:3456-3474 | core/json/jsonb.rs:3495-3513 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) core/mvcc/cursor.rs:1398— core/mvcc/cursor.rs:1398-1416 | core/mvcc/cursor.rs:1487-1505 — both copies are in the same file, so extract the block into 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) REDACTED:5686— REDACTED:5686-5704 | REDACTED:5732-5750 — both copies are in the same file, so extract the block into 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) REDACTED:3499— REDACTED:3499-3517 | REDACTED:3553-3571 — both copies are in the same file, so extract the block into 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) core/translate/result_row.rs:226— core/translate/result_row.rs:226-244 | core/translate/values.rs:306-324 — 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 × 2) core/vdbe/execute.rs:18958— core/vdbe/execute.rs:18958-18976 | core/vdbe/execute.rs:18980-18998 — both copies are in the same file, so extract the block into 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) sqlite/parser/src/parser.rs:478— sqlite/parser/src/parser.rs:478-496 | sqlite/parser/src/parser.rs:630-648 — both copies are in the same file, so extract the 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: Policy (LCOM4 16) testing/differential-oracle/sql_gen/src/policy.rs:18— Policy's methods fall into 16 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 16 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: Connection (LCOM4 6) core/connection.rs:363— Connection's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ProgramBuilder (LCOM4 6) core/vdbe/builder.rs:235— ProgramBuilder'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: FunctionDef (LCOM4 6) testing/differential-oracle/sql_gen/src/functions.rs:36— FunctionDef'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: TursoRow (LCOM4 5) bindings/dotnet/src/Turso.Serverless.Client/TursoResultSet.cs:11— TursoRow'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: FunctionDef (LCOM4 5) testing/differential-oracle/sql_gen_prop/function.rs:107— FunctionDef'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: ProcessLocalOwnershipState (LCOM4 4) core/storage/shared_wal_coordination.rs:131— ProcessLocalOwnershipState's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: TursoPgHandler (LCOM4 4) postgres/server/lib.rs:113— TursoPgHandler's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DatabaseReplayGenerator (LCOM4 4) sync/engine/src/database_replay_generator.rs:16— DatabaseReplayGenerator's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: Context (LCOM4 4) testing/differential-oracle/sql_gen/src/context.rs:23— Context'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.
Awaits without ConfigureAwait(false) bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:109— `await using … = state.Batch` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:140— `await using … = await ExecuteDbDataReaderAsync( CommandBehavior.Default, cancellati...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:173— `await using … = state.Batch` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:215— `await using … = state.Batch` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:221— `await using … = await state.Batch .ExecuteReaderAsync(behavior & ~CommandBehavior.C...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:224— `await using … = await ExecuteManagedAsync("ExecuteNonQuery", CommandBehavior.Defaul...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:240— `await using … = await ExecuteManagedAsync("ExecuteScalar", CommandBehavior.Default,...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:395— `await using … = await command .ExecuteReaderAsync(CommandBehavior.Default, cancella...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:356— `await using … = new global::Turso.TursoCommand(_connection!.ManagedConnection) { Co...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
Awaits without ConfigureAwait(false) bindings/dotnet/src/Turso.Data/TursoBatch.cs:99— `await using … = await ExecuteDbDataReaderAsync(CommandBehavior.Default, cancellatio...` resumes on the caller's captured context. In library code that context belongs to the host application, so a host that blocks on this call (or runs on a UI thread) can stall or deadlock — append `.ConfigureAwait(false)`.
MvStore::recover_process_frame (cyclomatic 63) REDACTED:9732— MvStore::recover_process_frame has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MvStore::maybe_complete_interrupted_checkpoint_nonblock (cyclomatic 34) REDACTED:9086— MvStore::maybe_complete_interrupted_checkpoint_nonblock 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.
MvStore::maybe_recover_logical_log (cyclomatic 25) REDACTED:9513— MvStore::maybe_recover_logical_log 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.
MvStore::delete_from_table_or_index (cyclomatic 23) REDACTED:5652— MvStore::delete_from_table_or_index 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.
MvStore::begin_exclusive_tx_with_checkpoint_read_guard (cyclomatic 22) REDACTED:6431— MvStore::begin_exclusive_tx_with_checkpoint_read_guard 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.
MvStore::bootstrap_nonblock (cyclomatic 21) REDACTED:5145— MvStore::bootstrap_nonblock 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.
MvStore::rollback_savepoint_changes (cyclomatic 18) REDACTED:7441— MvStore::rollback_savepoint_changes has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: CommitState::fmt (cyclomatic 19) 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.
MvStore::rollback_tx_inner (cyclomatic 16) REDACTED:7105— MvStore::rollback_tx_inner has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: CommitState::fmt (cyclomatic 19) 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.
MvStore::gc_incremental (cyclomatic 16) REDACTED:8140— MvStore::gc_incremental 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: CommitState::fmt (cyclomatic 19) 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.
Jsonb::navigate_to_segment (cognitive 171) core/json/jsonb.rs:2698— Jsonb::navigate_to_segment has cognitive complexity 171 (threshold 15). Drivers by points: if/else 43 (120 pts), loops 8 (29 pts), boolean chains 12, match/switch 4 (10 pts) (nesting depth added 104). 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.
Jsonb::deserialize_string (cognitive 110) core/json/jsonb.rs:1802— Jsonb::deserialize_string has cognitive complexity 110 (threshold 15). Drivers by points: if/else 34 (86 pts), loops 4 (11 pts), boolean chains 10, match/switch 1 (3 pts) (nesting depth added 61). 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.
Jsonb::deserialize_number (cognitive 72) core/json/jsonb.rs:2126— Jsonb::deserialize_number has cognitive complexity 72 (threshold 15). Drivers by points: if/else 26 (47 pts), boolean chains 17, loops 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Jsonb::serialize_string (cognitive 48) core/json/jsonb.rs:1231— Jsonb::serialize_string has cognitive complexity 48 (threshold 15). Drivers by points: match/switch 6 (20 pts), if/else 9 (19 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Jsonb::serialize_int5 (cognitive 23) core/json/jsonb.rs:1451— Jsonb::serialize_int5 has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 7, loops 1 (2 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.
Jsonb::deserialize_obj (cognitive 23) core/json/jsonb.rs:1631— Jsonb::deserialize_obj has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Jsonb::merge_patch_at (cognitive 20) core/json/jsonb.rs:3242— Jsonb::merge_patch_at has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Jsonb::container_property_iterator (cognitive 20) core/json/jsonb.rs:3448— Jsonb::container_property_iterator has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (5 pts), boolean chains 3 (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.
Jsonb::serialize_object (cognitive 18) core/json/jsonb.rs:1130— Jsonb::serialize_object has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (6 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_sync_engine::database_sync_operations::decode_raw_mvcc_logical_log_to_file (cognitive 61) sync/engine/src/database_sync_operations.rs:1564— turso_sync_engine::database_sync_operations::decode_raw_mvcc_logical_log_to_file has cognitive complexity 61 (threshold 15). Drivers by points: if/else 25 (55 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_sync_engine::database_sync_operations::wal_pull_to_file_legacy (cognitive 45) sync/engine/src/database_sync_operations.rs:2297— turso_sync_engine::database_sync_operations::wal_pull_to_file_legacy has cognitive complexity 45 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 6 (16 pts), match/switch 1 (2 pts), boolean chains 1 (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.
turso_sync_engine::database_sync_lazy_storage::read_page (cognitive 43) sync/engine/src/database_sync_lazy_storage.rs:341— turso_sync_engine::database_sync_lazy_storage::read_page has cognitive complexity 43 (threshold 15). Drivers by points: if/else 8 (19 pts), match/switch 4 (14 pts), loops 4 (10 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_sync_engine::database_sync_operations::send_push_batch (cognitive 32) sync/engine/src/database_sync_operations.rs:3031— turso_sync_engine::database_sync_operations::send_push_batch has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 2 (5 pts), boolean chains 2, 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.
turso_sync_engine::database_sync_operations::logical_op_to_tape_operations (cognitive 29) sync/engine/src/database_sync_operations.rs:168— turso_sync_engine::database_sync_operations::logical_op_to_tape_operations has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (26 pts), 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.
turso_sync_engine::database_sync_operations::decode_recovery_ops_to_logical_txn (cognitive 26) sync/engine/src/database_sync_operations.rs:1319— turso_sync_engine::database_sync_operations::decode_recovery_ops_to_logical_txn has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_sync_engine::database_sync_operations::sql_execute_http (cognitive 26) sync/engine/src/database_sync_operations.rs:3706— turso_sync_engine::database_sync_operations::sql_execute_http has cognitive complexity 26 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 3 (9 pts), match/switch 2 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_sync_engine::database_sync_operations::pull_updates_v1 (cognitive 24) sync/engine/src/database_sync_operations.rs:1910— turso_sync_engine::database_sync_operations::pull_updates_v1 has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 2 (5 pts), boolean chains 1, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_sync_engine::database_sync_operations::replay_logical_transactions_from_file (cognitive 22) sync/engine/src/database_sync_operations.rs:656— turso_sync_engine::database_sync_operations::replay_logical_transactions_from_file has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 4 (10 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashTable::load_spilled_partition (cognitive 42) core/vdbe/hash_table.rs:2356— HashTable::load_spilled_partition has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 6 (15 pts), boolean chains 1, loops 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashTable::spill_multiple_partitions (cognitive 29) core/vdbe/hash_table.rs:1610— HashTable::spill_multiple_partitions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 7 (11 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashTable::insert_distinct (cognitive 28) core/vdbe/hash_table.rs:1284— HashTable::insert_distinct has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 5, 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.
HashTable::probe (cognitive 28) core/vdbe/hash_table.rs:1921— HashTable::probe has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashTable::finalize_build (cognitive 26) core/vdbe/hash_table.rs:1863— HashTable::finalize_build has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 4 (8 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.
HashTable::next_match (cognitive 20) core/vdbe/hash_table.rs:2048— HashTable::next_match has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashTable::insert_pending (cognitive 18) core/vdbe/hash_table.rs:1185— HashTable::insert_pending has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 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.
HashTable::grace_load_next_probe_chunk (cognitive 18) core/vdbe/hash_table.rs:3168— HashTable::grace_load_next_probe_chunk has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashTable::parse_partition_chunk (cognitive 17) core/vdbe/hash_table.rs:2513— HashTable::parse_partition_chunk has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pager::commit_wal_inner (cognitive 93) core/storage/pager.rs:4537— Pager::commit_wal_inner has cognitive complexity 93 (threshold 15). Drivers by points: if/else 22 (70 pts), loops 4 (10 pts), match/switch 3 (9 pts), boolean chains 4 (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.
Pager::checkpoint_inner (cognitive 75) core/storage/pager.rs:5041— Pager::checkpoint_inner has cognitive complexity 75 (threshold 15). Drivers by points: if/else 25 (65 pts), match/switch 2 (5 pts), boolean chains 4, loops 1 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pager::try_spill_dirty_pages (cognitive 67) core/storage/pager.rs:4217— Pager::try_spill_dirty_pages has cognitive complexity 67 (threshold 15). Drivers by points: if/else 12 (40 pts), loops 5 (16 pts), match/switch 3 (10 pts), boolean chains 1 (nesting depth added 46). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pager::allocate_page (cognitive 41) core/storage/pager.rs:5811— Pager::allocate_page has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (36 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pager::free_page (cognitive 31) core/storage/pager.rs:5546— Pager::free_page has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pager::commit_tx (cognitive 21) core/storage/pager.rs:3406— Pager::commit_tx has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pager::ptrmap_get (cognitive 20) core/storage/pager.rs:2728— Pager::ptrmap_get has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (5 pts), boolean chains 2, 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.
Pager::read_header_page (cognitive 16) core/storage/pager.rs:2140— Pager::read_header_page has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_sqlite3::sqlite3_table_column_metadata (cognitive 67) bindings/c/src/lib.rs:3701— turso_sqlite3::sqlite3_table_column_metadata has cognitive complexity 67 (threshold 15). Drivers by points: if/else 19 (41 pts), match/switch 6 (20 pts), loops 1 (4 pts), boolean chains 2 (nesting depth added 39). 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.
turso_sqlite3::sqlite3_open_v2 (cognitive 36) bindings/c/src/lib.rs:666— turso_sqlite3::sqlite3_open_v2 has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (16 pts), match/switch 7 (12 pts), boolean chains 8 (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.
turso_sqlite3::sqlite3_exec (cognitive 36) bindings/c/src/lib.rs:1244— turso_sqlite3::sqlite3_exec has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 3 (8 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_sqlite3::execute_query_with_callback (cognitive 28) bindings/c/src/lib.rs:1376— turso_sqlite3::execute_query_with_callback has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 5 (11 pts), 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.
turso_sqlite3::parse_uri_filename (cognitive 27) bindings/c/src/lib.rs:600— turso_sqlite3::parse_uri_filename has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 6 (14 pts), if/else 5 (10 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
turso_sqlite3::is_query_statement (cognitive 18) bindings/c/src/lib.rs:1327— turso_sqlite3::is_query_statement has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 8, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_sqlite3::sqlite3_bind_text (cognitive 18) bindings/c/src/lib.rs:2205— turso_sqlite3::sqlite3_bind_text has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 2 (4 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
turso_sqlite3::sqlite3_prepare_v2 (cognitive 16) bindings/c/src/lib.rs:1049— turso_sqlite3::sqlite3_prepare_v2 has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 3, loops 1 (2 pts), match/switch 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Duplicated block (20 lines × 2) core/incremental/vdbe_maintenance/members.rs:275— core/incremental/vdbe_maintenance/members.rs:275-294 | core/incremental/vdbe_maintenance/sink.rs:207-226 — 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) core/index_method/toy_vector_sparse_ivf.rs:520— core/index_method/toy_vector_sparse_ivf.rs:520-539 | core/index_method/toy_vector_sparse_ivf.rs:783-802 — both copies are in the same file, so extract the block into 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) REDACTED:1655— REDACTED:1655-1674 | REDACTED:2152-2171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) REDACTED:3519— REDACTED:3519-3538 | REDACTED:3573-3592 — both copies are in the same file, so extract the block into 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) REDACTED:1863— REDACTED:1863-1882 | REDACTED:2070-2089 — both copies are in the same file, so extract the block into 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) testing/sqltest/src/backends/cli.rs:304— testing/sqltest/src/backends/cli.rs:304-323 | testing/sqltest/src/backends/js.rs:163-182 — before extracting anything, compare `testing/sqltest/src/backends/cli.rs` and `testing/sqltest/src/backends/js.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) REDACTED:610— REDACTED:610-629 | REDACTED:1202-1221 — both copies are in the same file, so extract the block into 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) testing/cli_tests/collate.py:48— testing/cli_tests/collate.py:48-67 | testing/cli_tests/collate.py:90-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `testing/cli_tests/collate.py:48` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–16 lines × 2) bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:102— bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:102-117 | bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:201-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:102` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–16 lines × 2) REDACTED:195— REDACTED:195-210 | REDACTED:226-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 (15–16 lines × 2) core/io/unix.rs:368— core/io/unix.rs:368-383 | core/io/windows.rs:344-358 — 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–16 lines × 2) core/json/jsonb.rs:2785— core/json/jsonb.rs:2785-2799 | core/json/jsonb.rs:2977-2992 — both copies are in the same file, so extract the block into 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) REDACTED:10152— REDACTED:10152-10166 | REDACTED:10272-10287 — both copies are in the same file, so extract the block into 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) REDACTED:7556— REDACTED:7556-7570 | REDACTED:7586-7601 — both copies are in the same file, so extract the block into 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) core/translate/emitter/delete.rs:792— core/translate/emitter/delete.rs:792-806 | core/translate/emitter/update.rs:744-759 — before extracting anything, compare `core/translate/emitter/delete.rs` and `core/translate/emitter/update.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. 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 × 2) core/vdbe/hash_table.rs:2237— core/vdbe/hash_table.rs:2237-2251 | core/vdbe/hash_table.rs:2276-2291 — both copies are in the same file, so extract the block into 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) cli/read_state_machine.rs:132— cli/read_state_machine.rs:132-142 | postgres/cli/read_state_machine.rs:167-177 | testing/sqltest/src/parser/sql_complete.rs:126-136 — before extracting anything, compare `cli/read_state_machine.rs` and `postgres/cli/read_state_machine.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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 × 3) core/time/mod.rs:438— core/time/mod.rs:438-448 | core/time/mod.rs:459-469 | core/time/mod.rs:480-490 — 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) core/translate/expr/translator.rs:1452— core/translate/expr/translator.rs:1452-1462 | core/translate/expr/translator.rs:1466-1476 | core/translate/expr/translator.rs:2093-2103 — 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) testing/sqltest/src/runner/mod.rs:110— testing/sqltest/src/runner/mod.rs:110-120 | testing/sqltest/src/runner/mod.rs:167-177 | testing/sqltest/src/runner/mod.rs:286-296 — 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) core/incremental/vdbe_maintenance/aggregate.rs:153— core/incremental/vdbe_maintenance/aggregate.rs:153-163 | core/incremental/vdbe_maintenance/set_op.rs:336-346 | core/incremental/vdbe_maintenance/set_op.rs:355-365 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/set_op.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) core/incremental/vdbe_maintenance/aggregate.rs:1046— core/incremental/vdbe_maintenance/aggregate.rs:1046-1056 | core/incremental/vdbe_maintenance/arrangement.rs:417-427 | core/incremental/vdbe_maintenance/join.rs:1229-1239 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/arrangement.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 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) perf/latency/sqlite_engine.rs:152— perf/latency/sqlite_engine.rs:152-162 | perf/tatp/sqlite_engine.rs:315-325 | perf/throughput/sqlite_engine.rs:128-138 — `perf/latency/sqlite_engine.rs` and `perf/tatp/sqlite_engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 33 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11 lines × 3) REDACTED:3609— REDACTED:3609-3620 | REDACTED:3658-3668 | REDACTED:3697-3708 — 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–9 lines × 2) core/index_method/toy_vector_sparse_ivf.rs:593— core/index_method/toy_vector_sparse_ivf.rs:593-601 | core/index_method/toy_vector_sparse_ivf.rs:864-871 — both copies are in the same file, so extract the block into 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) core/json/jsonb.rs:3370— core/json/jsonb.rs:3370-3378 | core/json/jsonb.rs:3428-3435 — both copies are in the same file, so extract the block into 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) core/storage/database.rs:288— core/storage/database.rs:288-295 | core/storage/database.rs:313-321 — both copies are in the same file, so extract the block into 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) REDACTED:5212— REDACTED:5212-5219 | REDACTED:6099-6107 — both copies are in the same file, so extract the block into 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) sqlite/parser/src/lexer.rs:707— sqlite/parser/src/lexer.rs:707-714 | sqlite/parser/src/lexer.rs:823-831 — both copies are in the same file, so extract the block into 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) sqlite/parser/src/lexer.rs:749— sqlite/parser/src/lexer.rs:749-756 | sqlite/parser/src/lexer.rs:788-796 — both copies are in the same file, so extract the block into 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) sync/engine/src/database_sync_operations.rs:2392— sync/engine/src/database_sync_operations.rs:2392-2400 | sync/engine/src/database_sync_operations.rs:3689-3696 — both copies are in the same file, so extract the block into 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) REDACTED:427— REDACTED:427-434 | REDACTED:560-568 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Jsonb::navigate_to_segment (cyclomatic 67) core/json/jsonb.rs:2698— Jsonb::navigate_to_segment has cyclomatic complexity 67 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Jsonb::deserialize_string (cyclomatic 60) core/json/jsonb.rs:1802— Jsonb::deserialize_string has cyclomatic complexity 60 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Jsonb::deserialize_number (cyclomatic 47) core/json/jsonb.rs:2126— Jsonb::deserialize_number has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Jsonb::serialize_string (cyclomatic 40) core/json/jsonb.rs:1231— Jsonb::serialize_string has cyclomatic complexity 40 (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.
Jsonb::serialize_int5 (cyclomatic 16) core/json/jsonb.rs:1451— Jsonb::serialize_int5 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.
Jsonb::deserialize_obj (cyclomatic 16) core/json/jsonb.rs:1631— Jsonb::deserialize_obj 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.
Jsonb::container_property_iterator (cyclomatic 16) core/json/jsonb.rs:3448— Jsonb::container_property_iterator 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.
sql_gen::generate::select::generate_select_impl_inner (cyclomatic 53) testing/differential-oracle/sql_gen/src/generate/select.rs:245— sql_gen::generate::select::generate_select_impl_inner has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sql_gen::generate::select::generate_join_clauses (cyclomatic 23) testing/differential-oracle/sql_gen/src/generate/select.rs:1339— sql_gen::generate::select::generate_join_clauses 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.
sql_gen::generate::stmt::collect_capability_allowed_stmts (cyclomatic 23) testing/differential-oracle/sql_gen/src/generate/stmt.rs:65— sql_gen::generate::stmt::collect_capability_allowed_stmts 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.
sql_gen::generate::select::generate_aggregate_call (cyclomatic 21) testing/differential-oracle/sql_gen/src/generate/select.rs:595— sql_gen::generate::select::generate_aggregate_call 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.
sql_gen::generate::select::generate_window_frame (cyclomatic 19) testing/differential-oracle/sql_gen/src/generate/select.rs:1060— sql_gen::generate::select::generate_window_frame has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
sql_gen::generate::stmt::generate_create_table (cyclomatic 18) testing/differential-oracle/sql_gen/src/generate/stmt.rs:746— sql_gen::generate::stmt::generate_create_table has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: sql_gen::generate::stmt::dispatch_stmt_generation (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
sql_gen::generate::stmt::generate_update_sets (cyclomatic 16) testing/differential-oracle/sql_gen/src/generate/stmt.rs:497— sql_gen::generate::stmt::generate_update_sets 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: sql_gen::generate::stmt::dispatch_stmt_generation (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
BarePragmaDisable bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnectionStringBuilder.cs:398— #pragma warning disable CS8765 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:126— #pragma warning disable EF1001 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:222— #pragma warning disable EF1001 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:521— #pragma warning disable EF1001 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable bindings/dotnet/src/Turso.Tests/TursoEfRemoteReplicaTests.cs:41— #pragma warning disable EF1001 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable bindings/dotnet/src/Turso.Tests/TursoEfRemoteReplicaTests.cs:211— #pragma warning disable EF1001 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable bindings/dotnet/src/Turso.Tests/TursoEfRemoteReplicaTests.cs:341— #pragma warning disable EF1001 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
limbo_fuzzy::editdist::edit_distance (cognitive 79) extensions/fuzzy/src/editdist.rs:86— limbo_fuzzy::editdist::edit_distance has cognitive complexity 79 (threshold 15). Drivers by points: if/else 35 (58 pts), loops 9 (15 pts), boolean chains 6 (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.
limbo_fuzzy::phonetic::phonetic_hash (cognitive 43) extensions/fuzzy/src/phonetic.rs:15— limbo_fuzzy::phonetic::phonetic_hash has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (31 pts), boolean chains 9, 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.
limbo_fuzzy::soundex::soundex (cognitive 26) extensions/fuzzy/src/soundex.rs:3— limbo_fuzzy::soundex::soundex has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 13). 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.
limbo_fuzzy::jaro (cognitive 22) extensions/fuzzy/src/lib.rs:268— limbo_fuzzy::jaro has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 4 (7 pts), boolean chains 4 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
limbo_fuzzy::optimal_string_alignment (cognitive 17) extensions/fuzzy/src/lib.rs:346— limbo_fuzzy::optimal_string_alignment has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 5 (6 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
limbo_fuzzy::translit::transliterate (cognitive 17) extensions/fuzzy/src/translit.rs:461— limbo_fuzzy::translit::transliterate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
limbo_fuzzy::damlev (cognitive 16) extensions/fuzzy/src/lib.rs:99— limbo_fuzzy::damlev has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 5 (6 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Schema::handle_schema_row (cognitive 78) core/schema.rs:2976— Schema::handle_schema_row has cognitive complexity 78 (threshold 15). Drivers by points: if/else 23 (64 pts), match/switch 5 (13 pts), boolean chains 1 (nesting depth added 49). 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.
Schema::populate_indices (cognitive 45) core/schema.rs:2436— Schema::populate_indices has cognitive complexity 45 (threshold 15). Drivers by points: if/else 13 (37 pts), loops 4 (8 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Schema::populate_materialized_views (cognitive 32) core/schema.rs:2673— Schema::populate_materialized_views has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Schema::materialized_view_maintenance_order (cognitive 31) core/schema.rs:1719— Schema::materialized_view_maintenance_order has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (21 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Schema::make_from_btree_internal (cognitive 30) core/schema.rs:2210— Schema::make_from_btree_internal has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (24 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Schema::order_persisted_materialized_views (cognitive 19) core/schema.rs:2587— Schema::order_persisted_materialized_views has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 4 (7 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Schema::resolve_fk (cognitive 19) core/schema.rs:3372— Schema::resolve_fk has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 5, loops 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.
MvccLazyCursor::seek (cognitive 75) core/mvcc/cursor.rs:1581— MvccLazyCursor::seek has cognitive complexity 75 (threshold 15). Drivers by points: if/else 17 (51 pts), match/switch 6 (22 pts), boolean chains 1, loops 1 (nesting depth added 50). 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.
MvccLazyCursor::next (cognitive 27) core/mvcc/cursor.rs:1357— MvccLazyCursor::next has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MvccLazyCursor::prev) 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.
MvccLazyCursor::prev (cognitive 27) core/mvcc/cursor.rs:1451— MvccLazyCursor::prev has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MvccLazyCursor::next) 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.
MvccLazyCursor::_advance_btree_forward (cognitive 25) core/mvcc/cursor.rs:896— MvccLazyCursor::_advance_btree_forward has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (18 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MvccLazyCursor::current_row (cognitive 23) core/mvcc/cursor.rs:673— MvccLazyCursor::current_row has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 3 (7 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.
MvccLazyCursor::exists (cognitive 23) core/mvcc/cursor.rs:1983— MvccLazyCursor::exists has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), match/switch 3 (5 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.
MvccLazyCursor::_advance_btree_backward (cognitive 20) core/mvcc/cursor.rs:983— MvccLazyCursor::_advance_btree_backward has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 3 (8 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.
StreamingLogicalLogReader::parse_streaming_payload (cognitive 50) core/mvcc/persistent_storage/logical_log.rs:2395— StreamingLogicalLogReader::parse_streaming_payload has cognitive complexity 50 (threshold 15). Drivers by points: if/else 12 (33 pts), match/switch 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingLogicalLogReader::parse_next_portable_changes_frame (cognitive 44) core/mvcc/persistent_storage/logical_log.rs:3094— StreamingLogicalLogReader::parse_next_portable_changes_frame has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (27 pts), match/switch 8 (14 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.
StreamingLogicalLogReader::parse_next_transaction (cognitive 35) core/mvcc/persistent_storage/logical_log.rs:2647— StreamingLogicalLogReader::parse_next_transaction has cognitive complexity 35 (threshold 15). Drivers by points: match/switch 6 (17 pts), if/else 7 (16 pts), boolean chains 1, loops 1 (nesting depth added 20). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
StreamingLogicalLogReader::read_more_data (cognitive 23) core/mvcc/persistent_storage/logical_log.rs:3587— StreamingLogicalLogReader::read_more_data has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingLogicalLogReader::parse_frame_header (cognitive 20) core/mvcc/persistent_storage/logical_log.rs:2788— StreamingLogicalLogReader::parse_frame_header has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 5, match/switch 3 (4 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
StreamingLogicalLogReader::next_frame (cognitive 16) core/mvcc/persistent_storage/logical_log.rs:1854— StreamingLogicalLogReader::next_frame has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (10 pts), match/switch 2 (5 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.
StreamingLogicalLogReader::read_exact_at (cognitive 16) core/mvcc/persistent_storage/logical_log.rs:3525— StreamingLogicalLogReader::read_exact_at has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (14 lines × 3) core/incremental/vdbe_maintenance/aggregate.rs:708— core/incremental/vdbe_maintenance/aggregate.rs:708-721 | core/incremental/vdbe_maintenance/aggregate.rs:905-918 | core/incremental/vdbe_maintenance/join.rs:1191-1204 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/join.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) core/translate/group_by.rs:806— core/translate/group_by.rs:806-819 | core/translate/group_by.rs:860-873 | core/translate/main_loop/body.rs:295-308 — 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 (14 lines × 3) macros/src/assert.rs:121— macros/src/assert.rs:121-134 | macros/src/assert.rs:177-190 | macros/src/assert.rs:303-316 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) testing/concurrent-simulator/properties.rs:704— testing/concurrent-simulator/properties.rs:704-718 | testing/concurrent-simulator/properties.rs:781-794 | testing/concurrent-simulator/properties.rs:833-848 — 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 (14 lines × 3) testing/differential-oracle/sql_gen/src/generate/stmt.rs:238— testing/differential-oracle/sql_gen/src/generate/stmt.rs:238-251 | testing/differential-oracle/sql_gen/src/generate/stmt.rs:373-386 | testing/differential-oracle/sql_gen/src/generate/stmt.rs:709-722 — 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 (14 lines × 3) testing/simulator/generation/property.rs:114— testing/simulator/generation/property.rs:114-127 | testing/simulator/generation/property.rs:150-163 | testing/simulator/generation/property.rs:218-231 — 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 (14 lines × 3) REDACTED:1302— REDACTED:1302-1315 | REDACTED:2128-2141 | REDACTED:2156-2169 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–13 lines × 2) core/mvcc/persistent_storage/logical_log.rs:3256— core/mvcc/persistent_storage/logical_log.rs:3256-3267 | core/mvcc/persistent_storage/logical_log.rs:3275-3287 — both copies are in the same file, so extract the block into 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) core/translate/emitter/update.rs:1886— core/translate/emitter/update.rs:1886-1897 | core/translate/upsert.rs:1773-1785 — before extracting anything, compare `core/translate/emitter/update.rs` and `core/translate/upsert.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 2) core/translate/sequence.rs:994— core/translate/sequence.rs:994-1005 | core/translate/view.rs:616-628 — before extracting anything, compare `core/translate/sequence.rs` and `core/translate/view.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 98 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–13 lines × 2) core/vdbe/execute.rs:14161— core/vdbe/execute.rs:14161-14172 | core/vdbe/execute.rs:14186-14198 — both copies are in the same file, so extract the block into 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) sync/engine/src/database_sync_engine.rs:2079— sync/engine/src/database_sync_engine.rs:2079-2091 | sync/engine/src/database_sync_engine.rs:2858-2869 — both copies are in the same file, so extract the block into 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) REDACTED:1504— REDACTED:1504-1515 | REDACTED:1524-1536 — both copies are in the same file, so extract the block into 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) perf/latency/turso_engine.rs:32— perf/latency/turso_engine.rs:32-43 | perf/throughput/turso_engine.rs:25-37 — `perf/latency/turso_engine.rs` and `perf/throughput/turso_engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 130 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (12 lines × 3) core/index_method/toy_vector_sparse_ivf.rs:520— core/index_method/toy_vector_sparse_ivf.rs:520-531 | core/index_method/toy_vector_sparse_ivf.rs:783-794 | core/index_method/toy_vector_sparse_ivf.rs:1566-1577 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) core/translate/analyze.rs:276— core/translate/analyze.rs:276-287 | core/translate/main_loop/in_seek.rs:25-36 | core/translate/main_loop/multi_index.rs:255-266 — before extracting anything, compare `core/translate/main_loop/in_seek.rs` and `core/translate/main_loop/multi_index.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) core/vdbe/execute.rs:8607— core/vdbe/execute.rs:8607-8618 | core/vdbe/execute.rs:8655-8666 | core/vdbe/execute.rs:8689-8700 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) postgres/parser/parser.rs:127— postgres/parser/parser.rs:127-138 | postgres/parser/parser.rs:277-288 | postgres/parser/parser.rs:645-656 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) testing/concurrent-simulator/worker.rs:96— testing/concurrent-simulator/worker.rs:96-107 | testing/concurrent-simulator/worker.rs:136-147 | testing/concurrent-simulator/worker.rs:159-170 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) core/index_method/toy_vector_sparse_ivf.rs:613— core/index_method/toy_vector_sparse_ivf.rs:613-624 | core/index_method/toy_vector_sparse_ivf.rs:745-756 | core/index_method/toy_vector_sparse_ivf.rs:1017-1028 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 3) scripts/corruption-debug-tools/page_diff.py:31— scripts/corruption-debug-tools/page_diff.py:31-42 | scripts/corruption-debug-tools/page_history.py:34-45 | scripts/corruption-debug-tools/verify_stale.py:35-46 — 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 (10–11 lines × 2) core/json/jsonb.rs:4114— core/json/jsonb.rs:4114-4123 | core/json/jsonb.rs:4130-4140 — both copies are in the same file, so extract the block into 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) core/json/mod.rs:541— core/json/mod.rs:541-550 | core/json/mod.rs:568-578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) core/translate/collate.rs:437— core/translate/collate.rs:437-446 | core/translate/collate.rs:593-603 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 2) core/translate/compound_select.rs:55— core/translate/compound_select.rs:55-64 | core/translate/compound_select.rs:92-102 — both copies are in the same file, so extract the block into 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) sqlite/parser/src/lexer.rs:907— sqlite/parser/src/lexer.rs:907-916 | sqlite/parser/src/lexer.rs:940-950 — both copies are in the same file, so extract the block into 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) testing/simulator/model/interactions.rs:961— testing/simulator/model/interactions.rs:961-971 | REDACTED:1326-1335 — 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–11 lines × 2) testing/sqltest/src/snapshot/mod.rs:508— testing/sqltest/src/snapshot/mod.rs:508-518 | testing/sqltest/src/snapshot/mod.rs:534-543 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 4) core/functions/datetime.rs:745— core/functions/datetime.rs:745-754 | core/functions/datetime.rs:756-765 | core/functions/datetime.rs:767-776 | core/functions/datetime.rs:778-787 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) core/incremental/vdbe_maintenance.rs:248— core/incremental/vdbe_maintenance.rs:248-257 | core/incremental/vdbe_maintenance/join.rs:534-543 | core/incremental/vdbe_maintenance/linear.rs:40-49 | core/incremental/vdbe_maintenance/linear.rs:392-401 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 4) core/index_method/toy_vector_sparse_ivf.rs:523— core/index_method/toy_vector_sparse_ivf.rs:523-532 | core/index_method/toy_vector_sparse_ivf.rs:786-795 | core/index_method/toy_vector_sparse_ivf.rs:1065-1074 | core/index_method/toy_vector_sparse_ivf.rs:1569-1578 — 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) core/vdbe/hash_table.rs:2209— core/vdbe/hash_table.rs:2209-2218 | core/vdbe/hash_table.rs:2236-2245 | core/vdbe/hash_table.rs:2275-2284 | core/vdbe/hash_table.rs:2310-2319 — 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) testing/concurrent-simulator/worker.rs:98— testing/concurrent-simulator/worker.rs:98-108 | testing/concurrent-simulator/worker.rs:122-131 | testing/concurrent-simulator/worker.rs:138-148 | testing/concurrent-simulator/worker.rs:161-171 — 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) testing/sqltest/src/backends/cli.rs:123— testing/sqltest/src/backends/cli.rs:123-133 | testing/sqltest/src/backends/js.rs:89-99 | testing/sqltest/src/backends/rust.rs:117-127 | testing/sqltest/src/backends/tursopg.rs:81-90 — before extracting anything, compare `testing/sqltest/src/backends/cli.rs` and `testing/sqltest/src/backends/js.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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 × 4) core/index_method/toy_vector_sparse_ivf.rs:652— core/index_method/toy_vector_sparse_ivf.rs:652-661 | core/index_method/toy_vector_sparse_ivf.rs:866-875 | core/index_method/toy_vector_sparse_ivf.rs:952-961 | core/index_method/toy_vector_sparse_ivf.rs:1162-1171 — 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 × 3) REDACTED:537— REDACTED:537-545 | REDACTED:1024-1032 | bindings/dotnet/src/Turso.Data/TursoDataReader.cs:342-350 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (9 lines × 3) core/translate/insert.rs:1495— core/translate/insert.rs:1495-1503 | core/translate/insert.rs:3204-3212 | core/translate/insert.rs:3354-3362 — 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) core/translate/sequence.rs:917— core/translate/sequence.rs:917-925 | core/translate/trigger.rs:550-558 | core/translate/view.rs:215-223 — before extracting anything, compare `core/translate/sequence.rs` and `core/translate/trigger.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) core/vdbe/execute.rs:8546— core/vdbe/execute.rs:8546-8554 | core/vdbe/execute.rs:8584-8592 | core/vdbe/execute.rs:8723-8731 — 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) macros/src/ext/vtab_derive.rs:234— macros/src/ext/vtab_derive.rs:234-242 | macros/src/ext/vtab_derive.rs:249-257 | macros/src/ext/vtab_derive.rs:264-272 — 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) REDACTED:371— REDACTED:371-379 | REDACTED:556-565 | REDACTED:1043-1052 — 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) testing/cli_tests/collate.py:47— testing/cli_tests/collate.py:47-55 | testing/cli_tests/collate.py:69-79 | testing/cli_tests/collate.py:87-97 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `testing/cli_tests/collate.py:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 3) REDACTED:10151— REDACTED:10151-10157 | REDACTED:10170-10176 | REDACTED:10271-10277 — 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) REDACTED:1680— REDACTED:1680-1686 | REDACTED:1737-1743 | REDACTED:1805-1811 — 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) testing/sqltest/src/runner/mod.rs:1023— testing/sqltest/src/runner/mod.rs:1023-1029 | testing/sqltest/src/runner/mod.rs:1096-1102 | testing/sqltest/src/runner/mod.rs:1154-1160 — 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) bindings/java/rs_src/turso_connection.rs:34— bindings/java/rs_src/turso_connection.rs:34-40 | bindings/java/rs_src/turso_db.rs:41-47 | bindings/java/rs_src/turso_statement.rs:39-45 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (7 lines × 3) core/vdbe/execute.rs:8825— core/vdbe/execute.rs:8825-8832 | core/vdbe/execute.rs:9001-9007 | core/vdbe/execute.rs:9038-9045 — 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) core/mvcc/persistent_storage/logical_log.rs:3231— core/mvcc/persistent_storage/logical_log.rs:3231-3237 | core/mvcc/persistent_storage/logical_log.rs:3258-3264 | core/mvcc/persistent_storage/logical_log.rs:3277-3283 — 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) REDACTED:2371— REDACTED:2371-2377 | REDACTED:2673-2679 | REDACTED:2698-2704 — 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.
turso_whopper::allocation_fault::allocation_site_id (cyclomatic 47) testing/concurrent-simulator/allocation_fault.rs:201— turso_whopper::allocation_fault::allocation_site_id has cyclomatic complexity 47 (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.
turso_whopper::worker::execute_sql_inner (cyclomatic 27) testing/concurrent-simulator/worker.rs:259— turso_whopper::worker::execute_sql_inner has cyclomatic complexity 27 (threshold 15). Of this number, 26 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_whopper::worker::run_worker (cyclomatic 20) testing/concurrent-simulator/worker.rs:29— turso_whopper::worker::run_worker 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.
turso_whopper::run_inprocess (cyclomatic 19) testing/concurrent-simulator/main.rs:288— turso_whopper::run_inprocess 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.
turso_whopper::run_multiprocess (cyclomatic 16) testing/concurrent-simulator/main.rs:183— turso_whopper::run_multiprocess 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.
turso_whopper::build_inprocess_opts (cyclomatic 16) testing/concurrent-simulator/main.rs:540— turso_whopper::build_inprocess_opts 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.
turso_sync_engine::database_sync_operations::decode_raw_mvcc_logical_log_to_file (cyclomatic 29) sync/engine/src/database_sync_operations.rs:1564— turso_sync_engine::database_sync_operations::decode_raw_mvcc_logical_log_to_file 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.
turso_sync_engine::database_sync_operations::logical_op_to_tape_operations (cyclomatic 21) sync/engine/src/database_sync_operations.rs:168— turso_sync_engine::database_sync_operations::logical_op_to_tape_operations 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.
turso_sync_engine::database_sync_lazy_storage::read_page (cyclomatic 20) sync/engine/src/database_sync_lazy_storage.rs:341— turso_sync_engine::database_sync_lazy_storage::read_page has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_sync_engine::database_sync_operations::send_push_batch (cyclomatic 18) sync/engine/src/database_sync_operations.rs:3031— turso_sync_engine::database_sync_operations::send_push_batch 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.
turso_sync_engine::database_sync_operations::wal_pull_to_file_legacy (cyclomatic 17) sync/engine/src/database_sync_operations.rs:2297— turso_sync_engine::database_sync_operations::wal_pull_to_file_legacy 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.
turso_sync_engine::database_sync_operations::decode_recovery_ops_to_logical_txn (cyclomatic 16) sync/engine/src/database_sync_operations.rs:1319— turso_sync_engine::database_sync_operations::decode_recovery_ops_to_logical_txn 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.
CheckpointStateMachine::step_inner (cognitive 197) core/mvcc/database/checkpoint_state_machine.rs:2465— CheckpointStateMachine::step_inner has cognitive complexity 197 (threshold 15). Drivers by points: if/else 80 (170 pts), match/switch 11 (21 pts), boolean chains 6 (nesting depth added 100). 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.
CheckpointStateMachine::collect_table_row_versions (cognitive 46) core/mvcc/database/checkpoint_state_machine.rs:1342— CheckpointStateMachine::collect_table_row_versions has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (36 pts), match/switch 2 (6 pts), boolean chains 3, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CheckpointStateMachine::publish_checkpointed_schema_roots (cognitive 37) core/mvcc/database/checkpoint_state_machine.rs:2006— CheckpointStateMachine::publish_checkpointed_schema_roots has cognitive complexity 37 (threshold 15). Drivers by points: if/else 14 (31 pts), loops 5, boolean chains 1 (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CheckpointStateMachine::maybe_get_checkpointable_versions (cognitive 36) core/mvcc/database/checkpoint_state_machine.rs:1065— CheckpointStateMachine::maybe_get_checkpointable_versions has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (29 pts), boolean chains 6, loops 1 (nesting depth added 15). 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.
CheckpointStateMachine::gc_checkpointed_table_versions (cognitive 24) core/mvcc/database/checkpoint_state_machine.rs:2237— CheckpointStateMachine::gc_checkpointed_table_versions has cognitive complexity 24 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CheckpointStateMachine::gc_checkpointed_index_versions (cognitive 16) core/mvcc/database/checkpoint_state_machine.rs:2318— CheckpointStateMachine::gc_checkpointed_index_versions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (15 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.
Connection::drive_reparse_building (cognitive 45) core/connection.rs:1472— Connection::drive_reparse_building has cognitive complexity 45 (threshold 15). Drivers by points: if/else 12 (38 pts), loops 2 (4 pts), match/switch 1 (2 pts), boolean chains 1 (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.
Connection::attach_database_with_config (cognitive 40) core/dialect/sqlite/attach.rs:421— Connection::attach_database_with_config has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (31 pts), match/switch 2 (6 pts), boolean chains 2, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Connection::drop (cognitive 32) core/connection.rs:566— Connection::drop has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (30 pts), loops 1 (2 pts) (nesting depth added 20). 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.
Connection::sync_autoincrement_backing_tables_from_sqlite_sequence_nonblock (cognitive 26) core/connection.rs:3982— Connection::sync_autoincrement_backing_tables_from_sqlite_sequence_nonblock has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (18 pts), match/switch 2 (5 pts), boolean chains 2, 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.
Connection::load_sequence_descriptors_via_sql_nonblock (cognitive 22) core/connection.rs:3705— Connection::load_sequence_descriptors_via_sql_nonblock has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (16 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Connection::run_batch (cognitive 18) bindings/rust/src/connection.rs:233— Connection::run_batch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_pg_regress::split_meta_args (cognitive 39) postgres/regress/main.rs:797— turso_pg_regress::split_meta_args has cognitive complexity 39 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 4 (12 pts), match/switch 2 (9 pts), boolean chains 5 (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.
turso_pg_regress::describe::table_footers (cognitive 34) postgres/regress/describe.rs:331— turso_pg_regress::describe::table_footers has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 4 (12 pts), match/switch 1 (4 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_pg_regress::run_transcript (cognitive 27) postgres/regress/main.rs:278— turso_pg_regress::run_transcript has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_pg_regress::split_copy_spec (cognitive 27) postgres/regress/main.rs:914— turso_pg_regress::split_copy_spec has cognitive complexity 27 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 2 (9 pts), loops 2 (5 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_pg_regress::collect_scripts (cognitive 18) postgres/regress/main.rs:164— turso_pg_regress::collect_scripts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 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.
turso_pg_regress::describe::describe_table (cognitive 18) postgres/regress/describe.rs:248— turso_pg_regress::describe::describe_table has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (15 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×6
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium vulnerability · ×6
Duplicated block (23 lines × 2) REDACTED:1646— REDACTED:1646-1668 | REDACTED:1683-1705 — both copies are in the same file, so extract the block into 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) core/json/ops.rs:23— core/json/ops.rs:23-45 | core/json/ops.rs:58-80 — both copies are in the same file, so extract the block into 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) core/pragma.rs:351— core/pragma.rs:351-373 | extensions/completion/src/lib.rs:123-145 — 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 (23 lines × 2) REDACTED:1643— REDACTED:1643-1665 | REDACTED:2106-2128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) core/translate/main_loop/in_seek.rs:22— core/translate/main_loop/in_seek.rs:22-44 | core/translate/main_loop/multi_index.rs:252-274 — before extracting anything, compare `core/translate/main_loop/in_seek.rs` and `core/translate/main_loop/multi_index.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23 lines × 2) postgres/parser/parser.rs:1558— postgres/parser/parser.rs:1558-1580 | postgres/parser/parser.rs:1606-1628 — both copies are in the same file, so extract the block into 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 × 3) cli/read_state_machine.rs:79— cli/read_state_machine.rs:79-91 | postgres/cli/read_state_machine.rs:79-91 | testing/sqltest/src/parser/sql_complete.rs:81-93 — before extracting anything, compare `cli/read_state_machine.rs` and `postgres/cli/read_state_machine.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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) core/incremental/vdbe_maintenance/linear.rs:114— core/incremental/vdbe_maintenance/linear.rs:114-126 | core/incremental/vdbe_maintenance/linear.rs:193-205 | core/incremental/vdbe_maintenance/set_op.rs:187-199 — before extracting anything, compare `core/incremental/vdbe_maintenance/linear.rs` and `core/incremental/vdbe_maintenance/set_op.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 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 × 3) REDACTED:996— REDACTED:996-1008 | REDACTED:1463-1475 | REDACTED:1896-1908 — 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) core/translate/group_by.rs:836— core/translate/group_by.rs:836-848 | core/translate/group_by.rs:894-906 | core/translate/main_loop/body.rs:323-335 — 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 (13 lines × 3) core/vdbe/explain.rs:449— core/vdbe/explain.rs:449-465 | core/vdbe/explain.rs:477-489 | core/vdbe/explain.rs:608-624 — 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) bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:174— bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:174-186 | bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:202-214 | bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:402-414 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:174` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9–10 lines × 2) core/incremental/vdbe_maintenance/linear.rs:62— core/incremental/vdbe_maintenance/linear.rs:62-71 | core/incremental/vdbe_maintenance/linear.rs:156-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 (9–10 lines × 2) REDACTED:2205— REDACTED:2205-2213 | REDACTED:2476-2485 — both copies are in the same file, so extract the block into 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–10 lines × 2) core/vdbe/execute.rs:10554— core/vdbe/execute.rs:10554-10562 | core/vdbe/execute.rs:10597-10606 — both copies are in the same file, so extract the block into 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–10 lines × 2) REDACTED:539— REDACTED:539-548 | REDACTED:1024-1032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) testing/sqlright/crash_reports/collect_crashes.py:139— testing/sqlright/crash_reports/collect_crashes.py:139-147 | testing/sqlright/crash_reports/query_crashes.py:93-102 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9–10 lines × 2) testing/differential-oracle/fuzzer/ivm.rs:327— testing/differential-oracle/fuzzer/ivm.rs:327-335 | testing/differential-oracle/fuzzer/ivm.rs:599-608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 4) core/incremental/vdbe_maintenance/set_op.rs:545— core/incremental/vdbe_maintenance/set_op.rs:545-553 | core/incremental/vdbe_maintenance/set_op.rs:736-744 | core/translate/insert.rs:1490-1498 | core/translate/insert.rs:3199-3207 — 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 (9 lines × 4) core/io/generic.rs:21— core/io/generic.rs:21-29 | core/io/io_uring.rs:462-470 | core/io/unix.rs:52-60 | sync/engine/src/sparse_io.rs:24-32 — before extracting anything, compare `core/io/io_uring.rs` and `core/io/unix.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 lines × 4) core/translate/schema.rs:2343— core/translate/schema.rs:2343-2352 | core/translate/schema.rs:3152-3163 | core/translate/sequence.rs:1026-1034 | core/translate/view.rs:657-669 — before extracting anything, compare `core/translate/schema.rs` and `core/translate/view.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 (9 lines × 4) core/vector/operations/text.rs:106— core/vector/operations/text.rs:106-114 | core/vector/operations/text.rs:152-160 | core/vector/operations/text.rs:184-192 | core/vector/operations/text.rs:208-216 — 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 × 4) sync/engine/src/database_sync_engine.rs:1992— sync/engine/src/database_sync_engine.rs:1992-2000 | sync/engine/src/database_sync_engine.rs:2067-2075 | sync/engine/src/database_sync_engine.rs:2547-2555 | sync/engine/src/database_sync_engine.rs:2828-2836 — 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 × 4) scripts/corruption-debug-tools/page_diff.py:31— scripts/corruption-debug-tools/page_diff.py:31-39 | scripts/corruption-debug-tools/page_history.py:34-42 | scripts/corruption-debug-tools/page_info.py:35-43 | scripts/corruption-debug-tools/verify_stale.py:35-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (7 lines × 4) REDACTED:5459— REDACTED:5459-5465 | REDACTED:5490-5496 | REDACTED:5535-5541 | REDACTED:5558-5564 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) core/vector/mod.rs:126— core/vector/mod.rs:126-132 | core/vector/mod.rs:141-147 | core/vector/mod.rs:156-162 | core/vector/mod.rs:171-177 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) testing/simulator/generation/property.rs:315— testing/simulator/generation/property.rs:315-321 | testing/simulator/generation/property.rs:391-399 | testing/simulator/generation/property.rs:527-535 | testing/simulator/generation/property.rs:751-757 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) core/vdbe/execute.rs:8550— core/vdbe/execute.rs:8550-8556 | core/vdbe/execute.rs:8588-8594 | core/vdbe/execute.rs:8727-8733 | core/vdbe/execute.rs:8768-8774 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) cli/mcp_server.rs:727— cli/mcp_server.rs:727-733 | cli/mcp_server.rs:740-746 | cli/mcp_server.rs:753-759 | cli/mcp_server.rs:766-772 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 4) REDACTED:2861— REDACTED:2861-2867 | REDACTED:3252-3258 | REDACTED:3269-3275 | REDACTED:3330-3336 — 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 lines × 2 locations) bindings/javascript/packages/common/async-lock.ts:17— bindings/javascript/packages/common/async-lock.ts:17 · bindings/react-native/src/AsyncLock.ts:28 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (12 lines × 2 locations) bindings/javascript/packages/common/compat.ts:139— bindings/javascript/packages/common/compat.ts:139 · bindings/javascript/packages/common/promise.ts:326 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (12 lines × 2 locations) bindings/javascript/packages/common/compat.ts:267— bindings/javascript/packages/common/compat.ts:267 · bindings/javascript/packages/common/compat.ts:323 — 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 (12 lines × 2 locations) bindings/javascript/packages/wasm-common/index.ts:48— bindings/javascript/packages/wasm-common/index.ts:48 · bindings/javascript/packages/wasm-common/index.ts:66 — 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 (12 lines × 2 locations) bindings/javascript/sync/packages/common/remote-writer.ts:88— bindings/javascript/sync/packages/common/remote-writer.ts:88 · bindings/javascript/sync/packages/common/remote-writer.ts:104 — both copies are in the same file, so extract the block into 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 locations) serverless/javascript/src/compat.ts:288— serverless/javascript/src/compat.ts:288 · serverless/javascript/src/connection.ts:26 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
turso_pg::functions::validate_pg_input (cyclomatic 65) postgres/frontend/functions.rs:745— turso_pg::functions::validate_pg_input has cyclomatic complexity 65 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso_pg::functions::exec_pg_format_type (cyclomatic 33) postgres/frontend/functions.rs:636— turso_pg::functions::exec_pg_format_type 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.
turso_pg::functions::pg_to_char_numeric (cyclomatic 23) postgres/frontend/functions.rs:1127— turso_pg::functions::pg_to_char_numeric has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. This is NOT this file's highest cyclomatic complexity: PgScalarFunction::arity (cyclomatic 30) 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.
turso_pg::copy::unescape_copy_field (cyclomatic 19) postgres/frontend/copy.rs:70— turso_pg::copy::unescape_copy_field has cyclomatic complexity 19 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
turso_pg::catalog::pg_get_constraintdef (cyclomatic 18) REDACTED:3368— turso_pg::catalog::pg_get_constraintdef has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: turso_pg::catalog::sqlite_type_to_pg_oid (cyclomatic 24) 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.
Expr::is_nonnull (cyclomatic 54) core/translate/optimizer/mod.rs:3970— Expr::is_nonnull has cyclomatic complexity 54 (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.
Expr::to_tokens (cyclomatic 51) sqlite/parser/src/ast/fmt.rs:890— Expr::to_tokens has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Expr::is_constant (cyclomatic 42) core/translate/optimizer/mod.rs:4086— Expr::is_constant 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.
Expr::check_always_true_or_false (cyclomatic 27) core/translate/optimizer/mod.rs:4186— Expr::check_always_true_or_false 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.
Expr::contains_aggregate (cyclomatic 21) testing/differential-oracle/sql_gen/src/ast.rs:439— Expr::contains_aggregate 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. This is NOT this file's highest cyclomatic complexity: BinOp::fmt (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Program::abort (cognitive 145) core/vdbe/mod.rs:3458— Program::abort has cognitive complexity 145 (threshold 15). Drivers by points: if/else 36 (99 pts), match/switch 7 (21 pts), boolean chains 20, loops 1 (5 pts) (nesting depth added 81). Of this number, 144 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Program::normal_step::dispatch_loop (cognitive 38) core/vdbe/mod.rs:2551— Program::normal_step::dispatch_loop has cognitive complexity 38 (threshold 15). Drivers by points: if/else 8 (23 pts), match/switch 4 (12 pts), loops 2 (3 pts) (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.
Program::commit_txn_mvcc (cognitive 28) core/vdbe/mod.rs:3169— Program::commit_txn_mvcc has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 6 (11 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.
Program::explain_step (cognitive 23) core/vdbe/mod.rs:2273— Program::explain_step has cognitive complexity 23 (threshold 15). Drivers by points: if/else 15 (22 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Program::commit_txn (cognitive 20) core/vdbe/mod.rs:2993— Program::commit_txn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (16 pts), boolean chains 3, match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommitStateMachine::step (cognitive 133) REDACTED:3111— CommitStateMachine::step has cognitive complexity 133 (threshold 15). Drivers by points: if/else 53 (104 pts), match/switch 8 (16 pts), boolean chains 11, loops 1 (2 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.
CommitStateMachine::step_build_log_record (cognitive 75) REDACTED:2360— CommitStateMachine::step_build_log_record has cognitive complexity 75 (threshold 15). Drivers by points: if/else 31 (52 pts), loops 7 (12 pts), boolean chains 11 (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.
CommitStateMachine::populate_portable_changes (cognitive 57) REDACTED:2808— CommitStateMachine::populate_portable_changes has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (43 pts), loops 8 (10 pts), match/switch 2 (4 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommitStateMachine::check_version_conflicts (cognitive 50) REDACTED:2190— CommitStateMachine::check_version_conflicts has cognitive complexity 50 (threshold 15). Drivers by points: if/else 10 (34 pts), match/switch 5 (15 pts), loops 1 (nesting depth added 34). 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.
CommitStateMachine::release_group_claim (cognitive 26) REDACTED:1820— CommitStateMachine::release_group_claim has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (24 pts), boolean chains 2 (nesting depth added 13). 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.
Database::header_validation (cognitive 94) core/database.rs:1972— Database::header_validation has cognitive complexity 94 (threshold 15). Drivers by points: if/else 31 (78 pts), match/switch 3 (8 pts), boolean chains 7, loops 1 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Database::_init_nonblock (cognitive 69) core/database.rs:1825— Database::_init_nonblock has cognitive complexity 69 (threshold 15). Drivers by points: if/else 15 (55 pts), match/switch 3 (9 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 48). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Database::do_open_async_internal (cognitive 35) core/database.rs:1532— Database::do_open_async_internal has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (27 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Database::init_pager (cognitive 28) core/database.rs:3223— Database::init_pager has cognitive complexity 28 (threshold 15). Drivers by points: if/else 19 (27 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.
Database::open_async (cognitive 23) core/database.rs:1314— Database::open_async has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Limbo::handle_dot_command (cognitive 91) REDACTED:799— Limbo::handle_dot_command has cognitive complexity 91 (threshold 15). Drivers by points: if/else 26 (71 pts), match/switch 5 (12 pts), loops 2 (8 pts) (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Limbo::print_list_mode (cognitive 27) REDACTED:1196— Limbo::print_list_mode has cognitive complexity 27 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 3 (8 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Limbo::print_schema_entry (cognitive 22) REDACTED:1438— Limbo::print_schema_entry has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (22 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.
Limbo::run_query (cognitive 18) REDACTED:561— Limbo::run_query has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 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.
Limbo::display_tables (cognitive 17) REDACTED:1672— Limbo::display_tables has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_pg::functions::validate_pg_input (cognitive 91) postgres/frontend/functions.rs:745— turso_pg::functions::validate_pg_input has cognitive complexity 91 (threshold 15). Drivers by points: if/else 34 (62 pts), match/switch 10 (19 pts), boolean chains 10 (nesting depth added 37). 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.
turso_pg::catalog::pg_get_constraintdef (cognitive 43) REDACTED:3368— turso_pg::catalog::pg_get_constraintdef has cognitive complexity 43 (threshold 15). Drivers by points: if/else 10 (30 pts), loops 6 (10 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_pg::functions::pg_to_char_numeric (cognitive 42) postgres/frontend/functions.rs:1127— turso_pg::functions::pg_to_char_numeric has cognitive complexity 42 (threshold 15). Drivers by points: if/else 28 (37 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 10). 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.
turso_pg::copy::unescape_copy_field (cognitive 21) postgres/frontend/copy.rs:70— turso_pg::copy::unescape_copy_field has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 5 (12 pts), loops 3 (7 pts), if/else 1 (2 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
turso_pg::functions::validate_json_braces (cognitive 16) postgres/frontend/functions.rs:1091— turso_pg::functions::validate_json_braces has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Statement::reset_internal (cognitive 38) core/statement.rs:1684— Statement::reset_internal has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (29 pts), match/switch 1 (4 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 19). Of this number, 37 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Statement::finish_step (cognitive 31) core/statement.rs:748— Statement::finish_step has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 4, 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.
Statement::get_column_name (cognitive 31) core/statement.rs:1203— Statement::get_column_name has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 4 (8 pts), boolean chains 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Statement::prepare_step (cognitive 19) core/statement.rs:693— Statement::prepare_step has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Statement::get_column_type_info (cognitive 18) core/statement.rs:1383— Statement::get_column_type_info has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_pg_parser::translator::try_extract_copy_from (cognitive 38) REDACTED:6437— turso_pg_parser::translator::try_extract_copy_from has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (23 pts), match/switch 4 (12 pts), boolean chains 2, 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.
turso_pg_parser::translator::deparse_default_expr (cognitive 22) REDACTED:6584— turso_pg_parser::translator::deparse_default_expr has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 7 (13 pts), if/else 5 (9 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
turso_pg_parser::translator::pg_check_constraint_name (cognitive 19) REDACTED:5246— turso_pg_parser::translator::pg_check_constraint_name has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
turso_pg_parser::translator::reject_constraint_attributes (cognitive 19) REDACTED:6829— turso_pg_parser::translator::reject_constraint_attributes has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
turso_pg_parser::translator::similar_to_regex (cognitive 17) REDACTED:6742— turso_pg_parser::translator::similar_to_regex has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change coupling: fmt.rs ↔ parser.rs sqlite/parser/src/ast/fmt.rs:1— `sqlite/parser/src/ast/fmt.rs` and `sqlite/parser/src/parser.rs` change together 87% of the time (20 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 20 shared commits counted here, the most recent 3 are `b30b1ee1` parser: parse LATERAL subqueries in FROM clauses; `c340222f` sqlite/parser: keep GENERATED ALWAYS in rendered schema text; `87ca731e` core: preserve CHECK source text in errors and rebuilt SQL — run `git show` on any of them.
Change coupling: cli.rs ↔ js.rs testing/sqltest/src/backends/cli.rs:1— `testing/sqltest/src/backends/cli.rs` and `testing/sqltest/src/backends/js.rs` change together 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `cabcc170` test-runner: add @cross-check-integrity annotation and --cross-check-… (at that commit the files were still `testing/runner/src/backends/cli.rs` and `testing/runner/src/backends/js.rs`); `4096a0d8` add @requires and @requires-file to only run the tests if the backend… (at that commit the files were still `turso-test-runner/src/backends/cli.rs` and `turso-test-runner/src/backends/js.rs`); `327f6c2b` adjust setup to ignore all returned stdout from it (at that commit the files were still `turso-test-runner/src/backends/cli.rs` and `turso-test-runner/src/backends/js.rs`) — run `git show` on any of them.
Change coupling: lexer.rs ↔ REDACTED testing/sqltest/src/parser/lexer.rs:1— `testing/sqltest/src/parser/lexer.rs` and `testing/sqltest/src/runner/mod.rs` change together 59% of the time (13 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `d91a4bd8` test: snapshot parenthesized join bytecode; `3b7441c3` testing/sqltest: add matrix test cases verified against a bundled SQL…; `cabcc170` test-runner: add @cross-check-integrity annotation and --cross-check-… (at that commit the files were still `testing/runner/src/parser/lexer.rs` and `testing/runner/src/runner/mod.rs`) — run `git show` on any of them.
Change coupling: lib.rs ↔ journal_mode.rs core/lib.rs:1— `core/lib.rs` and `core/storage/journal_mode.rs` change together 59% of the time (10 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `b80c92fb` core/mvcc: gate more stuff under passive mode; `0087f04c` core: allow custom allocator for MVStore; `e20e71e3` Fix ROLLBACK TO restoring row versions but not fully restoring tx-loc… — run `git show` on any of them.
Change coupling: display.rs ↔ subquery.rs core/translate/display.rs:1— `core/translate/display.rs` and `core/translate/subquery.rs` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well, and counted over this repository's 10,000 most recent commits rather than its whole history — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `89cb299f` core: emit structured EXPLAIN QUERY PLAN data and expose it as JSON; `1141077e` core/translate: label covering index seeks in EXPLAIN QUERY PLAN; `6e179bd3` core/translate: Implement ORDER BY NULLS FIRST/LAST — run `git show` on any of them.
Duplicated block (21 lines × 2) REDACTED:537— REDACTED:537-557 | REDACTED:1024-1044 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:559` calls `TryGetSelectSource`, `GetTableColumns` and `REDACTED:1046` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (21 lines × 2) testing/concurrent-simulator/properties.rs:1689— testing/concurrent-simulator/properties.rs:1689-1709 | testing/concurrent-simulator/properties.rs:1843-1863 — both copies are in the same file, so extract the block into 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) testing/sqltest/src/backends/cli.rs:116— testing/sqltest/src/backends/cli.rs:116-136 | testing/sqltest/src/backends/js.rs:82-102 — before extracting anything, compare `testing/sqltest/src/backends/cli.rs` and `testing/sqltest/src/backends/js.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 116 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 (21 lines × 2) testing/sqltest/src/runner/mod.rs:1093— testing/sqltest/src/runner/mod.rs:1093-1113 | testing/sqltest/src/runner/mod.rs:1151-1171 — both copies are in the same file, so extract the block into 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) testing/differential-oracle/fuzzer/ivm.rs:1163— testing/differential-oracle/fuzzer/ivm.rs:1163-1183 | testing/differential-oracle/fuzzer/ivm.rs:1239-1259 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) core/json/jsonb.rs:2928— core/json/jsonb.rs:2928-2941 | core/json/jsonb.rs:2985-2997 — both copies are in the same file, so extract the block into 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) core/mvcc/cursor.rs:1253— core/mvcc/cursor.rs:1253-1265 | core/mvcc/cursor.rs:2227-2240 — both copies are in the same file, so extract the block into 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) REDACTED:3802— REDACTED:3802-3815 | REDACTED:3937-3949 — both copies are in the same file, so extract the block into 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) core/translate/schema.rs:2088— core/translate/schema.rs:2088-2101 | core/translate/schema.rs:2202-2214 — both copies are in the same file, so extract the block into 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) testing/simulator/generation/property.rs:2196— testing/simulator/generation/property.rs:2196-2209 | testing/simulator/generation/property.rs:2224-2236 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–11 lines × 2) core/translate/delete.rs:61— core/translate/delete.rs:61-71 | core/translate/insert.rs:90-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 (9–11 lines × 2) core/util.rs:2137— core/util.rs:2137-2145 | core/util.rs:2211-2221 — both copies are in the same file, so extract the block into 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–11 lines × 2) core/vdbe/hash_table.rs:2082— core/vdbe/hash_table.rs:2082-2090 | core/vdbe/hash_table.rs:2094-2104 — both copies are in the same file, so extract the block into 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–11 lines × 2) testing/stress/main.rs:373— testing/stress/main.rs:373-383 | testing/stress/main.rs:398-406 — both copies are in the same file, so extract the block into 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–11 lines × 2) perf/latency/plot/plot-latency-ecdf.py:64— perf/latency/plot/plot-latency-ecdf.py:64-74 | perf/throughput/plot/plot-throughput.py: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 (7–8 lines × 2) core/json/mod.rs:469— core/json/mod.rs:469-476 | core/json/mod.rs:497-503 — both copies are in the same file, so extract the block into 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) core/translate/expr/translator.rs:1628— core/translate/expr/translator.rs:1628-1634 | core/translate/expr/translator.rs:2126-2133 — both copies are in the same file, so extract the block into 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) REDACTED:3369— REDACTED:3369-3376 | REDACTED:3456-3462 — both copies are in the same file, so extract the block into 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) sync/engine/src/database_sync_lazy_storage.rs:611— sync/engine/src/database_sync_lazy_storage.rs:611-617 | sync/engine/src/database_sync_lazy_storage.rs:653-660 — both copies are in the same file, so extract the block into 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) testing/simulator/runner/file.rs:170— testing/simulator/runner/file.rs:170-176 | testing/simulator/runner/file.rs:228-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Off the main sequence: query-result-oracle — query-result-oracle: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: turso_pg_client — turso_pg_client: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: turso_parser — turso_parser: abstractness 0.07, instability 0.08, distance 0.85 — zone of pain — concrete and depended on by 11 project(s), so it's rigid to change.
Off the main sequence: @tursodatabase/serverless — @tursodatabase/serverless: abstractness 0.21, instability 0.00, distance 0.79 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
Off the main sequence: turso_core — turso_core: abstractness 0.09, instability 0.14, distance 0.77 — zone of pain — concrete and depended on by 18 project(s), so it's rigid to change.
CheckpointStateMachine::step_inner (cyclomatic 108) core/mvcc/database/checkpoint_state_machine.rs:2465— CheckpointStateMachine::step_inner has cyclomatic complexity 108 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CheckpointStateMachine::collect_table_row_versions (cyclomatic 22) core/mvcc/database/checkpoint_state_machine.rs:1342— CheckpointStateMachine::collect_table_row_versions has cyclomatic complexity 22 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CheckpointStateMachine::maybe_get_checkpointable_versions (cyclomatic 20) core/mvcc/database/checkpoint_state_machine.rs:1065— CheckpointStateMachine::maybe_get_checkpointable_versions 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.
CheckpointStateMachine::publish_checkpointed_schema_roots (cyclomatic 19) core/mvcc/database/checkpoint_state_machine.rs:2006— CheckpointStateMachine::publish_checkpointed_schema_roots 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.
CommitStateMachine::step (cyclomatic 84) REDACTED:3111— CommitStateMachine::step 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.
CommitStateMachine::step_build_log_record (cyclomatic 49) REDACTED:2360— CommitStateMachine::step_build_log_record 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.
CommitStateMachine::populate_portable_changes (cyclomatic 34) REDACTED:2808— CommitStateMachine::populate_portable_changes 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.
CommitStateMachine::check_version_conflicts (cyclomatic 24) REDACTED:2190— CommitStateMachine::check_version_conflicts 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.
Pager::commit_wal_inner (cyclomatic 42) core/storage/pager.rs:4537— Pager::commit_wal_inner has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Pager::checkpoint_inner (cyclomatic 35) core/storage/pager.rs:5041— Pager::checkpoint_inner 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.
Pager::try_spill_dirty_pages (cyclomatic 24) core/storage/pager.rs:4217— Pager::try_spill_dirty_pages 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.
Pager::allocate_page (cyclomatic 18) core/storage/pager.rs:5811— Pager::allocate_page 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.
Database::header_validation (cyclomatic 41) core/database.rs:1972— Database::header_validation 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.
Database::_init_nonblock (cyclomatic 23) core/database.rs:1825— Database::_init_nonblock 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.
Database::do_open_async_internal (cyclomatic 19) core/database.rs:1532— Database::do_open_async_internal 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.
Database::init_pager (cyclomatic 16) core/database.rs:3223— Database::init_pager 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.
turso_pg_parser::translator::map_pg_type (cyclomatic 35) REDACTED:5565— turso_pg_parser::translator::map_pg_type has cyclomatic complexity 35 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
turso_pg_parser::translator::try_extract_copy_from (cyclomatic 32) REDACTED:6437— turso_pg_parser::translator::try_extract_copy_from 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.
turso_pg_parser::translator::deparse_default_expr (cyclomatic 27) REDACTED:6584— turso_pg_parser::translator::deparse_default_expr 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.
turso_pg_parser::translator::reject_constraint_attributes (cyclomatic 17) REDACTED:6829— turso_pg_parser::translator::reject_constraint_attributes 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. This is NOT this file's highest cyclomatic complexity: turso_pg_parser::translator::expression_name (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
StreamingLogicalLogReader::parse_next_portable_changes_frame (cyclomatic 31) core/mvcc/persistent_storage/logical_log.rs:3094— StreamingLogicalLogReader::parse_next_portable_changes_frame has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
StreamingLogicalLogReader::parse_streaming_payload (cyclomatic 27) core/mvcc/persistent_storage/logical_log.rs:2395— StreamingLogicalLogReader::parse_streaming_payload 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.
StreamingLogicalLogReader::parse_next_transaction (cyclomatic 21) core/mvcc/persistent_storage/logical_log.rs:2647— StreamingLogicalLogReader::parse_next_transaction 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.
StreamingLogicalLogReader::parse_frame_header (cyclomatic 17) core/mvcc/persistent_storage/logical_log.rs:2788— StreamingLogicalLogReader::parse_frame_header 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.
turso_sqlite3::sqlite3_open_v2 (cyclomatic 26) bindings/c/src/lib.rs:666— turso_sqlite3::sqlite3_open_v2 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.
turso_sqlite3::sqlite3_table_column_metadata (cyclomatic 24) bindings/c/src/lib.rs:3701— turso_sqlite3::sqlite3_table_column_metadata 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.
turso_sqlite3::sqlite3_exec (cyclomatic 17) bindings/c/src/lib.rs:1244— turso_sqlite3::sqlite3_exec 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.
turso_sqlite3::is_query_statement (cyclomatic 16) bindings/c/src/lib.rs:1327— turso_sqlite3::is_query_statement 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.
FtsCursor::drive_open (cognitive 104) REDACTED:1401— FtsCursor::drive_open has cognitive complexity 104 (threshold 15). Drivers by points: if/else 29 (89 pts), match/switch 6 (14 pts), loops 1 (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FtsCursor::query_start (cognitive 53) REDACTED:3026— FtsCursor::query_start has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 8 (14 pts), match/switch 8 (14 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.
FtsCursor::stage_statement_commit (cognitive 25) REDACTED:3393— FtsCursor::stage_statement_commit has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (20 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FtsCursor::optimize (cognitive 17) REDACTED:3528— FtsCursor::optimize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_whopper::worker::execute_sql_inner (cognitive 46) testing/concurrent-simulator/worker.rs:259— turso_whopper::worker::execute_sql_inner has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (36 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 26). Of this number, 45 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_whopper::create_initial_indexes (cognitive 25) testing/concurrent-simulator/lib.rs:1762— turso_whopper::create_initial_indexes has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 3 (7 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_whopper::run_inprocess (cognitive 24) testing/concurrent-simulator/main.rs:288— turso_whopper::run_inprocess has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (19 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.
turso_whopper::worker::run_worker (cognitive 24) testing/concurrent-simulator/worker.rs:29— turso_whopper::worker::run_worker has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 5 (8 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.
sql_generation::generation::generated_expr::generate_expr_inner (cognitive 28) sql_generation/generation/generated_expr.rs:32— sql_generation::generation::generated_expr::generate_expr_inner has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (23 pts), boolean chains 4, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sql_generation::generation::query::gen_insert_upsert_values (cognitive 22) sql_generation/generation/query.rs:470— sql_generation::generation::query::gen_insert_upsert_values has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (11 pts), boolean chains 8, loops 2 (3 pts) (nesting depth added 3). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
sql_generation::generation::value::cmp::mutate_string (cognitive 21) sql_generation/generation/value/cmp.rs:135— sql_generation::generation::value::cmp::mutate_string has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
sql_generation::generation::query::get_column_diff (cognitive 17) sql_generation/generation/query.rs:878— sql_generation::generation::query::get_column_diff has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (5 members, 50+ identical tokens) core/incremental/vdbe_maintenance/join.rs:1259— core/incremental/vdbe_maintenance/join.rs:1259-1322 | core/translate/insert.rs:1210-1229 | core/translate/sequence.rs:73-169 | core/translate/sequence.rs:190-417 | core/translate/sequence.rs:435-635 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED:2813— REDACTED:2813-2844 | REDACTED:2847-2888 | REDACTED:2892-2903 | REDACTED:2908-2928 | REDACTED:3528-3601 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) core/translate/emitter/mod.rs:1618— core/translate/emitter/mod.rs:1618-1715 | core/translate/emitter/mod.rs:1728-1841 | core/translate/emitter/mod.rs:1849-1922 | core/translate/schema.rs:1628-1698 | core/translate/schema.rs:2707-2811 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Members sharing a duplicated core (5 members, 50+ identical tokens) REDACTED:358— REDACTED:358-430 | REDACTED:436-485 | REDACTED:549-604 | REDACTED:612-663 | REDACTED:1028-1097 — 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 (24 lines × 2) bindings/java/rs_src/turso_db.rs:57— bindings/java/rs_src/turso_db.rs:57-80 | bindings/java/rs_src/turso_db.rs:105-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 (24 lines × 2) bindings/rust/src/lib.rs:294— bindings/rust/src/lib.rs:294-317 | bindings/rust/src/sync.rs:316-339 — 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 (24 lines × 2) core/translate/view.rs:675— core/translate/view.rs:675-698 | core/translate/view.rs:793-816 — both copies are in the same file, so extract the block into 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) perf/tatp/main.rs:920— perf/tatp/main.rs:920-943 | perf/throughput/main.rs:644-667 — `perf/tatp/main.rs` and `perf/throughput/main.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 18 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (18 lines × 3) core/mvcc/cursor.rs:919— core/mvcc/cursor.rs:919-936 | core/mvcc/cursor.rs:1007-1024 | core/mvcc/cursor.rs:1041-1058 — 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 (18 lines × 3) core/translate/optimizer/constraints.rs:2379— core/translate/optimizer/constraints.rs:2379-2396 | core/translate/optimizer/constraints.rs:2411-2428 | core/translate/optimizer/constraints.rs:2451-2468 — 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 (18 lines × 3) core/vector/vector_types.rs:121— core/vector/vector_types.rs:121-138 | core/vector/vector_types.rs:148-165 | core/vector/vector_types.rs:198-215 — 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 (18 lines × 3) sync/engine/src/database_sync_operations.rs:1998— sync/engine/src/database_sync_operations.rs:1998-2015 | sync/engine/src/database_sync_operations.rs:2143-2160 | sync/engine/src/database_sync_operations.rs:2266-2283 — 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 (17–18 lines × 2) core/json/jsonb.rs:1171— core/json/jsonb.rs:1171-1188 | core/json/jsonb.rs:1213-1229 — both copies are in the same file, so extract the block into 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–18 lines × 2) core/translate/expr/translator.rs:1589— core/translate/expr/translator.rs:1589-1606 | core/translate/expr/translator.rs:1859-1875 — both copies are in the same file, so extract the block into 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–18 lines × 2) core/translate/insert.rs:2425— core/translate/insert.rs:2425-2442 | core/translate/schema.rs:1111-1127 — 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 (17–18 lines × 2) sync/engine/src/database_sync_engine.rs:1050— sync/engine/src/database_sync_engine.rs:1050-1067 | sync/engine/src/database_sync_engine.rs:1097-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–17 lines × 2) core/dialect/sqlite/attach.rs:61— core/dialect/sqlite/attach.rs:61-76 | core/dialect/sqlite/attach.rs:163-179 — both copies are in the same file, so extract the block into 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) core/mvcc/database/checkpoint_state_machine.rs:2275— core/mvcc/database/checkpoint_state_machine.rs:2275-2290 | core/mvcc/database/checkpoint_state_machine.rs:2359-2375 — both copies are in the same file, so extract the block into 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) core/translate/analyze.rs:327— core/translate/analyze.rs:327-342 | core/translate/analyze.rs:344-360 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–17 lines × 2) core/translate/emitter/delete.rs:780— core/translate/emitter/delete.rs:780-795 | core/translate/insert.rs:3882-3898 — 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–15 lines × 2) core/connection.rs:1265— core/connection.rs:1265-1279 | core/connection.rs:1321-1333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–15 lines × 2) core/storage/wal.rs:1054— core/storage/wal.rs:1054-1068 | core/storage/wal.rs:2094-2106 — both copies are in the same file, so extract the block into 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–15 lines × 2) core/translate/insert.rs:2429— core/translate/insert.rs:2429-2443 | core/translate/sequence.rs:781-793 — before extracting anything, compare `core/translate/insert.rs` and `core/translate/sequence.rs` as WHOLE FILES: this scan already matched 5 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 (13–15 lines × 2) testing/sqltest/src/parser/mod.rs:841— testing/sqltest/src/parser/mod.rs:841-853 | testing/sqltest/src/parser/mod.rs:858-872 — both copies are in the same file, so extract the block into 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) core/time/mod.rs:236— core/time/mod.rs:236-242 | core/time/mod.rs:555-561 | core/time/mod.rs:572-578 | core/time/mod.rs:589-595 | core/time/mod.rs:612-618 | core/time/mod.rs:780-785 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 6) sync/sdk-kit/src/rsapi.rs:414— sync/sdk-kit/src/rsapi.rs:414-419 | sync/sdk-kit/src/rsapi.rs:437-442 | sync/sdk-kit/src/rsapi.rs:454-459 | sync/sdk-kit/src/rsapi.rs:471-476 | sync/sdk-kit/src/rsapi.rs:487-492 | sync/sdk-kit/src/rsapi.rs:509-514 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 6) testing/differential-oracle/sql_gen/src/schema.rs:163— testing/differential-oracle/sql_gen/src/schema.rs:163-168 | testing/differential-oracle/sql_gen/src/schema.rs:238-243 | testing/differential-oracle/sql_gen/src/schema.rs:269-274 | testing/differential-oracle/sql_gen_prop/schema.rs:148-153 | testing/differential-oracle/sql_gen_prop/schema.rs:214-219 | testing/differential-oracle/sql_gen_prop/schema.rs:261-266 — before extracting anything, compare `testing/differential-oracle/sql_gen/src/schema.rs` and `testing/differential-oracle/sql_gen_prop/schema.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 52 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 6) postgres/cli/main.rs:318— postgres/cli/main.rs:318-323 | postgres/cli/main.rs:379-384 | postgres/cli/main.rs:410-415 | postgres/cli/main.rs:442-447 | postgres/cli/main.rs:476-481 | postgres/cli/main.rs:574-579 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
DatabaseSyncEngine::apply_changes_internal (cyclomatic 83) sync/engine/src/database_sync_engine.rs:2183— DatabaseSyncEngine::apply_changes_internal has cyclomatic complexity 83 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
DatabaseSyncEngine::bootstrap_db (cyclomatic 18) sync/engine/src/database_sync_engine.rs:941— DatabaseSyncEngine::bootstrap_db 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.
DatabaseSyncEngine::apply_logical_mvcc_changes_internal (cyclomatic 16) sync/engine/src/database_sync_engine.rs:1955— DatabaseSyncEngine::apply_logical_mvcc_changes_internal 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.
Program::abort (cyclomatic 79) core/vdbe/mod.rs:3458— Program::abort has cyclomatic complexity 79 (threshold 15). Of this number, 78 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Program::normal_step::dispatch_loop (cyclomatic 33) core/vdbe/mod.rs:2551— Program::normal_step::dispatch_loop 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.
Program::commit_txn_mvcc (cyclomatic 18) core/vdbe/mod.rs:3169— Program::commit_txn_mvcc has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ActiveOpState::fmt (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.
VectorSparseInvertedIndexMethodCursor::query_start (cyclomatic 66) core/index_method/toy_vector_sparse_ivf.rs:1042— VectorSparseInvertedIndexMethodCursor::query_start has cyclomatic complexity 66 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
VectorSparseInvertedIndexMethodCursor::delete (cyclomatic 25) core/index_method/toy_vector_sparse_ivf.rs:770— VectorSparseInvertedIndexMethodCursor::delete 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.
VectorSparseInvertedIndexMethodCursor::insert (cyclomatic 23) core/index_method/toy_vector_sparse_ivf.rs:505— VectorSparseInvertedIndexMethodCursor::insert 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.
FtsCursor::drive_open (cyclomatic 46) REDACTED:1401— FtsCursor::drive_open has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FtsCursor::query_start (cyclomatic 35) REDACTED:3026— FtsCursor::query_start has cyclomatic complexity 35 (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.
FtsCursor::stage_statement_commit (cyclomatic 16) REDACTED:3393— FtsCursor::stage_statement_commit 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.
limbo_fuzzy::editdist::edit_distance (cyclomatic 40) extensions/fuzzy/src/editdist.rs:86— limbo_fuzzy::editdist::edit_distance 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.
limbo_fuzzy::phonetic::phonetic_hash (cyclomatic 26) extensions/fuzzy/src/phonetic.rs:15— limbo_fuzzy::phonetic::phonetic_hash 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.
limbo_fuzzy::translit::script_code (cyclomatic 17) extensions/fuzzy/src/translit.rs:495— limbo_fuzzy::translit::script_code 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.
sqltest::run_tests (cyclomatic 33) testing/sqltest/src/main.rs:229— sqltest::run_tests 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.
sqltest::runner::run_single (cyclomatic 24) testing/sqltest/src/runner/mod.rs:460— sqltest::runner::run_single 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.
sqltest::tcl_converter::parser::parse_tcl_file (cyclomatic 18) testing/sqltest/src/tcl_converter/parser.rs:514— sqltest::tcl_converter::parser::parse_tcl_file has cyclomatic complexity 18 (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.
Value::exec_math_unary (cyclomatic 29) core/vdbe/value.rs:1090— Value::exec_math_unary has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Value::exec_substring (cyclomatic 20) core/vdbe/value.rs:458— Value::exec_substring has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 8 of the 20 points are its own statements and the rest belongs to 2 function items inside it that branch (calculate_postions, ceil_char_boundary). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Value::exec_cast (cyclomatic 20) core/vdbe/value.rs:976— Value::exec_cast 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.
SelectStmt::unordered_limit_reason (cyclomatic 27) testing/differential-oracle/sql_gen/src/ast.rs:137— SelectStmt::unordered_limit_reason 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.
SelectStmt::fmt (cyclomatic 23) testing/differential-oracle/sql_gen/src/ast.rs:796— SelectStmt::fmt 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: BinOp::fmt (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
SelectStmt::non_unique_order_by_reason (cyclomatic 22) testing/differential-oracle/sql_gen/src/ast.rs:223— SelectStmt::non_unique_order_by_reason 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: BinOp::fmt (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
HashTable::load_spilled_partition (cyclomatic 22) core/vdbe/hash_table.rs:2356— HashTable::load_spilled_partition 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.
HashTable::insert_distinct (cyclomatic 19) core/vdbe/hash_table.rs:1284— HashTable::insert_distinct 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.
HashTable::spill_multiple_partitions (cyclomatic 17) core/vdbe/hash_table.rs:1610— HashTable::spill_multiple_partitions 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.
Statement::finish_step (cyclomatic 21) core/statement.rs:748— Statement::finish_step 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.
Statement::reset_internal (cyclomatic 20) core/statement.rs:1684— Statement::reset_internal 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, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Statement::get_column_name (cyclomatic 16) core/statement.rs:1203— Statement::get_column_name 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.
VectorSparseInvertedIndexMethodCursor::query_start (cognitive 187) core/index_method/toy_vector_sparse_ivf.rs:1042— VectorSparseInvertedIndexMethodCursor::query_start has cognitive complexity 187 (threshold 15). Drivers by points: if/else 51 (169 pts), match/switch 4 (12 pts), boolean chains 5, loops 1 (nesting depth added 126). 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.
VectorSparseInvertedIndexMethodCursor::insert (cognitive 45) core/index_method/toy_vector_sparse_ivf.rs:505— VectorSparseInvertedIndexMethodCursor::insert has cognitive complexity 45 (threshold 15). Drivers by points: if/else 14 (39 pts), match/switch 2 (5 pts), 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.
VectorSparseInvertedIndexMethodCursor::delete (cognitive 44) core/index_method/toy_vector_sparse_ivf.rs:770— VectorSparseInvertedIndexMethodCursor::delete has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (35 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseSyncEngine::apply_changes_internal (cognitive 150) sync/engine/src/database_sync_engine.rs:2183— DatabaseSyncEngine::apply_changes_internal has cognitive complexity 150 (threshold 15). Drivers by points: if/else 59 (101 pts), match/switch 10 (23 pts), boolean chains 19, loops 4 (7 pts) (nesting depth added 58). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseSyncEngine::apply_logical_mvcc_changes_internal (cognitive 27) sync/engine/src/database_sync_engine.rs:1955— DatabaseSyncEngine::apply_logical_mvcc_changes_internal has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 3 (8 pts), loops 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseSyncEngine::bootstrap_db (cognitive 26) sync/engine/src/database_sync_engine.rs:941— DatabaseSyncEngine::bootstrap_db has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (23 pts), match/switch 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WalFile::checkpoint_inner (cognitive 76) core/storage/wal.rs:4952— WalFile::checkpoint_inner has cognitive complexity 76 (threshold 15). Drivers by points: if/else 24 (65 pts), boolean chains 5, loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 44). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WalFile::read_frames_batch (cognitive 18) core/storage/wal.rs:3771— WalFile::read_frames_batch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 2 (5 pts), loops 4 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WalFile::write_frame_raw (cognitive 16) core/storage/wal.rs:4007— WalFile::write_frame_raw has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 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.
Whopper::perform_work (cognitive 72) testing/concurrent-simulator/lib.rs:1011— Whopper::perform_work has cognitive complexity 72 (threshold 15). Drivers by points: if/else 26 (52 pts), match/switch 3 (8 pts), loops 3 (7 pts), boolean chains 5 (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.
Whopper::maybe_probe_checkpoint_on_suspended_statement (cognitive 22) testing/concurrent-simulator/lib.rs:928— Whopper::maybe_probe_checkpoint_on_suspended_statement has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2 (4 pts), boolean chains 2, loops 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.
Whopper::new (cognitive 16) testing/concurrent-simulator/lib.rs:704— Whopper::new has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (9 pts), if/else 5, match/switch 2 (nesting depth added 3). 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.
turso_macros::atomic_enum::derive_atomic_enum_inner (cognitive 55) macros/src/atomic_enum.rs:5— turso_macros::atomic_enum::derive_atomic_enum_inner has cognitive complexity 55 (threshold 15). Drivers by points: if/else 28 (45 pts), match/switch 4 (5 pts), boolean chains 4, loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_macros::derive_description_from_doc (cognitive 30) macros/src/lib.rs:123— turso_macros::derive_description_from_doc has cognitive complexity 30 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 2 (6 pts), loops 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.
turso_macros::ext::match_ignore_ascii_case::match_ignore_ascci_case (cognitive 29) macros/src/ext/match_ignore_ascii_case.rs:7— turso_macros::ext::match_ignore_ascii_case::match_ignore_ascci_case has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (11 pts), match/switch 4 (10 pts), loops 5 (8 pts) (nesting depth added 11). Of this number, 18 points are the body's own statements and 11 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Value::exec_unhex (cognitive 50) core/vdbe/value.rs:664— Value::exec_unhex has cognitive complexity 50 (threshold 15). Drivers by points: if/else 6 (27 pts), match/switch 5 (13 pts), loops 2 (9 pts), boolean chains 1 (nesting depth added 36). 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.
Value::exec_substring (cognitive 35) core/vdbe/value.rs:458— Value::exec_substring has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (24 pts), loops 3 (8 pts), match/switch 2, boolean chains 1 (nesting depth added 13). Most of this is not in the body itself: 13 of the 35 points are its own statements and the rest belongs to 2 function items inside it that branch (calculate_postions, ceil_char_boundary). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Value::exec_unistr_quote (cognitive 18) core/vdbe/value.rs:391— Value::exec_unistr_quote has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (10 pts), loops 3 (6 pts), if/else 1 (2 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SelectStmt::unordered_limit_reason (cognitive 48) testing/differential-oracle/sql_gen/src/ast.rs:137— SelectStmt::unordered_limit_reason has cognitive complexity 48 (threshold 15). Drivers by points: if/else 19 (38 pts), loops 7 (10 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.
SelectStmt::fmt (cognitive 37) testing/differential-oracle/sql_gen/src/ast.rs:796— SelectStmt::fmt has cognitive complexity 37 (threshold 15). Drivers by points: if/else 18 (29 pts), loops 5 (8 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.
SelectStmt::non_unique_order_by_reason (cognitive 36) testing/differential-oracle/sql_gen/src/ast.rs:223— SelectStmt::non_unique_order_by_reason has cognitive complexity 36 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseReplayGenerator::replay_info (cognitive 34) sync/engine/src/database_replay_generator.rs:341— DatabaseReplayGenerator::replay_info has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 3 (9 pts), loops 1 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseReplayGenerator::execute_ddl_idempotent (cognitive 29) sync/engine/src/database_replay_generator.rs:736— DatabaseReplayGenerator::execute_ddl_idempotent has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (22 pts), loops 2 (6 pts), match/switch 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.
DatabaseReplayGenerator::replay_values (cognitive 26) sync/engine/src/database_replay_generator.rs:169— DatabaseReplayGenerator::replay_values has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 2 (5 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmitOrderBy::sorter_insert (cognitive 32) core/translate/order_by.rs:473— EmitOrderBy::sorter_insert has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (25 pts), loops 4 (7 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.
EmitOrderBy::init (cognitive 22) core/translate/order_by.rs:157— EmitOrderBy::init has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 3 (5 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.
EmitOrderBy::emit (cognitive 21) core/translate/order_by.rs:314— EmitOrderBy::emit has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (20 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.
Lexer::scan_dollar (cognitive 28) postgres/parser/lexer.rs:540— Lexer::scan_dollar has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (6 pts), boolean chains 4 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::skip_whitespace_and_comments (cognitive 22) postgres/parser/lexer.rs:303— Lexer::skip_whitespace_and_comments has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (7 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Lexer::scan_number (cognitive 19) postgres/parser/lexer.rs:657— Lexer::scan_number has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TestRunner::spawn_snapshot_tests (cognitive 25) testing/sqltest/src/runner/mod.rs:1048— TestRunner::spawn_snapshot_tests has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TestRunner::spawn_file_tests (cognitive 18) testing/sqltest/src/runner/mod.rs:982— TestRunner::spawn_file_tests has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (14 pts), loops 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.
TestRunner::spawn_matrix_tests (cognitive 16) testing/sqltest/src/runner/mod.rs:1121— TestRunner::spawn_matrix_tests has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_cli::config::terminal::read_windows_console_response (cognitive 24) cli/config/terminal.rs:269— turso_cli::config::terminal::read_windows_console_response has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_cli::mvcc_repl::run (cognitive 18) cli/mvcc_repl.rs:44— turso_cli::mvcc_repl::run has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (6 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.
turso_cli::sync_server::read_mvcc_frame_boundary (cognitive 17) cli/sync_server.rs:1142— turso_cli::sync_server::read_mvcc_frame_boundary has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TursoMcpServer::open_database (cognitive 23) cli/mcp_server.rs:499— TursoMcpServer::open_database has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 5 (10 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.
TursoMcpServer::run (cognitive 21) cli/mcp_server.rs:180— TursoMcpServer::run has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (7 pts), loops 2, 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.
TursoMcpServer::describe_table (cognitive 18) cli/mcp_server.rs:586— TursoMcpServer::describe_table has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 4 (7 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Duplicated block (27 lines × 2) core/statement.rs:1317— core/statement.rs:1317-1343 | core/statement.rs:1478-1504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27 lines × 2) perf/connection/limbo/src/main.rs:31— perf/connection/limbo/src/main.rs:31-57 | perf/connection/rusqlite/src/main.rs:24-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 (27 lines × 2) perf/memory/src/profile/mixed.rs:88— perf/memory/src/profile/mixed.rs:88-114 | perf/memory/src/profile/read.rs:88-114 — before extracting anything, compare `perf/memory/src/profile/mixed.rs` and `perf/memory/src/profile/read.rs` as WHOLE FILES: this scan already matched 4 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. 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 (26 lines × 2) core/incremental/vdbe_maintenance/linear.rs:99— core/incremental/vdbe_maintenance/linear.rs:99-124 | core/incremental/vdbe_maintenance/linear.rs:178-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) sqlite/parser/src/ast/fmt.rs:1819— sqlite/parser/src/ast/fmt.rs:1819-1844 | sqlite/parser/src/ast/fmt.rs:1952-1977 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 2) testing/simulator/generation/property.rs:489— testing/simulator/generation/property.rs:489-514 | testing/simulator/generation/property.rs:621-646 — both copies are in the same file, so extract the block into 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) core/schema.rs:5772— core/schema.rs:5772-5793 | core/schema.rs:5985-6006 — both copies are in the same file, so extract the block into 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) core/translate/pragma.rs:1099— core/translate/pragma.rs:1099-1120 | core/translate/pragma.rs:1139-1160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) REDACTED:4331— REDACTED:4331-4352 | REDACTED:4569-4590 — both copies are in the same file, so extract the block into 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 × 3) core/json/jsonb.rs:2722— core/json/jsonb.rs:2722-2741 | core/json/jsonb.rs:2914-2933 | core/json/jsonb.rs:3092-3111 — 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 (20 lines × 3) REDACTED:8673— REDACTED:8673-8692 | REDACTED:8706-8725 | REDACTED:8742-8761 — 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 (20 lines × 3) core/storage/sqlite3_ondisk.rs:868— core/storage/sqlite3_ondisk.rs:868-887 | core/storage/sqlite3_ondisk.rs:914-933 | core/storage/sqlite3_ondisk.rs:944-963 — 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 (14–16 lines × 2) core/functions/printf.rs:514— core/functions/printf.rs:514-527 | core/functions/printf.rs:984-999 — both copies are in the same file, so extract the block into 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) REDACTED:2102— REDACTED:2102-2115 | REDACTED:2346-2361 — both copies are in the same file, so extract the block into 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) core/translate/schema.rs:2014— core/translate/schema.rs:2014-2029 | core/translate/schema.rs:2378-2391 — both copies are in the same file, so extract the block into 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) core/io/win_iocp.rs:1009— core/io/win_iocp.rs:1009-1023 | core/io/win_iocp.rs:1084-1097 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) core/translate/emitter/update.rs:1382— core/translate/emitter/update.rs:1382-1396 | core/translate/upsert.rs:817-830 — before extracting anything, compare `core/translate/emitter/update.rs` and `core/translate/upsert.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 2) testing/sqlright/crash_reports/lib/executor.py:54— testing/sqlright/crash_reports/lib/executor.py:54-68 | testing/sqlright/crash_reports/lib/executor.py:104-117 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `testing/sqlright/crash_reports/lib/executor.py:54` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–14 lines × 2) core/json/jsonb.rs:2736— core/json/jsonb.rs:2736-2749 | core/json/jsonb.rs:2793-2804 — both copies are in the same file, so extract the block into 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) core/translate/upsert.rs:892— core/translate/upsert.rs:892-905 | core/translate/upsert.rs:1614-1625 — both copies are in the same file, so extract the block into 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) core/vdbe/execute.rs:19433— core/vdbe/execute.rs:19433-19446 | core/vdbe/execute.rs:19492-19503 — both copies are in the same file, so extract the block into 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) core/incremental/vdbe_maintenance/aggregate.rs:707— core/incremental/vdbe_maintenance/aggregate.rs:707-719 | core/incremental/vdbe_maintenance/aggregate.rs:904-916 | core/incremental/vdbe_maintenance/arrangement.rs:291-303 | core/incremental/vdbe_maintenance/join.rs:1190-1202 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/arrangement.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 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) sync/engine/src/database_sync_operations.rs:1947— sync/engine/src/database_sync_operations.rs:1947-1959 | sync/engine/src/database_sync_operations.rs:2111-2123 | sync/engine/src/database_sync_operations.rs:2236-2248 | sync/engine/src/database_sync_operations.rs:3426-3438 — 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 lines × 4) testing/concurrent-simulator/properties.rs:664— testing/concurrent-simulator/properties.rs:664-677 | testing/concurrent-simulator/properties.rs:703-716 | testing/concurrent-simulator/properties.rs:780-792 | testing/concurrent-simulator/properties.rs:832-845 — 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 lines × 4) core/vector/operations/distance_cos.rs:15— core/vector/operations/distance_cos.rs:15-25 | core/vector/operations/distance_dot.rs:15-25 | core/vector/operations/distance_l2.rs:15-25 | core/vector/operations/jaccard.rs:7-17 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (11 lines × 4) testing/sqltest/src/main.rs:371— testing/sqltest/src/main.rs:371-381 | testing/sqltest/src/main.rs:384-394 | testing/sqltest/src/main.rs:441-451 | testing/sqltest/src/main.rs:462-472 — 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 lines × 4) bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:174— bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:174-184 | bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:195-205 | bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:216-226 | bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:345-355 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/java/src/main/java/tech/turso/jdbc4/JDBC4ResultSet.java:174` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 3) core/translate/display.rs:186— core/translate/display.rs:186-196 | core/translate/display.rs:295-304 | core/translate/display.rs:409-418 — 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–11 lines × 3) core/translate/schema.rs:1331— core/translate/schema.rs:1331-1341 | core/translate/schema.rs:1443-1452 | core/translate/view.rs:415-424 — before extracting anything, compare `core/translate/schema.rs` and `core/translate/view.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 (10–11 lines × 3) core/incremental_blob.rs:455— core/incremental_blob.rs:455-465 | core/incremental_blob.rs:472-482 | core/incremental_blob.rs:485-494 — 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 × 6) core/translate/aggregation.rs:578— core/translate/aggregation.rs:578-584 | core/translate/aggregation.rs:612-618 | core/translate/aggregation.rs:725-731 | core/translate/aggregation.rs:765-771 | core/translate/aggregation.rs:783-789 | core/translate/aggregation.rs:802-808 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 6) core/translate/expr/translator.rs:1070— core/translate/expr/translator.rs:1070-1076 | core/translate/expr/translator.rs:1078-1084 | core/translate/expr/translator.rs:1086-1092 | core/translate/expr/translator.rs:1094-1100 | core/translate/expr/translator.rs:1102-1108 | core/translate/expr/translator.rs:1110-1116 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 6) sdk-kit/src/rsapi.rs:1108— sdk-kit/src/rsapi.rs:1108-1114 | sdk-kit/src/rsapi.rs:1476-1482 | sync/sdk-kit/src/rsapi.rs:156-162 | sync/sdk-kit/src/rsapi.rs:553-559 | sync/sdk-kit/src/sync_engine_io.rs:250-256 | sync/sdk-kit/src/turso_async_operation.rs:152-158 — 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 (6–7 lines × 2) core/mvcc/persistent_storage/logical_log.rs:2470— core/mvcc/persistent_storage/logical_log.rs:2470-2475 | core/mvcc/persistent_storage/logical_log.rs:2487-2493 — both copies are in the same file, so extract the block into 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) sql_generation/generation/generated_expr.rs:50— sql_generation/generation/generated_expr.rs:50-55 | sql_generation/generation/generated_expr.rs:98-104 — both copies are in the same file, so extract the block into 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) testing/simulator/generation/property.rs:729— testing/simulator/generation/property.rs:729-735 | testing/simulator/generation/property.rs:931-936 — both copies are in the same file, so extract the block into 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 × 5) core/vdbe/execute.rs:10565— core/vdbe/execute.rs:10565-10569 | core/vdbe/execute.rs:10573-10577 | core/vdbe/execute.rs:10620-10624 | core/vdbe/execute.rs:12682-12686 | core/vdbe/execute.rs:12689-12693 — 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 (5 lines × 5) core/vdbe/execute.rs:8522— core/vdbe/execute.rs:8522-8526 | core/vdbe/execute.rs:8553-8557 | core/vdbe/execute.rs:8591-8595 | core/vdbe/execute.rs:8730-8734 | core/vdbe/execute.rs:8771-8775 — 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 (5 lines × 5) REDACTED:2814— REDACTED:2814-2818 | REDACTED:2848-2852 | REDACTED:2893-2897 | REDACTED:2909-2913 | REDACTED:3529-3533 — 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 (5 lines × 4) core/time/internal.rs:418— core/time/internal.rs:418-422 | core/time/internal.rs:425-429 | core/time/internal.rs:433-437 | core/time/internal.rs:442-446 — 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 (5 lines × 4) testing/differential-oracle/sql_gen_prop/alter_table.rs:160— testing/differential-oracle/sql_gen_prop/alter_table.rs:160-164 | testing/differential-oracle/sql_gen_prop/create_trigger.rs:246-250 | testing/differential-oracle/sql_gen_prop/expression.rs:774-778 | testing/differential-oracle/sql_gen_prop/profile.rs:644-648 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (5 lines × 4) REDACTED:2918— REDACTED:2918-2922 | REDACTED:2993-2997 | REDACTED:3093-3097 | REDACTED:3383-3387 — 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 (14 lines × 2 locations) bindings/javascript/packages/common/compat.ts:466— bindings/javascript/packages/common/compat.ts:466 · bindings/javascript/packages/common/promise.ts:1259 — 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 (14 lines × 2 locations) bindings/javascript/sync/packages/common/run.ts:298— bindings/javascript/sync/packages/common/run.ts:298 · bindings/javascript/sync/packages/common/run.ts:312 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2 locations) bindings/javascript/sync/packages/native/turso-server.ts:103— bindings/javascript/sync/packages/native/turso-server.ts:103 · bindings/javascript/sync/packages/wasm/turso-server-setup.ts:50 — 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.
Property::interactions (cyclomatic 93) testing/simulator/generation/property.rs:294— Property::interactions has cyclomatic complexity 93 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Property::get_extensional_query_gen_function (cyclomatic 40) testing/simulator/generation/property.rs:49— Property::get_extensional_query_gen_function has cyclomatic complexity 40 (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.
Session::meta_command (cyclomatic 45) postgres/regress/main.rs:547— Session::meta_command has cyclomatic complexity 45 (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.
Session::execute_cursor_stmt (cyclomatic 23) serverless/rust/session.rs:308— Session::execute_cursor_stmt 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.
Whopper::perform_work (cyclomatic 37) testing/concurrent-simulator/lib.rs:1011— Whopper::perform_work has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Whopper::maybe_probe_checkpoint_on_suspended_statement (cyclomatic 16) testing/concurrent-simulator/lib.rs:928— Whopper::maybe_probe_checkpoint_on_suspended_statement 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.
EqpDetail::fmt (cyclomatic 33) core/translate/eqp.rs:310— EqpDetail::fmt 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.
EqpDetail::write_json (cyclomatic 23) core/translate/eqp.rs:731— EqpDetail::write_json 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.
Schema::handle_schema_row (cyclomatic 30) core/schema.rs:2976— Schema::handle_schema_row 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.
Schema::make_from_btree_internal (cyclomatic 17) core/schema.rs:2210— Schema::make_from_btree_internal 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.
EmitWindow::emit_window_step (cyclomatic 30) core/translate/window.rs:1384— EmitWindow::emit_window_step 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.
EmitWindow::init (cyclomatic 16) core/translate/window.rs:1085— EmitWindow::init 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.
turso_macros::atomic_enum::derive_atomic_enum_inner (cyclomatic 29) macros/src/atomic_enum.rs:5— turso_macros::atomic_enum::derive_atomic_enum_inner 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.
turso_macros::ext::match_ignore_ascii_case::match_ignore_ascci_case (cyclomatic 17) macros/src/ext/match_ignore_ascii_case.rs:7— turso_macros::ext::match_ignore_ascii_case::match_ignore_ascci_case has cyclomatic complexity 17 (threshold 15). Of this number, 12 points are the body's own statements and 5 belong to one function item inside it that branches. 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.
turso_pg_server::command_tag (cyclomatic 28) postgres/server/lib.rs:684— turso_pg_server::command_tag 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.
turso_pg_server::scalar_pg_type_to_array_type (cyclomatic 21) postgres/server/lib.rs:377— turso_pg_server::scalar_pg_type_to_array_type 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. This is NOT this file's highest cyclomatic complexity: turso_pg_server::sqlite_type_to_pg_type (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
SelectPlan::to_tokens (cyclomatic 24) core/translate/display.rs:624— SelectPlan::to_tokens 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.
SelectPlan::fmt (cyclomatic 19) core/translate/display.rs:109— SelectPlan::fmt 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.
Connection::attach_database_with_config (cyclomatic 22) core/dialect/sqlite/attach.rs:421— Connection::attach_database_with_config 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.
Connection::drive_reparse_building (cyclomatic 17) core/connection.rs:1472— Connection::drive_reparse_building 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.
SeekEmitter::emit_termination (cyclomatic 21) core/translate/main_loop/seek.rs:293— SeekEmitter::emit_termination 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.
SeekEmitter::emit_start_bound (cyclomatic 19) core/translate/main_loop/seek.rs:124— SeekEmitter::emit_start_bound 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.
Insert::shadow (cyclomatic 21) REDACTED:818— Insert::shadow 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: Query::fmt (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
Insert::fmt (cyclomatic 17) sql_generation/model/query/insert.rs:71— Insert::fmt 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.
turso_pg_regress::split_meta_args (cyclomatic 20) postgres/regress/main.rs:797— turso_pg_regress::split_meta_args has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
turso_pg_regress::describe::table_footers (cyclomatic 16) postgres/regress/describe.rs:331— turso_pg_regress::describe::table_footers 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.
sql_generation::generation::query::gen_insert_upsert_values (cyclomatic 19) sql_generation/generation/query.rs:470— sql_generation::generation::query::gen_insert_upsert_values 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.
sql_generation::generation::generated_expr::generate_expr_inner (cyclomatic 17) sql_generation/generation/generated_expr.rs:32— sql_generation::generation::generated_expr::generate_expr_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.
TodoComment bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:326— // TODO: Refactor this out — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:374— // TODO: nullable? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
SequenceCorrectnessProperty::finish_op (cognitive 249) testing/concurrent-simulator/properties.rs:1190— SequenceCorrectnessProperty::finish_op has cognitive complexity 249 (threshold 15). Drivers by points: if/else 59 (210 pts), boolean chains 22, loops 3 (10 pts), match/switch 3 (7 pts) (nesting depth added 162). 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.
SequenceCorrectnessProperty::on_restart (cognitive 22) testing/concurrent-simulator/properties.rs:1991— SequenceCorrectnessProperty::on_restart has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Property::interactions (cognitive 244) testing/simulator/generation/property.rs:294— Property::interactions has cognitive complexity 244 (threshold 15). Drivers by points: if/else 68 (168 pts), loops 11 (36 pts), match/switch 14 (36 pts), boolean chains 4 (nesting depth added 147). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Property::get_extensional_query_gen_function (cognitive 31) testing/simulator/generation/property.rs:49— Property::get_extensional_query_gen_function has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 6 (11 pts), boolean chains 4 (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.
BTreeTable::to_sql (cognitive 127) core/schema.rs:4567— BTreeTable::to_sql has cognitive complexity 127 (threshold 15). Drivers by points: if/else 40 (93 pts), loops 10 (18 pts), boolean chains 10, match/switch 2 (6 pts) (nesting depth added 65). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeTable::try_build_logical_to_physical_map (cognitive 17) core/schema.rs:4882— BTreeTable::try_build_logical_to_physical_map has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShadowTablesMut::apply_snapshot (cognitive 103) REDACTED:688— ShadowTablesMut::apply_snapshot has cognitive complexity 103 (threshold 15). Drivers by points: if/else 12 (52 pts), loops 12 (48 pts), match/switch 1 (3 pts) (nesting depth added 78). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShadowTablesMut::nextval (cognitive 16) REDACTED:509— ShadowTablesMut::nextval has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProgramState::end_statement (cognitive 86) core/vdbe/mod.rs:1766— ProgramState::end_statement has cognitive complexity 86 (threshold 15). Drivers by points: if/else 24 (60 pts), loops 6 (17 pts), match/switch 3 (6 pts), boolean chains 3 (nesting depth added 50). 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.
ProgramState::reset (cognitive 17) core/vdbe/mod.rs:1351— ProgramState::reset has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (9 pts), loops 3 (4 pts), match/switch 2 (4 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Insert::shadow (cognitive 74) REDACTED:818— Insert::shadow has cognitive complexity 74 (threshold 15). Drivers by points: if/else 10 (40 pts), loops 7 (23 pts), match/switch 4 (11 pts) (nesting depth added 53). 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.
Insert::fmt (cognitive 41) sql_generation/model/query/insert.rs:71— Insert::fmt has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 6 (15 pts), match/switch 1 (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.
SelectPlan::to_tokens (cognitive 59) core/translate/display.rs:624— SelectPlan::to_tokens has cognitive complexity 59 (threshold 15). Drivers by points: if/else 20 (48 pts), loops 4 (11 pts) (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SelectPlan::fmt (cognitive 51) core/translate/display.rs:109— SelectPlan::fmt has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (42 pts), match/switch 3 (8 pts), 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.
Expr::check_always_true_or_false (cognitive 53) core/translate/optimizer/mod.rs:4186— Expr::check_always_true_or_false has cognitive complexity 53 (threshold 15). Drivers by points: if/else 15 (38 pts), match/switch 5 (11 pts), boolean chains 4 (nesting depth added 29). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Expr::to_tokens (cognitive 37) sqlite/parser/src/ast/fmt.rs:890— Expr::to_tokens has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (34 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
EmitWindow::emit_window_step (cognitive 50) core/translate/window.rs:1384— EmitWindow::emit_window_step has cognitive complexity 50 (threshold 15). Drivers by points: if/else 24 (39 pts), boolean chains 4, match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EmitWindow::init (cognitive 21) core/translate/window.rs:1085— EmitWindow::init has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14, boolean chains 3, loops 2, match/switch 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.
Session::meta_command (cognitive 47) postgres/regress/main.rs:547— Session::meta_command has cognitive complexity 47 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 7 (15 pts), loops 4 (12 pts), boolean chains 5 (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.
Session::execute_cursor_stmt (cognitive 38) serverless/rust/session.rs:308— Session::execute_cursor_stmt has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 4 (13 pts), boolean chains 1, loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Update::shadow (cognitive 47) REDACTED:1293— Update::shadow has cognitive complexity 47 (threshold 15). Drivers by points: if/else 13 (31 pts), loops 7 (12 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Update::arbitrary (cognitive 16) sql_generation/generation/query.rs:722— Update::arbitrary has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MappedSharedWalCoordination::register_reader (cognitive 43) core/storage/shared_wal_coordination.rs:1994— MappedSharedWalCoordination::register_reader has cognitive complexity 43 (threshold 15). Drivers by points: if/else 7 (26 pts), match/switch 2 (10 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MappedSharedWalCoordination::release_owned_locks_on_drop (cognitive 23) core/storage/shared_wal_coordination.rs:1111— MappedSharedWalCoordination::release_owned_locks_on_drop has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (22 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.
InteractionPlan::remove_properties (cognitive 38) testing/simulator/shrink/plan.rs:204— InteractionPlan::remove_properties has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (27 pts), boolean chains 5, loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InteractionPlan::generate_next_interaction (cognitive 23) testing/simulator/generation/plan.rs:46— InteractionPlan::generate_next_interaction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 5 (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.
InteractionType::execute_faulty_query (cognitive 32) testing/simulator/model/interactions.rs:807— InteractionType::execute_faulty_query has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 3 (9 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
InteractionType::execute_fsync_query (cognitive 18) testing/simulator/model/interactions.rs:737— InteractionType::execute_fsync_query has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (6 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProgramBuilder::epilogue (cognitive 30) core/vdbe/builder.rs:2183— ProgramBuilder::epilogue has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (6 pts) (nesting depth added 17). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ProgramBuilder::emit_constant_insns (cognitive 21) core/vdbe/builder.rs:1583— ProgramBuilder::emit_constant_insns has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 5 (7 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_pg_server::command_tag (cognitive 30) postgres/server/lib.rs:684— turso_pg_server::command_tag has cognitive complexity 30 (threshold 15). Drivers by points: if/else 26 (27 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
turso_pg_server::scalar_pg_type_to_array_type (cognitive 21) postgres/server/lib.rs:377— turso_pg_server::scalar_pg_type_to_array_type has cognitive complexity 21 (threshold 15). Drivers by points: if/else 20, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SeekEmitter::emit_start_bound (cognitive 28) core/translate/main_loop/seek.rs:124— SeekEmitter::emit_start_bound has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 3 (5 pts), boolean chains 2, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeekEmitter::emit_termination (cognitive 27) core/translate/main_loop/seek.rs:293— SeekEmitter::emit_termination has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 3 (4 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShmWalCoordination::try_begin_read_tx (cognitive 23) core/storage/wal.rs:2070— ShmWalCoordination::try_begin_read_tx has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShmWalCoordination::acquire_checkpoint_guard (cognitive 16) core/storage/wal.rs:2160— ShmWalCoordination::acquire_checkpoint_guard has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TursoSyncServer::handle_connection (cognitive 22) cli/sync_server.rs:218— TursoSyncServer::handle_connection has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 4 (5 pts), loops 2 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TursoSyncServer::handle_page_pull_updates (cognitive 22) cli/sync_server.rs:614— TursoSyncServer::handle_page_pull_updates has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (19 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sorter::insert (cognitive 19) core/vdbe/sorter.rs:376— Sorter::insert has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Sorter::next (cognitive 16) core/vdbe/sorter.rs:313— Sorter::next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 4 (8 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.
TooManyFunctions: turso_macros macros/src/lib.rs:106— TooManyFunctions — 42 free functions. The bar is 30 free functions; this is 12 over it, 1.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyFunctions: sql_gen::generate::expr testing/differential-oracle/sql_gen/src/generate/expr.rs:16— TooManyFunctions — 32 free functions. The bar is 30 free functions; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (8 members, 50+ identical tokens) core/json/mod.rs:388— core/json/mod.rs:388-421 | core/json/mod.rs:428-460 | core/json/ops.rs:92-118 | core/json/ops.rs:125-149 | core/json/ops.rs:156-188 | core/json/ops.rs:195-227 | core/json/ops.rs:234-267 | core/json/ops.rs:274-307 — 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.
Members sharing a duplicated core (8 members, 50+ identical tokens) sdk-kit/src/capi.rs:165— sdk-kit/src/capi.rs:165-201 | sdk-kit/src/capi.rs:219-261 | sdk-kit/src/capi.rs:269-283 | sdk-kit/src/capi.rs:296-319 | sdk-kit/src/capi.rs:327-339 | sdk-kit/src/capi.rs:364-378 | sdk-kit/src/capi.rs:387-404 | sdk-kit/src/capi.rs:414-439 — 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 (6 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (6 members, 50+ identical tokens) core/time/mod.rs:235— core/time/mod.rs:235-249 | core/time/mod.rs:554-568 | core/time/mod.rs:571-585 | core/time/mod.rs:588-608 | core/time/mod.rs:611-625 | core/time/mod.rs:779-791 — 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) extensions/fuzzy/src/lib.rs:18— extensions/fuzzy/src/lib.rs:18-32 | extensions/fuzzy/src/lib.rs:82-96 | extensions/fuzzy/src/lib.rs:177-194 | extensions/fuzzy/src/lib.rs:198-212 | extensions/fuzzy/src/lib.rs:231-245 | extensions/fuzzy/src/lib.rs:330-344 — 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 (40 lines × 2) core/mvcc/persistent_storage/logical_log.rs:2821— core/mvcc/persistent_storage/logical_log.rs:2821-2860 | core/mvcc/persistent_storage/logical_log.rs:3131-3170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (40 lines × 2) bindings/python/turso/sqlalchemy/dialect.py:109— bindings/python/turso/sqlalchemy/dialect.py:109-148 | bindings/python/turso/sqlalchemy/dialect.py:268-307 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (33 lines × 2) core/translate/main_loop/hash.rs:1160— core/translate/main_loop/hash.rs:1160-1192 | core/translate/main_loop/hash.rs:1418-1450 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (33 lines × 2) bindings/python/turso/lib.py:135— bindings/python/turso/lib.py:135-167 | serverless/python/turso_serverless/dbapi.py:53-85 — before extracting anything, compare `bindings/python/turso/lib.py` and `serverless/python/turso_serverless/dbapi.py` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (31 lines × 2) core/json/mod.rs:917— core/json/mod.rs:917-947 | core/json/mod.rs:958-988 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (31 lines × 2) core/translate/expr/walk.rs:38— core/translate/expr/walk.rs:38-68 | core/translate/expr/walk.rs:373-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (30 lines × 2) REDACTED:1513— REDACTED:1513-1542 | REDACTED:2007-2036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (30 lines × 2) perf/latency/turso_engine.rs:237— perf/latency/turso_engine.rs:237-266 | perf/throughput/turso_engine.rs:216-245 — `perf/latency/turso_engine.rs` and `perf/throughput/turso_engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 130 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (26–28 lines × 2) core/translate/group_by.rs:802— core/translate/group_by.rs:802-829 | core/translate/group_by.rs:856-881 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–28 lines × 2) postgres/parser/parser.rs:452— postgres/parser/parser.rs:452-479 | postgres/parser/parser.rs:2055-2080 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26 lines × 3) cli/read_state_machine.rs:93— cli/read_state_machine.rs:93-118 | postgres/cli/read_state_machine.rs:128-153 | testing/sqltest/src/parser/sql_complete.rs:95-120 — before extracting anything, compare `cli/read_state_machine.rs` and `postgres/cli/read_state_machine.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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 (26 lines × 3) sync/engine/src/database_sync_operations.rs:1946— sync/engine/src/database_sync_operations.rs:1946-1971 | sync/engine/src/database_sync_operations.rs:2110-2135 | sync/engine/src/database_sync_operations.rs:2235-2260 — 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 (25–26 lines × 2) core/mvcc/database/checkpoint_state_machine.rs:2888— core/mvcc/database/checkpoint_state_machine.rs:2888-2912 | core/mvcc/database/checkpoint_state_machine.rs:2922-2947 — both copies are in the same file, so extract the block into 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) REDACTED:2025— REDACTED:2025-2049 | REDACTED:3165-3190 — both copies are in the same file, so extract the block into 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) core/database.rs:2881— core/database.rs:2881-2905 | core/database.rs:2917-2941 — both copies are in the same file, so extract the block into 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) perf/tatp/main.rs:734— perf/tatp/main.rs:734-758 | perf/throughput/main.rs:515-539 — `perf/tatp/main.rs` and `perf/throughput/main.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 18 separate duplicated blocks between them, totalling at least 179 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (21–23 lines × 2) REDACTED:5235— REDACTED:5235-5257 | REDACTED:5315-5335 — both copies are in the same file, so extract the block into 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–23 lines × 2) testing/concurrent-simulator/properties.rs:781— testing/concurrent-simulator/properties.rs:781-801 | testing/concurrent-simulator/properties.rs:833-855 — both copies are in the same file, so extract the block into 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–23 lines × 2) postgres/client/lib.rs:150— postgres/client/lib.rs:150-168 | postgres/regress/main.rs:1549-1571 — before extracting anything, compare `postgres/client/lib.rs` and `postgres/regress/main.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 (19–23 lines × 2) perf/latency/turso_engine.rs:136— perf/latency/turso_engine.rs:136-158 | perf/throughput/turso_engine.rs:131-149 — `perf/latency/turso_engine.rs` and `perf/throughput/turso_engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 9 separate duplicated blocks between them, totalling at least 130 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (20–21 lines × 2) REDACTED:4647— REDACTED:4647-4667 | REDACTED:5168-5187 — both copies are in the same file, so extract the block into 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–21 lines × 2) REDACTED:4968— REDACTED:4968-4988 | REDACTED:5143-5162 — both copies are in the same file, so extract the block into 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–20 lines × 2) core/dialect/sqlite/attach.rs:39— core/dialect/sqlite/attach.rs:39-58 | core/dialect/sqlite/attach.rs:143-160 — both copies are in the same file, so extract the block into 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–20 lines × 2) core/incremental/dag.rs:324— core/incremental/dag.rs:324-341 | core/incremental/dag.rs:362-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 (19 lines × 3) cli/read_state_machine.rs:179— cli/read_state_machine.rs:179-197 | postgres/cli/read_state_machine.rs:214-232 | testing/sqltest/src/parser/sql_complete.rs:173-191 — before extracting anything, compare `cli/read_state_machine.rs` and `postgres/cli/read_state_machine.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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 (19 lines × 3) core/translate/view.rs:668— core/translate/view.rs:668-686 | core/translate/view.rs:756-774 | core/translate/view.rs:786-804 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–19 lines × 2) core/storage/wal.rs:4609— core/storage/wal.rs:4609-4623 | core/storage/wal.rs:4711-4729 — both copies are in the same file, so extract the block into 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–19 lines × 2) REDACTED:788— REDACTED:788-806 | REDACTED:825-839 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–19 lines × 2) core/translate/expr/binary.rs:705— core/translate/expr/binary.rs:705-723 | core/translate/expr/binary.rs:1131-1146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–19 lines × 2) core/translate/optimizer/constraints.rs:2207— core/translate/optimizer/constraints.rs:2207-2222 | core/translate/optimizer/constraints.rs:2270-2288 — both copies are in the same file, so extract the block into 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) core/translate/analyze.rs:641— core/translate/analyze.rs:641-658 | core/translate/sequence.rs:769-784 — 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–18 lines × 2) REDACTED:807— REDACTED:807-824 | REDACTED:989-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 (16–17 lines × 3) core/incremental/vdbe_maintenance/linear.rs:196— core/incremental/vdbe_maintenance/linear.rs:196-212 | core/incremental/vdbe_maintenance/linear.rs:474-489 | core/incremental/vdbe_maintenance/set_op.rs:190-206 — before extracting anything, compare `core/incremental/vdbe_maintenance/linear.rs` and `core/incremental/vdbe_maintenance/set_op.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 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–17 lines × 3) core/util.rs:616— core/util.rs:616-632 | core/util.rs:727-742 | core/util.rs:899-915 — 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–17 lines × 3) core/translate/insert.rs:1817— core/translate/insert.rs:1817-1827 | core/translate/sequence.rs:730-738 | core/translate/trigger.rs:561-577 — before extracting anything, compare `core/translate/insert.rs` and `core/translate/sequence.rs` as WHOLE FILES: this scan already matched 5 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–17 lines × 3) core/translate/sequence.rs:1016— core/translate/sequence.rs:1016-1024 | core/translate/trigger.rs:562-578 | core/translate/view.rs:642-654 — before extracting anything, compare `core/translate/sequence.rs` and `core/translate/trigger.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 4) core/json/jsonb.rs:352— core/json/jsonb.rs:352-367 | core/json/jsonb.rs:431-445 | core/json/jsonb.rs:517-532 | core/json/jsonb.rs:598-613 — 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 (15–16 lines × 4) perf/tatp/sqlite_engine.rs:86— perf/tatp/sqlite_engine.rs:86-100 | perf/tatp/turso_engine.rs:108-122 | perf/throughput/sqlite_engine.rs:84-99 | perf/throughput/turso_engine.rs:55-69 — before extracting anything, compare `perf/tatp/sqlite_engine.rs` and `perf/tatp/turso_engine.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–13 lines × 4) core/translate/insert.rs:1214— core/translate/insert.rs:1214-1224 | core/translate/sequence.rs:135-147 | core/translate/sequence.rs:282-292 | core/translate/sequence.rs:556-566 — before extracting anything, compare `core/translate/insert.rs` and `core/translate/sequence.rs` as WHOLE FILES: this scan already matched 5 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 (11–13 lines × 4) REDACTED:437— REDACTED:437-449 | REDACTED:550-560 | REDACTED:613-623 | REDACTED:1037-1047 — 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 lines × 4) core/mvcc/persistent_storage/logical_log.rs:2753— core/mvcc/persistent_storage/logical_log.rs:2753-2764 | core/mvcc/persistent_storage/logical_log.rs:2868-2879 | core/mvcc/persistent_storage/logical_log.rs:3171-3182 | core/mvcc/persistent_storage/logical_log.rs:3305-3316 — 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 lines × 4) core/storage/encryption.rs:466— core/storage/encryption.rs:466-477 | core/storage/encryption.rs:481-492 | core/storage/encryption.rs:496-507 | core/storage/encryption.rs:516-527 — 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 × 2) core/incremental/vdbe_maintenance/aggregate.rs:317— core/incremental/vdbe_maintenance/aggregate.rs:317-326 | core/translate/trigger.rs:560-571 — 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–12 lines × 2) core/incremental/vdbe_maintenance/consolidate.rs:87— core/incremental/vdbe_maintenance/consolidate.rs:87-96 | core/incremental/vdbe_maintenance/set_op.rs:1024-1035 — 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 × 6) core/incremental/vdbe_maintenance.rs:247— core/incremental/vdbe_maintenance.rs:247-254 | core/incremental/vdbe_maintenance/aggregate.rs:172-179 | core/incremental/vdbe_maintenance/join.rs:533-540 | core/incremental/vdbe_maintenance/join.rs:783-790 | core/incremental/vdbe_maintenance/linear.rs:39-46 | core/incremental/vdbe_maintenance/linear.rs:391-398 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/join.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 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 × 6) postgres/cli/main.rs:327— postgres/cli/main.rs:327-334 | postgres/cli/main.rs:388-395 | postgres/cli/main.rs:419-426 | postgres/cli/main.rs:451-458 | postgres/cli/main.rs:487-494 | postgres/cli/main.rs:583-590 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6–8 lines × 2) core/vdbe/execute.rs:447— core/vdbe/execute.rs:447-454 | core/vdbe/execute.rs:1267-1272 — both copies are in the same file, so extract the block into 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–8 lines × 2) postgres/regress/describe.rs:267— postgres/regress/describe.rs:267-274 | postgres/regress/describe.rs:474-479 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 5) core/translate/expr/translator.rs:1266— core/translate/expr/translator.rs:1266-1271 | core/translate/expr/translator.rs:1630-1635 | core/translate/expr/translator.rs:1646-1652 | core/translate/expr/translator.rs:1663-1669 | core/translate/expr/translator.rs:2128-2134 — 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 (6 lines × 5) REDACTED:3580— REDACTED:3580-3585 | REDACTED:3727-3732 | REDACTED:3754-3759 | REDACTED:3784-3789 | REDACTED:3816-3821 — 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) REDACTED:359— REDACTED:359-365 | REDACTED:437-443 | REDACTED:550-556 | REDACTED:613-619 | REDACTED:1037-1043 — 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) scripts/corruption-debug-tools/find_corrupt_frame.py:134— scripts/corruption-debug-tools/find_corrupt_frame.py:134-140 | scripts/corruption-debug-tools/page_diff.py:37-43 | scripts/corruption-debug-tools/page_history.py:40-46 | scripts/corruption-debug-tools/track_rowid.py:39-45 | scripts/corruption-debug-tools/verify_stale.py:41-47 — 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 5 call sites, so a change lands once.
Duplicated block (8 lines × 4) scripts/corruption-debug-tools/page_diff.py:38— scripts/corruption-debug-tools/page_diff.py:38-45 | scripts/corruption-debug-tools/page_history.py:41-48 | scripts/corruption-debug-tools/track_rowid.py:40-47 | scripts/corruption-debug-tools/verify_stale.py:42-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (8 lines × 4) perf/memory/src/profile/insert.rs:40— perf/memory/src/profile/insert.rs:40-47 | perf/memory/src/profile/mixed.rs:78-85 | perf/memory/src/profile/read.rs:78-85 | perf/memory/src/profile/scan.rs:70-77 — before extracting anything, compare `perf/memory/src/profile/mixed.rs` and `perf/memory/src/profile/read.rs` as WHOLE FILES: this scan already matched 4 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. 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.
End-of-life runtime: .NET net9.0 bindings/dotnet/src/Turso.Tests/Turso.Tests.csproj:4— bindings/dotnet/src/Turso.Tests/Turso.Tests.csproj declares .NET net9.0 as this project's target framework, and .NET 9 STS, support ended 2026-05-12. An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-05-12 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.
End-of-life runtime: Rust 1.88 rust-toolchain.toml:1— rust-toolchain.toml declares Rust 1.88 as this project's toolchain file, and Rust 1.88, superseded by 1.89 on 2025-08-07 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2025-08-07 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.
P12 · CI test-gate honesty· CI test gate excludes suites by filter · ×2
CI test gate excludes suites by filter REDACTED:375— `yarn workspace @tursodatabase/sync test` drops 16 test(s) in 1 file(s) (e.g. `bindings/javascript/sync/packages/native/remote-write.test.ts`), and no other gate runs them before merge. Run what it excludes in another job before merge (a complementary selection), or remove the exclusion.
CI test gate excludes suites by filter REDACTED:434— `yarn workspace @tursodatabase/sync test` drops 16 test(s) in 1 file(s) (e.g. `bindings/javascript/sync/packages/native/remote-write.test.ts`), and no other gate runs them before merge. Run what it excludes in another job before merge (a complementary selection), or remove the exclusion.
Blocking `SqliteTransaction.Execute` inside an `async` method bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:165— `SqliteTransaction.Execute` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll).
Blocking `SqliteTransaction.Execute` inside an `async` method bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:350— `SqliteTransaction.Execute` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll).
Blocking `TursoSyncDatabase.ReleaseConnection` inside an `async` method bindings/dotnet/src/Turso.Data/TursoConnection.cs:542— `TursoSyncDatabase.ReleaseConnection` is a synchronous helper that blocks (`SemaphoreSlim.Wait`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll).
Blocking `TursoSyncDatabase.ReleaseConnection` inside an `async` method bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:140— `TursoSyncDatabase.ReleaseConnection` is a synchronous helper that blocks (`SemaphoreSlim.Wait`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll).
X2 · Cancellation propagation· Async method without CancellationToken · ×2
Async method without CancellationToken: CloseAsync bindings/dotnet/src/Turso.Serverless.Client/TursoServerlessConnection.cs:140— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: CloseAsync bindings/dotnet/src/Turso.Serverless.Client/TursoSession.cs:290— No CancellationToken parameter — this work can't be stopped early once started.
C1 · Data Protection· No data-protection/encryption · ×1
No data-protection/encryption — No data-protection or encryption usage (ASP.NET Data Protection, AES, column encryption, PBKDF2) was found — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.
Stmt::to_tokens (cyclomatic 112) sqlite/parser/src/ast/fmt.rs:248— Stmt::to_tokens has cyclomatic complexity 112 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SequenceCorrectnessProperty::finish_op (cyclomatic 92) testing/concurrent-simulator/properties.rs:1190— SequenceCorrectnessProperty::finish_op has cyclomatic complexity 92 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BTreeTable::to_sql (cyclomatic 68) core/schema.rs:4567— BTreeTable::to_sql has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
InitLoop::emit (cyclomatic 68) core/translate/main_loop/init.rs:40— InitLoop::emit has cyclomatic complexity 68 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Limbo::handle_dot_command (cyclomatic 58) REDACTED:799— Limbo::handle_dot_command 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.
turso_stress::async_main (cyclomatic 52) testing/stress/main.rs:609— turso_stress::async_main has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Scanner::feed_line (cyclomatic 42) postgres/regress/main.rs:1008— Scanner::feed_line has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
turso-sql-split.transition (cyclomatic 37) bindings/javascript/turso-sql-split.mjs:137— turso-sql-split.transition 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.
ShadowTablesMut::apply_snapshot (cyclomatic 36) REDACTED:688— ShadowTablesMut::apply_snapshot has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Session.batch (cyclomatic 36) serverless/javascript/src/session.ts:501— Session.batch has cyclomatic complexity 36 (threshold 15). Of this number, 27 points are the body's own statements and 9 belong to 5 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LimboColor::try_from (cyclomatic 35) cli/config/palette.rs:22— LimboColor::try_from has cyclomatic complexity 35 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ProgramState::end_statement (cyclomatic 35) core/vdbe/mod.rs:1766— ProgramState::end_statement 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.
promise.executeBatch (cyclomatic 35) bindings/javascript/packages/common/promise.ts:757— promise.executeBatch has cyclomatic complexity 35 (threshold 15). Most of this is not in the body itself: 15 of the 35 points are its own statements and the rest belongs to 3 function items inside it that branch (executeStatement, runRawSql, a function literal at line 787). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
page_diff.main (cyclomatic 34) scripts/corruption-debug-tools/page_diff.py:22— page_diff.main has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TursoSyncDb.handleIoItem (cyclomatic 34) bindings/go/driver_sync.go:456— TursoSyncDb.handleIoItem 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.
WalFile::checkpoint_inner (cyclomatic 32) core/storage/wal.rs:4952— WalFile::checkpoint_inner 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.
Lexer::next (cyclomatic 32) sqlite/parser/src/lexer.rs:225— Lexer::next has cyclomatic complexity 32 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ManagedSqliteStatementParser.Parse (cyclomatic 31) bindings/dotnet/src/Turso.Data.Sqlite/ManagedSqliteStatement.cs:16— ManagedSqliteStatementParser.Parse has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MultiprocessWhopper::perform_work (cyclomatic 31) testing/concurrent-simulator/multiprocess.rs:757— MultiprocessWhopper::perform_work has cyclomatic complexity 31 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CsvVTabModule::create (cyclomatic 30) extensions/csv/src/lib.rs:117— CsvVTabModule::create 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.
track_rowid.main (cyclomatic 30) scripts/corruption-debug-tools/track_rowid.py:26— track_rowid.main 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.
ImportFile::import_csv (cyclomatic 28) REDACTED:36— ImportFile::import_csv has cyclomatic complexity 28 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
OpenLoop::emit (cyclomatic 28) core/translate/main_loop/open.rs:55— OpenLoop::emit 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.
lib_sync._process_http_item (cyclomatic 28) REDACTED:108— lib_sync._process_http_item 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.
tursoDbConnection.executeFully (cyclomatic 28) bindings/go/driver_db.go:655— tursoDbConnection.executeFully 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.
CloseLoop::emit (cyclomatic 27) core/translate/main_loop/close.rs:14— CloseLoop::emit 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.
CliDatabaseInstance::run_sql (cyclomatic 27) testing/sqltest/src/backends/cli.rs:240— CliDatabaseInstance::run_sql 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.
page_history.main (cyclomatic 25) scripts/corruption-debug-tools/page_history.py:27— page_history.main 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.
turso-sql-split.nextToken (cyclomatic 25) bindings/javascript/turso-sql-split.mjs:56— turso-sql-split.nextToken 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.
TursoSession.BatchAsync (cyclomatic 23) bindings/dotnet/src/Turso.Serverless.Client/TursoSession.cs:135— TursoSession.BatchAsync 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.
MvccLazyCursor::seek (cyclomatic 23) core/mvcc/cursor.rs:1581— MvccLazyCursor::seek 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.
tursopg::handle_meta_command (cyclomatic 23) postgres/cli/main.rs:604— tursopg::handle_meta_command 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.
ColumnConstraint::to_tokens (cyclomatic 23) sqlite/parser/src/ast/fmt.rs:1776— ColumnConstraint::to_tokens 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: Operator::to_tokens (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
run.process (cyclomatic 23) bindings/javascript/sync/packages/common/run.ts:25— run.process 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.
Tokenizer::next (cyclomatic 22) postgres/cli/read_state_machine.rs:78— Tokenizer::next has cyclomatic complexity 22 (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. This is NOT this file's highest cyclomatic complexity: ReadState::transition (cyclomatic 45) 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.
Update::shadow (cyclomatic 22) REDACTED:1293— Update::shadow 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.
turso_serverless::batch::decode_batch_result (cyclomatic 21) serverless/rust/batch.rs:290— turso_serverless::batch::decode_batch_result 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.
Expression::fmt (cyclomatic 21) testing/differential-oracle/sql_gen_prop/expression.rs:230— Expression::fmt 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.
page_info.main (cyclomatic 21) scripts/corruption-debug-tools/page_info.py:28— page_info.main 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.
tursoDbRows.Next (cyclomatic 21) bindings/go/driver_db.go:512— tursoDbRows.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.
cursorDecoder.feed (cyclomatic 21) serverless/go/session.go:220— cursorDecoder.feed 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.
Database.batch (cyclomatic 21) bindings/javascript/packages/common/compat.ts:288— Database.batch 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.
IncrementalView::referenced_table_names (cyclomatic 20) core/incremental/view.rs:747— IncrementalView::referenced_table_names has cyclomatic complexity 20 (threshold 15). Most of this is not in the body itself: 1 of the 20 points is its own statement and the rest belongs to 3 function items inside it that branch (collect_one, collect_source, collect_select). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SeqCompactDriver::step (cyclomatic 20) core/mvcc/database/checkpoint_state_machine.rs:625— SeqCompactDriver::step 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.
ElleHistoryRecorder::finish_op (cyclomatic 20) testing/concurrent-simulator/properties.rs:642— ElleHistoryRecorder::finish_op 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.
protocol.executeCursor (cyclomatic 20) serverless/javascript/src/protocol.ts:294— protocol.executeCursor has cyclomatic complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ManagedSqliteStatementParser.TryReadParameter (cyclomatic 19) bindings/dotnet/src/Turso.Data.Sqlite/ManagedSqliteStatement.cs:161— ManagedSqliteStatementParser.TryReadParameter has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
SqliteDataReader.GetSchemaTable (cyclomatic 19) REDACTED:530— SqliteDataReader.GetSchemaTable 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.
IoWorker::process_http (cyclomatic 19) bindings/rust/src/sync.rs:818— IoWorker::process_http 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.
LogicalLog::frame_and_pwrite_tx (cyclomatic 19) core/mvcc/persistent_storage/logical_log.rs:675— LogicalLog::frame_and_pwrite_tx 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.
PreparedHashBuild::emit (cyclomatic 19) core/translate/main_loop/hash.rs:230— PreparedHashBuild::emit 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.
UpdatePlan::fmt (cyclomatic 19) core/translate/display.rs:335— UpdatePlan::fmt 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.
InteractionPlan::remove_properties (cyclomatic 19) testing/simulator/shrink/plan.rs:204— InteractionPlan::remove_properties 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.
release-status.main (cyclomatic 19) scripts/release-status.py:159— release-status.main 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.
docker-entrypoint.sqlancer.main (cyclomatic 19) testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.ts:510— docker-entrypoint.sqlancer.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.
SqliteCommand.SplitStatements (cyclomatic 18) bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:857— SqliteCommand.SplitStatements has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: SqliteCommand.GetRemoteSqliteErrorCodes (cyclomatic 66) 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.
ShmWalCoordination::try_begin_read_tx (cyclomatic 18) core/storage/wal.rs:2070— ShmWalCoordination::try_begin_read_tx 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.
DatabaseReplaySession::replay (cyclomatic 18) REDACTED:627— DatabaseReplaySession::replay 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.
UpdateStmt::fmt (cyclomatic 18) testing/differential-oracle/sql_gen/src/ast.rs:1042— UpdateStmt::fmt has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: BinOp::fmt (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
CoverageReport::fmt (cyclomatic 18) testing/differential-oracle/sql_gen/src/trace.rs:451— CoverageReport::fmt has cyclomatic complexity 18 (threshold 15). Of this number, 15 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
JsDatabaseInstance::run_sql (cyclomatic 18) testing/sqltest/src/backends/js.rs:137— JsDatabaseInstance::run_sql 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.
PrettyOutput::write_summary (cyclomatic 18) testing/sqltest/src/output/pretty.rs:126— PrettyOutput::write_summary 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.
diff_to_targeted_coverage.squash (cyclomatic 18) scripts/antithesis/diff_to_targeted_coverage.py:29— diff_to_targeted_coverage.squash 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.
record.parse_record (cyclomatic 18) scripts/corruption-debug-tools/lib/record.py:114— record.parse_record 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.
update-version.update_package_json (cyclomatic 18) scripts/update-version.py:134— update-version.update_package_json 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.
TursoSqliteRelationalConnection.InitializeTursoConnection (cyclomatic 17) bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Storage/Internal/TursoSqliteRelationalConnection.cs:61— TursoSqliteRelationalConnection.InitializeTursoConnection has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 3 of the 17 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 71, 93, 122, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
SyncEngine::new (cyclomatic 17) bindings/javascript/sync/src/lib.rs:219— SyncEngine::new 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.
FtsIndexAttachment::new (cyclomatic 17) REDACTED:611— FtsIndexAttachment::new 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.
JsonVirtualTable::best_index (cyclomatic 17) core/json/vtab.rs:83— JsonVirtualTable::best_index has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WriteRowStateMachine::step (cyclomatic 17) REDACTED:3826— WriteRowStateMachine::step has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: CommitState::fmt (cyclomatic 19) 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.
Index::validate_where_expr (cyclomatic 17) core/schema.rs:7281— Index::validate_where_expr 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.
PgDependTable::load_rows (cyclomatic 17) REDACTED:2576— PgDependTable::load_rows has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: turso_pg::catalog::sqlite_type_to_pg_oid (cyclomatic 24) 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.
DatabaseReplayGenerator::execute_ddl_idempotent (cyclomatic 17) sync/engine/src/database_replay_generator.rs:736— DatabaseReplayGenerator::execute_ddl_idempotent 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.
sql_gen_prop::cte::recursive_cte_definition (cyclomatic 17) testing/differential-oracle/sql_gen_prop/cte.rs:410— sql_gen_prop::cte::recursive_cte_definition 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.
SimulatorEnv::new (cyclomatic 17) REDACTED:1422— SimulatorEnv::new 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.
limbo_sim::run_simulator (cyclomatic 17) testing/simulator/main.rs:157— limbo_sim::run_simulator 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.
JDBC4PreparedStatement.setObject (cyclomatic 17) bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:275— JDBC4PreparedStatement.setObject 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.
session.executeStmt (cyclomatic 17) serverless/go/session.go:283— session.executeStmt 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.
SqliteDataReader.GetFieldValue (cyclomatic 16) REDACTED:354— SqliteDataReader.GetFieldValue 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.
TursoSqliteCommandInterceptor.TrySkipTriviaOrString (cyclomatic 16) bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Storage/Internal/TursoSqliteRelationalConnection.cs:313— TursoSqliteCommandInterceptor.TrySkipTriviaOrString has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
InProcessWalCoordination::try_begin_read_tx (cyclomatic 16) core/storage/wal.rs:1023— InProcessWalCoordination::try_begin_read_tx 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.
Time::time_date (cyclomatic 16) core/time/internal.rs:191— Time::time_date 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. This is NOT this file's highest cyclomatic complexity: Time::time_get (cyclomatic 19) 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.
GraceHashLoop::emit (cyclomatic 16) core/translate/main_loop/hash.rs:1213— GraceHashLoop::emit 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.
EmitOrderBy::sorter_insert (cyclomatic 16) core/translate/order_by.rs:473— EmitOrderBy::sorter_insert 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.
SortedChunk::next (cyclomatic 16) core/vdbe/sorter.rs:691— SortedChunk::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.
Vector::from_data_with_dims (cyclomatic 16) core/vector/vector_types.rs:285— Vector::from_data_with_dims 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.
AlterTable::shadow (cyclomatic 16) REDACTED:1428— AlterTable::shadow 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. This is NOT this file's highest cyclomatic complexity: Query::fmt (cyclomatic 22) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
JDBC4DatabaseMetaData.getTables (cyclomatic 16) bindings/java/src/main/java/tech/turso/jdbc4/JDBC4DatabaseMetaData.java:713— JDBC4DatabaseMetaData.getTables 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.
lib._first_keyword (cyclomatic 16) bindings/python/turso/lib.py:134— lib._first_keyword has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
dbapi._first_keyword (cyclomatic 16) serverless/python/turso_serverless/dbapi.py:52— dbapi._first_keyword has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
ioProcessor.processHttpRequest (cyclomatic 16) bindings/react-native/src/internal/ioProcessor.ts:156— ioProcessor.processHttpRequest 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.
LibSQLClient.transaction (cyclomatic 16) serverless/javascript/src/compat.ts:381— LibSQLClient.transaction has cyclomatic complexity 16 (threshold 15). Most of this is not in the body itself: 3 of the 16 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 429, a function literal at line 436, ensureOpen, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
No assertions: ReplicaFacadePropagatesItsEffectivePoolingDefault bindings/dotnet/src/Turso.Tests/SqliteManagedExecutionTests.cs:14— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
HackComment bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:387— // HACK: currently the only way to project multiple values from a SelectExpression is to simulate a Select out to an anonymous — a workaround marked in source: record what it is compensating for and what would allow its removal (the upstream fix, the API it is waiting on, the invariant it restores), so the next reader can judge whether it is still needed rather than rediscovering why it is there.
Stmt::to_tokens (cognitive 178) sqlite/parser/src/ast/fmt.rs:248— Stmt::to_tokens has cognitive complexity 178 (threshold 15). Drivers by points: if/else 73 (161 pts), loops 5 (14 pts), match/switch 2 (3 pts) (nesting depth added 98). 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.
InitLoop::emit (cognitive 175) core/translate/main_loop/init.rs:40— InitLoop::emit has cognitive complexity 175 (threshold 15). Drivers by points: if/else 31 (113 pts), match/switch 11 (35 pts), loops 10 (23 pts), boolean chains 4 (nesting depth added 119). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso_stress::async_main (cognitive 119) testing/stress/main.rs:609— turso_stress::async_main has cognitive complexity 119 (threshold 15). Drivers by points: if/else 31 (75 pts), loops 11 (29 pts), match/switch 4 (10 pts), boolean chains 5 (nesting depth added 68). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner::feed_line (cognitive 81) postgres/regress/main.rs:1008— Scanner::feed_line has cognitive complexity 81 (threshold 15). Drivers by points: if/else 29 (68 pts), boolean chains 10, match/switch 1 (2 pts), loops 1 (nesting depth added 40). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tursoDbConnection.executeFully (cognitive 80) bindings/go/driver_db.go:655— tursoDbConnection.executeFully has cognitive complexity 80 (threshold 15). Drivers by points: if/else 19 (72 pts), loops 2 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OpenLoop::emit (cognitive 71) core/translate/main_loop/open.rs:55— OpenLoop::emit has cognitive complexity 71 (threshold 15). Drivers by points: if/else 25 (66 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 42). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TursoSyncDb.handleIoItem (cognitive 67) bindings/go/driver_sync.go:456— TursoSyncDb.handleIoItem has cognitive complexity 67 (threshold 15). Drivers by points: if/else 24 (57 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 36). 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.
CloseLoop::emit (cognitive 64) core/translate/main_loop/close.rs:14— CloseLoop::emit has cognitive complexity 64 (threshold 15). Drivers by points: if/else 20 (50 pts), loops 4 (7 pts), match/switch 2 (5 pts), boolean chains 2 (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.
page_diff.main (cognitive 57) scripts/corruption-debug-tools/page_diff.py:22— page_diff.main has cognitive complexity 57 (threshold 15). Drivers by points: if/else 19 (29 pts), loops 5 (14 pts), boolean chains 9, ternaries 3 (5 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.
CsvVTabModule::create (cognitive 55) extensions/csv/src/lib.rs:117— CsvVTabModule::create has cognitive complexity 55 (threshold 15). Drivers by points: if/else 18 (41 pts), loops 4 (9 pts), boolean chains 3, match/switch 1 (2 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.
ManagedSqliteStatementParser.Parse (cognitive 53) bindings/dotnet/src/Turso.Data.Sqlite/ManagedSqliteStatement.cs:16— ManagedSqliteStatementParser.Parse has cognitive complexity 53 (threshold 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.
docker-entrypoint.sqlancer.main (cognitive 52) testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.ts:510— docker-entrypoint.sqlancer.main has cognitive complexity 52 (threshold 15). Drivers by points: if/else 13 (41 pts), error handling 3 (7 pts), boolean chains 2, loops 2 (nesting depth added 32). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ImportFile::import_csv (cognitive 49) REDACTED:36— ImportFile::import_csv has cognitive complexity 49 (threshold 15). Drivers by points: match/switch 9 (23 pts), if/else 11 (22 pts), loops 3 (4 pts) (nesting depth added 26). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
UpdatePlan::fmt (cognitive 49) core/translate/display.rs:335— UpdatePlan::fmt has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (38 pts), match/switch 3 (8 pts), loops 2 (3 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortedChunk::next (cognitive 48) core/vdbe/sorter.rs:691— SortedChunk::next has cognitive complexity 48 (threshold 15). Drivers by points: if/else 9 (34 pts), match/switch 2 (7 pts), loops 2 (5 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.
track_rowid.main (cognitive 47) scripts/corruption-debug-tools/track_rowid.py:26— track_rowid.main has cognitive complexity 47 (threshold 15). Drivers by points: if/else 16 (25 pts), ternaries 5 (12 pts), loops 5 (7 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiprocessWhopper::perform_work (cognitive 46) testing/concurrent-simulator/multiprocess.rs:757— MultiprocessWhopper::perform_work has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (32 pts), boolean chains 5, loops 3 (5 pts), match/switch 3 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso-sql-split.nextToken (cognitive 44) bindings/javascript/turso-sql-split.mjs:56— turso-sql-split.nextToken has cognitive complexity 44 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 5 (13 pts), boolean chains 8, ternaries 1 (3 pts) (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page_history.main (cognitive 43) scripts/corruption-debug-tools/page_history.py:27— page_history.main has cognitive complexity 43 (threshold 15). Drivers by points: if/else 15 (29 pts), ternaries 6 (9 pts), boolean chains 4, 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.
run.process (cognitive 42) bindings/javascript/sync/packages/common/run.ts:25— run.process has cognitive complexity 42 (threshold 15). Drivers by points: if/else 16 (26 pts), loops 3 (7 pts), error handling 3 (6 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lib_sync._process_http_item (cognitive 41) REDACTED:108— lib_sync._process_http_item has cognitive complexity 41 (threshold 15). Drivers by points: if/else 11 (18 pts), error handling 9 (16 pts), loops 3 (4 pts), boolean chains 2, ternaries 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.
TursoSession.BatchAsync (cognitive 40) bindings/dotnet/src/Turso.Serverless.Client/TursoSession.cs:135— TursoSession.BatchAsync has cognitive complexity 40 (threshold 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.
CliDatabaseInstance::run_sql (cognitive 40) testing/sqltest/src/backends/cli.rs:240— CliDatabaseInstance::run_sql has cognitive complexity 40 (threshold 15). Drivers by points: if/else 22 (30 pts), boolean chains 8, loops 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tursoDbRows.Next (cognitive 40) bindings/go/driver_db.go:512— tursoDbRows.Next has cognitive complexity 40 (threshold 15). Drivers by points: if/else 10 (29 pts), match/switch 2 (6 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
page_info.main (cognitive 39) scripts/corruption-debug-tools/page_info.py:28— page_info.main has cognitive complexity 39 (threshold 15). Drivers by points: if/else 20 (33 pts), loops 2 (4 pts), boolean chains 1, ternaries 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.
IoWorker::process_http (cognitive 38) bindings/rust/src/sync.rs:818— IoWorker::process_http has cognitive complexity 38 (threshold 15). Drivers by points: if/else 12 (27 pts), match/switch 5 (7 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 18). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
SeqCompactDriver::step (cognitive 38) core/mvcc/database/checkpoint_state_machine.rs:625— SeqCompactDriver::step has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 5 (12 pts), loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session.batch (cognitive 38) serverless/javascript/src/session.ts:501— Session.batch has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 8, ternaries 3 (5 pts), loops 2 (3 pts), error handling 2 (nesting depth added 6). Of this number, 31 points are the body's own statements and 7 belong to 5 function items inside it that branch. 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.
diff_to_targeted_coverage.squash (cognitive 37) scripts/antithesis/diff_to_targeted_coverage.py:29— diff_to_targeted_coverage.squash has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (24 pts), ternaries 3 (10 pts), boolean chains 2, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Database.batch (cognitive 37) bindings/javascript/packages/common/compat.ts:288— Database.batch has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (19 pts), ternaries 4 (9 pts), error handling 2 (4 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ElleHistoryRecorder::finish_op (cognitive 36) testing/concurrent-simulator/properties.rs:642— ElleHistoryRecorder::finish_op has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (35 pts), match/switch 1 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Tokenizer::next (cognitive 35) postgres/cli/read_state_machine.rs:78— Tokenizer::next has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (8 pts), match/switch 2 (6 pts), boolean chains 5 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatabaseReplaySession::replay (cognitive 35) REDACTED:627— DatabaseReplaySession::replay has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 4 (11 pts), loops 1 (4 pts), boolean chains 1 (nesting depth added 20). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
CoverageReport::fmt (cognitive 35) testing/differential-oracle/sql_gen/src/trace.rs:451— CoverageReport::fmt has cognitive complexity 35 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 5 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 13). Of this number, 28 points are the body's own statements and 7 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cursorDecoder.feed (cognitive 34) serverless/go/session.go:220— cursorDecoder.feed has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 2 (5 pts), boolean chains 3, match/switch 1 (nesting depth added 17). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PrettyOutput::write_summary (cognitive 33) testing/sqltest/src/output/pretty.rs:126— PrettyOutput::write_summary has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 4 (14 pts), match/switch 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeltaCursor::load_next_batch (cognitive 32) core/incremental/vdbe_maintenance/delta_cursor.rs:103— DeltaCursor::load_next_batch has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (30 pts), boolean chains 1, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ColumnConstraint::to_tokens (cognitive 31) sqlite/parser/src/ast/fmt.rs:1776— ColumnConstraint::to_tokens has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 4 (8 pts) (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
protocol.executeCursor (cognitive 31) serverless/javascript/src/protocol.ts:294— protocol.executeCursor has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (20 pts), error handling 4 (6 pts), loops 4 (5 pts) (nesting depth added 12). Of this number, 17 points are the body's own statements and 14 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PgConstraintTable::load_rows (cognitive 30) REDACTED:1642— PgConstraintTable::load_rows has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 6 (10 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PgDependTable::load_rows (cognitive 30) REDACTED:2576— PgDependTable::load_rows has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 7 (12 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqliteDataReader.GetSchemaTable (cognitive 29) REDACTED:530— SqliteDataReader.GetSchemaTable has cognitive complexity 29 (threshold 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.
PreparedHashBuild::emit (cognitive 29) core/translate/main_loop/hash.rs:230— PreparedHashBuild::emit has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (17 pts), loops 4 (7 pts), match/switch 2 (5 pts) (nesting depth added 9). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
DeletePlan::fmt (cognitive 29) core/translate/display.rs:236— DeletePlan::fmt has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 3 (8 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TursoDatabase::open (cognitive 29) sdk-kit/src/rsapi.rs:966— TursoDatabase::open has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 2 (5 pts), boolean chains 2, 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.
wal_commits.main (cognitive 29) scripts/corruption-debug-tools/wal_commits.py:20— wal_commits.main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (17 pts), loops 3 (6 pts), ternaries 2 (6 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogicalLog::frame_and_pwrite_tx (cognitive 28) core/mvcc/persistent_storage/logical_log.rs:675— LogicalLog::frame_and_pwrite_tx has cognitive complexity 28 (threshold 15). Drivers by points: if/else 22 (26 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.
EqpDetail::fmt (cognitive 28) core/translate/eqp.rs:310— EqpDetail::fmt has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (21 pts), match/switch 4 (7 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
turso_serverless::batch::decode_batch_result (cognitive 28) serverless/rust/batch.rs:290— turso_serverless::batch::decode_batch_result has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 2 (3 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RecursiveRefCounter::count_one_select (cognitive 27) core/translate/planner.rs:215— RecursiveRefCounter::count_one_select has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (10 pts), match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
verify_stale.main (cognitive 27) scripts/corruption-debug-tools/verify_stale.py:25— verify_stale.main has cognitive complexity 27 (threshold 15). Drivers by points: if/else 13 (21 pts), ternaries 2 (5 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.
update-version.update_package_json (cognitive 27) scripts/update-version.py:134— update-version.update_package_json has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 2 (4 pts), error handling 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GraceHashLoop::emit (cognitive 26) core/translate/main_loop/hash.rs:1213— GraceHashLoop::emit has cognitive complexity 26 (threshold 15). Drivers by points: if/else 16 (26 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.
UpdateStmt::fmt (cognitive 26) testing/differential-oracle/sql_gen/src/ast.rs:1042— UpdateStmt::fmt has cognitive complexity 26 (threshold 15). Drivers by points: if/else 14 (21 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.
SegmentClaimer::step (cognitive 25) core/index_method/fts/rows.rs:390— SegmentClaimer::step has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 4 (11 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.
promise.executeBatch (cognitive 25) bindings/javascript/packages/common/promise.ts:757— promise.executeBatch has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (26 pts), ternaries 7 (10 pts), error handling 5 (8 pts), loops 4 (5 pts), boolean chains 3 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (promise.executeBatch::executeStatement) 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.
SqliteCommand.SplitStatements (cognitive 24) bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:857— SqliteCommand.SplitStatements has cognitive complexity 24 (threshold 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.
FtsWorkloadProfile::generate (cognitive 24) testing/concurrent-simulator/fts.rs:80— FtsWorkloadProfile::generate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
session.executeStmt (cognitive 24) serverless/go/session.go:283— session.executeStmt has cognitive complexity 24 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WriteRowStateMachine::step (cognitive 23) REDACTED:3826— WriteRowStateMachine::step has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 7 (11 pts), if/else 5 (9 pts), boolean chains 3 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
JsDatabaseInstance::run_sql (cognitive 23) testing/sqltest/src/backends/js.rs:137— JsDatabaseInstance::run_sql has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 6 (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.
RowDeleter::step (cognitive 22) core/index_method/fts/rows.rs:288— RowDeleter::step has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Time::time_date (cognitive 22) core/time/internal.rs:191— Time::time_date has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 9 (14 pts), if/else 8 (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.
JDBC4DatabaseMetaData.getTables (cognitive 22) bindings/java/src/main/java/tech/turso/jdbc4/JDBC4DatabaseMetaData.java:713— JDBC4DatabaseMetaData.getTables has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lib._first_keyword (cognitive 22) bindings/python/turso/lib.py:134— lib._first_keyword has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, loops 4 (8 pts), if/else 3 (6 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.
release-status.main (cognitive 22) scripts/release-status.py:159— release-status.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12, loops 2 (4 pts), ternaries 4, 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.
dbapi._first_keyword (cognitive 22) serverless/python/turso_serverless/dbapi.py:52— dbapi._first_keyword has cognitive complexity 22 (threshold 15). Drivers by points: boolean chains 8, loops 4 (8 pts), if/else 3 (6 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.
ioProcessor.processHttpRequest (cognitive 22) bindings/react-native/src/internal/ioProcessor.ts:156— ioProcessor.processHttpRequest has cognitive complexity 22 (threshold 15). Drivers by points: ternaries 5 (10 pts), if/else 8 (9 pts), boolean chains 2, 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.
SqliteBatch.BuildBatch (cognitive 21) bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:281— SqliteBatch.BuildBatch has cognitive complexity 21 (threshold 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.
SqliteCommand.AddManagedParameters (cognitive 21) bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:533— SqliteCommand.AddManagedParameters has cognitive complexity 21 (threshold 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.
SqliteConnection.TryReadIdentifier (cognitive 21) REDACTED:1014— SqliteConnection.TryReadIdentifier has cognitive complexity 21 (threshold 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.
TursoCommand.PrepareCore (cognitive 21) bindings/dotnet/src/Turso.Data/TursoCommand.cs:158— TursoCommand.PrepareCore has cognitive complexity 21 (threshold 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.
ResultSetColumn::name (cognitive 21) core/translate/plan.rs:122— ResultSetColumn::name has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JoinedTable::apply_expression_index_coverage (cognitive 21) core/translate/plan.rs:3334— JoinedTable::apply_expression_index_coverage has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 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.
Vector::from_data_with_dims (cognitive 21) core/vector/vector_types.rs:285— Vector::from_data_with_dims has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 3, loops 1 (2 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
GTValue::arbitrary_from (cognitive 21) sql_generation/generation/value/cmp.rs:65— GTValue::arbitrary_from has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (3 pts), boolean chains 1, 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.
TriggerCmd::to_tokens (cognitive 21) sqlite/parser/src/ast/fmt.rs:2325— TriggerCmd::to_tokens has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (20 pts), 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.
FtsIndexAttachment::new (cognitive 20) REDACTED:611— FtsIndexAttachment::new has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 4, match/switch 3 (4 pts), loops 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
JsonEachCursor::advance (cognitive 20) core/json/vtab.rs:342— JsonEachCursor::advance has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GeneratedColGraph::build (cognitive 20) core/schema.rs:4211— GeneratedColGraph::build has cognitive complexity 20 (threshold 15). Drivers by points: loops 8 (12 pts), if/else 4 (8 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Index::validate_where_expr (cognitive 20) core/schema.rs:7281— Index::validate_where_expr has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InProcessWalCoordination::try_begin_read_tx (cognitive 20) core/storage/wal.rs:1023— InProcessWalCoordination::try_begin_read_tx has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimValue::apply_affinity (cognitive 20) sql_generation/model/table.rs:362— SimValue::apply_affinity has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), boolean chains 2, 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.
SimpleKeysDoNotDisappear::finish_op (cognitive 20) testing/concurrent-simulator/properties.rs:101— SimpleKeysDoNotDisappear::finish_op has cognitive complexity 20 (threshold 15). Drivers by points: if/else 12 (16 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowFunctionExpr::fmt (cognitive 20) testing/differential-oracle/sql_gen/src/ast.rs:2263— WindowFunctionExpr::fmt has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3 (5 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.
turso.bindArgs (cognitive 20) bindings/go/driver_db.go:737— turso.bindArgs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 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.
TursoSqliteRelationalConnection.InitializeTursoConnection (cognitive 19) bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Storage/Internal/TursoSqliteRelationalConnection.cs:61— TursoSqliteRelationalConnection.InitializeTursoConnection has cognitive complexity 19 (threshold 15). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 9 function literals inside it that branch (lines 122, 132, 142, …). The decisions are inside those literals, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literals' work into a named function or method at the enclosing scope and have each literal call it, then reduce whichever part then reads as the largest.
JsonVirtualTable::best_index (cognitive 19) core/json/vtab.rs:83— JsonVirtualTable::best_index has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 3 (4 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PageCache::_insert (cognitive 19) core/storage/page_cache.rs:256— PageCache::_insert has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (16 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.
BuildSharedWal::poll (cognitive 19) core/storage/sqlite3_ondisk.rs:1623— BuildSharedWal::poll has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimulatorEnv::new (cognitive 19) REDACTED:1422— SimulatorEnv::new has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (16 pts), match/switch 2, 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.
RustDatabaseInstance::execute_query (cognitive 19) testing/sqltest/src/backends/rust.rs:212— RustDatabaseInstance::execute_query has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (10 pts), if/else 2 (7 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.
SnapshotManager::compare (cognitive 19) testing/sqltest/src/snapshot/mod.rs:390— SnapshotManager::compare has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 3 (6 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.
turso.parseDSN (cognitive 19) bindings/go/driver_db.go:620— turso.parseDSN has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 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.
LibSQLClient.transaction (cognitive 19) serverless/javascript/src/compat.ts:381— LibSQLClient.transaction has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (8 pts), error handling 6, ternaries 2 (5 pts) (nesting depth added 4). Most of this is not in the body itself: 2 of the 19 points are its own statements and the rest belongs to 9 function items inside it that branch (a function literal at line 429, a function literal at line 436, ensureOpen, …). The named helpers are already separate functions; the literals' work cannot be called, reviewed or tested from outside this body. To reduce it, move the named helpers out of the body to the enclosing scope and lift each literal's work into a named function there, so each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
Statement.iterate (cognitive 19) serverless/javascript/src/statement.ts:259— Statement.iterate has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManagedSqliteStatementParser.TryReadParameter (cognitive 18) bindings/dotnet/src/Turso.Data.Sqlite/ManagedSqliteStatement.cs:161— ManagedSqliteStatementParser.TryReadParameter has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SqliteDataReader.NextResult (cognitive 18) REDACTED:722— SqliteDataReader.NextResult has cognitive complexity 18 (threshold 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.
turso_node::connect_sync (cognitive 18) bindings/javascript/src/lib.rs:293— turso_node::connect_sync has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (18 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
DatabaseFile::read_page (cognitive 18) core/storage/database.rs:147— DatabaseFile::read_page has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 5 (8 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.
PageInner::_cell_get_raw_region_faster (cognitive 18) core/storage/pager.rs:785— PageInner::_cell_get_raw_region_faster has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompoundPredicate::from_table_binary (cognitive 18) sql_generation/generation/predicate/binary.rs:371— CompoundPredicate::from_table_binary has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (18 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.
AlterTable::shadow (cognitive 18) REDACTED:1428— AlterTable::shadow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (5 pts), match/switch 4 (5 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.
SelectInner::shadow (cognitive 18) REDACTED:1135— SelectInner::shadow has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (4 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Table::arbitrary_with_columns (cognitive 18) sql_generation/generation/table.rs:24— Table::arbitrary_with_columns has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (4 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TursoDatabaseSyncConfig::from_capi (cognitive 18) sync/sdk-kit/src/rsapi.rs:59— TursoDatabaseSyncConfig::from_capi 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.
tursoDbConnection.ExecContext (cognitive 18) bindings/go/driver_db.go:221— tursoDbConnection.ExecContext has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso.decodeValue (cognitive 18) serverless/go/protocol.go:98— turso.decodeValue has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Session.trackAutocommit (cognitive 18) serverless/javascript/src/session.ts:286— Session.trackAutocommit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), boolean chains 6, 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.
Session.processCursorEntries (cognitive 18) serverless/javascript/src/session.ts:393— Session.processCursorEntries has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqliteConnection.Dispose (cognitive 17) REDACTED:545— SqliteConnection.Dispose has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SqliteConnection.NormalizeUriDataSource (cognitive 17) REDACTED:1120— SqliteConnection.NormalizeUriDataSource has cognitive complexity 17 (threshold 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.
turso::batch::first_sql_keyword (cognitive 17) bindings/rust/src/batch.rs:81— turso::batch::first_sql_keyword has cognitive complexity 17 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 3 (6 pts), boolean chains 1 (nesting depth added 8). 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.
JsonbHeader::from_slice (cognitive 17) core/json/jsonb.rs:816— JsonbHeader::from_slice has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 6 (15 pts), if/else 1 (2 pts) (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
HashProbeSetupEmitter::install_context (cognitive 17) core/translate/main_loop/hash.rs:788— HashProbeSetupEmitter::install_context has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 1 (3 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompletionCursor::filter (cognitive 17) extensions/completion/src/lib.rs:177— CompletionCursor::filter has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, loops 1 (2 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.
RegisterExtensionInput::parse (cognitive 17) macros/src/ext/mod.rs:134— RegisterExtensionInput::parse has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 1 (4 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
OneSelect::to_tokens (cognitive 17) sqlite/parser/src/ast/fmt.rs:1331— OneSelect::to_tokens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts), 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.
sql_gen_prop::cte::recursive_cte_definition (cognitive 17) testing/differential-oracle/sql_gen_prop/cte.rs:410— sql_gen_prop::cte::recursive_cte_definition has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 3 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
JDBC4PreparedStatement.setObject (cognitive 17) bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java:275— JDBC4PreparedStatement.setObject has cognitive complexity 17 (threshold 15). Drivers by points: if/else 16, boolean chains 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TursoServer.create (cognitive 17) bindings/javascript/sync/packages/native/turso-server.ts:88— TursoServer.create has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (5 pts), error handling 1 (4 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
turso-sql-split.transition (cognitive 17) bindings/javascript/turso-sql-split.mjs:137— turso-sql-split.transition has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 9 (17 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.
protocol.encodeValue (cognitive 17) serverless/javascript/src/protocol.ts:124— protocol.encodeValue has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SqliteCommand.Execute (cognitive 16) bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:269— SqliteCommand.Execute has cognitive complexity 16 (threshold 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.
SqliteDataReader.GetFieldValue (cognitive 16) REDACTED:354— SqliteDataReader.GetFieldValue has cognitive complexity 16 (threshold 15). 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.
IncrementalView::referenced_table_names::collect_one (cognitive 16) core/incremental/view.rs:776— IncrementalView::referenced_table_names::collect_one has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 4 (6 pts), match/switch 1 (2 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.
UnixFile::pwritev (cognitive 16) core/io/unix.rs:386— UnixFile::pwritev has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GenerateSeriesTable::best_index (cognitive 16) core/series.rs:58— GenerateSeriesTable::best_index has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 2, 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.
WalFileShared::open_shared_from_authority_if_exists (cognitive 16) core/storage/wal.rs:5792— WalFileShared::open_shared_from_authority_if_exists has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (11 pts), boolean chains 2, match/switch 2, loops 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Repl::run_interactive (cognitive 16) postgres/cli/main.rs:929— Repl::run_interactive has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LineReader::next_line (cognitive 16) serverless/rust/session.rs:90— LineReader::next_line has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FromClause::shadow (cognitive 16) REDACTED:1075— FromClause::shadow has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 1 (5 pts), match/switch 2 (3 pts) (nesting depth added 10). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
InsertStmt::fmt (cognitive 16) testing/differential-oracle/sql_gen/src/ast.rs:980— InsertStmt::fmt has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lib_sync._run_op (cognitive 16) REDACTED:323— lib_sync._run_op has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 3, error handling 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.
compare-divan-std-turso.paired_rows (cognitive 16) scripts/compare-divan-std-turso.py:139— compare-divan-std-turso.paired_rows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 3, loops 2 (3 pts), ternaries 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
record.parse_record (cognitive 16) scripts/corruption-debug-tools/lib/record.py:114— record.parse_record has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), error handling 1 (3 pts), loops 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Session._post (cognitive 16) REDACTED:178— Session._post has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (8 pts), error handling 4 (5 pts), loops 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
promise.executeBatch::executeStatement (cognitive 16) bindings/javascript/packages/common/promise.ts:817— promise.executeBatch::executeStatement has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), ternaries 5 (6 pts), error handling 1, loops 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (promise.executeBatch) 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.
args.encodeSqlArgs (cognitive 16) serverless/javascript/src/args.ts:52— args.encodeSqlArgs has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (6 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.
docker-entrypoint.simulator.run (cognitive 16) testing/simulator/simulator-docker-runner/docker-entrypoint.simulator.ts:77— docker-entrypoint.simulator.run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (8 pts), boolean chains 3, error handling 2 (3 pts), ternaries 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
logParse.extractExceptionInfo (cognitive 16) REDACTED:211— logParse.extractExceptionInfo has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
docker-entrypoint.sqlancer.applyPatches (cognitive 16) testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.ts:341— docker-entrypoint.sqlancer.applyPatches has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), error handling 1 (2 pts), boolean chains 1 (nesting depth added 2). Of this number, 14 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
D4 · Code Duplication· Near-duplicate member family (6 members, 14 shared lines) · ×1
Near-duplicate member family (6 members, 14 shared lines) postgres/cli/main.rs:312— postgres/cli/main.rs:312-345 | postgres/cli/main.rs:374-406 | postgres/cli/main.rs:408-437 | postgres/cli/main.rs:439-469 | postgres/cli/main.rs:471-505 | postgres/cli/main.rs:568-601 — These 6 members are variants of one another: a block of 14 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 (3 members, 49 shared lines) · ×1
Near-duplicate member family (3 members, 49 shared lines) cli/read_state_machine.rs:131— cli/read_state_machine.rs:131-197 | postgres/cli/read_state_machine.rs:166-232 | testing/sqltest/src/parser/sql_complete.rs:125-191 — These 3 members are variants of one another: a block of 49 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (110 shared lines) core/translate/expr/walk.rs:13— core/translate/expr/walk.rs:13-191 | core/translate/expr/walk.rs:347-526 — These two members are variants of one another: 110 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 (100 shared lines) core/translate/fkeys.rs:1126— core/translate/fkeys.rs:1126-1474 | core/translate/insert.rs:3984-4209 — These two members are variants of one another: 100 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 (96 shared lines) core/index_method/toy_vector_sparse_ivf.rs:505— core/index_method/toy_vector_sparse_ivf.rs:505-768 | core/index_method/toy_vector_sparse_ivf.rs:770-1040 — These two members are variants of one another: 96 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) core/translate/expr/binary.rs:481— core/translate/expr/binary.rs:481-784 | core/translate/expr/binary.rs:899-1208 — 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 (45 shared lines) testing/sqltest/src/backends/cli.rs:240— testing/sqltest/src/backends/cli.rs:240-369 | testing/sqltest/src/backends/js.rs:137-220 — These two members are variants of one another: 45 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) REDACTED:1260— REDACTED:1260-1359 | REDACTED:1428-1613 — 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 (36 shared lines) REDACTED:1697— REDACTED:1697-1775 | REDACTED:4555-4674 — These two members are variants of one another: 36 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (35 shared lines) core/vdbe/hash_table.rs:1507— core/vdbe/hash_table.rs:1507-1606 | core/vdbe/hash_table.rs:1614-1776 — These two members are variants of one another: 35 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 (21 shared lines) core/vdbe/hash_table.rs:1507— core/vdbe/hash_table.rs:1507-1606 | core/vdbe/hash_table.rs:2851-2919 — These two members are variants of one another: 21 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (34 corresponding lines) · ×1
Edited copy of a member (34 corresponding lines) core/json/mod.rs:916— core/json/mod.rs:916-950 | core/json/mod.rs:957-991 — These two members are one piece of code written twice and then edited apart: 34 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (29 corresponding lines) · ×1
Edited copy of a member (29 corresponding lines) postgres/parser/parser.rs:448— postgres/parser/parser.rs:448-485 | postgres/parser/parser.rs:2016-2091 — These two members are one piece of code written twice and then edited apart: 29 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (10 corresponding lines) · ×1
Edited copy of a member (10 corresponding lines) REDACTED:518— REDACTED:518-710 | REDACTED:995-1069 — These two members are one piece of code written twice and then edited apart: 10 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (22 corresponding lines) · ×1
Edited copy of a member (22 corresponding lines) core/vector/vector_types.rs:119— core/vector/vector_types.rs:119-145 | core/vector/vector_types.rs:146-172 — These two members are one piece of code written twice and then edited apart: 22 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) REDACTED:670— REDACTED:670-701 | REDACTED:703-748 | REDACTED:750-797 | REDACTED:806-861 | REDACTED:988-1018 | REDACTED:1099-1145 | REDACTED:1147-1196 | REDACTED:1201-1260 | REDACTED:1283-1336 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
Duplicated block (90 lines × 2) REDACTED:9416— REDACTED:9416-9505 | REDACTED:10362-10451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (68 lines × 2) postgres/parser/parser.rs:106— postgres/parser/parser.rs:106-173 | postgres/parser/parser.rs:624-691 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (58 lines × 2) postgres/parser/parser.rs:1102— postgres/parser/parser.rs:1102-1159 | postgres/parser/parser.rs:1162-1219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (56 lines × 2) core/translate/index.rs:402— core/translate/index.rs:402-457 | core/translate/index.rs:503-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (50–53 lines × 2) testing/simulator/runner/differential.rs:103— testing/simulator/runner/differential.rs:103-152 | testing/simulator/runner/doublecheck.rs:125-177 — before extracting anything, compare `testing/simulator/runner/differential.rs` and `testing/simulator/runner/doublecheck.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 128 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 (47 lines × 3) core/json/jsonb.rs:360— core/json/jsonb.rs:360-406 | core/json/jsonb.rs:525-571 | core/json/jsonb.rs:606-652 — 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 (42–47 lines × 2) core/translate/emitter/mod.rs:1635— core/translate/emitter/mod.rs:1635-1676 | core/translate/emitter/mod.rs:1762-1808 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (44 lines × 2) core/translate/display.rs:278— core/translate/display.rs:278-321 | core/translate/display.rs:392-435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (43 lines × 2) core/translate/expr/walk.rs:149— core/translate/expr/walk.rs:149-191 | core/translate/expr/walk.rs:484-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (41–43 lines × 2) core/translate/fkeys.rs:1339— core/translate/fkeys.rs:1339-1381 | core/translate/insert.rs:4014-4054 — before extracting anything, compare `core/translate/fkeys.rs` and `core/translate/insert.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 130 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 (26–43 lines × 2) core/vdbe/execute.rs:4020— core/vdbe/execute.rs:4020-4062 | core/vdbe/execute.rs:4063-4088 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (41 lines × 2) core/translate/optimizer/constraints.rs:873— core/translate/optimizer/constraints.rs:873-913 | core/translate/optimizer/constraints.rs:976-1016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (39 lines × 2) core/connection.rs:1557— core/connection.rs:1557-1595 | core/connection.rs:3751-3789 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (35–38 lines × 2) core/translate/sequence.rs:191— core/translate/sequence.rs:191-228 | core/translate/sequence.rs:436-470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (38 lines × 2) sync/engine/src/database_sync_operations.rs:2007— sync/engine/src/database_sync_operations.rs:2007-2044 | sync/engine/src/database_sync_operations.rs:2152-2189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (34–37 lines × 2) core/translate/expr/binary.rs:742— core/translate/expr/binary.rs:742-778 | core/translate/expr/binary.rs:1168-1201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (32–35 lines × 2) core/translate/emitter/delete.rs:998— core/translate/emitter/delete.rs:998-1032 | core/translate/emitter/delete.rs:1064-1095 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29–35 lines × 2) core/translate/expr/binary.rs:110— core/translate/expr/binary.rs:110-138 | core/translate/expr/binary.rs:179-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 (33–34 lines × 2) testing/simulator/runner/differential.rs:67— testing/simulator/runner/differential.rs:67-99 | testing/simulator/runner/doublecheck.rs:90-123 — before extracting anything, compare `testing/simulator/runner/differential.rs` and `testing/simulator/runner/doublecheck.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 128 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 (30–33 lines × 2) core/translate/insert.rs:1458— core/translate/insert.rs:1458-1487 | core/translate/insert.rs:3147-3179 — both copies are in the same file, so extract the block into 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–32 lines × 2) core/translate/sequence.rs:1013— core/translate/sequence.rs:1013-1035 | core/translate/view.rs:639-670 — before extracting anything, compare `core/translate/sequence.rs` and `core/translate/view.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 98 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 (26–32 lines × 2) testing/differential-oracle/sql_gen/src/policy.rs:728— testing/differential-oracle/sql_gen/src/policy.rs:728-759 | testing/differential-oracle/sql_gen/src/policy.rs:765-790 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (30–31 lines × 2) core/vdbe/execute.rs:13338— core/vdbe/execute.rs:13338-13368 | core/vdbe/execute.rs:13592-13621 — both copies are in the same file, so extract the block into 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–30 lines × 2) REDACTED:5468— REDACTED:5468-5497 | REDACTED:5544-5565 — both copies are in the same file, so extract the block into 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–30 lines × 2) core/translate/fkeys.rs:1416— core/translate/fkeys.rs:1416-1445 | core/translate/insert.rs:4147-4175 — before extracting anything, compare `core/translate/fkeys.rs` and `core/translate/insert.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 130 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 (23–30 lines × 2) testing/differential-oracle/sql_gen_prop/profile.rs:207— testing/differential-oracle/sql_gen_prop/profile.rs:207-236 | testing/differential-oracle/sql_gen_prop/profile.rs:247-269 — both copies are in the same file, so extract the block into 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–29 lines × 2) testing/differential-oracle/sql_gen/src/policy.rs:400— testing/differential-oracle/sql_gen/src/policy.rs:400-428 | testing/differential-oracle/sql_gen/src/policy.rs:453-477 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–27 lines × 2) core/dialect/sqlite/mod.rs:133— core/dialect/sqlite/mod.rs:133-154 | REDACTED:117-143 — 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 (26–27 lines × 2) REDACTED:2068— REDACTED:2068-2093 | REDACTED:2304-2330 — both copies are in the same file, so extract the block into 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 × 3) core/translate/main_loop/init.rs:228— core/translate/main_loop/init.rs:228-251 | core/translate/main_loop/init.rs:345-369 | core/translate/main_loop/init.rs:449-472 — 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 (17–25 lines × 2) core/json/jsonb.rs:3119— core/json/jsonb.rs:3119-3135 | core/json/jsonb.rs:3189-3213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23–24 lines × 2) REDACTED:5669— REDACTED:5669-5691 | REDACTED:5747-5770 — both copies are in the same file, so extract the block into 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–24 lines × 2) core/translate/sequence.rs:379— core/translate/sequence.rs:379-402 | core/translate/sequence.rs:616-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–23 lines × 3) testing/differential-oracle/sql_gen/src/policy.rs:571— testing/differential-oracle/sql_gen/src/policy.rs:571-593 | testing/differential-oracle/sql_gen/src/policy.rs:636-656 | testing/differential-oracle/sql_gen/src/policy.rs:660-680 — 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 (18–23 lines × 2) core/functions/datetime.rs:259— core/functions/datetime.rs:259-281 | core/functions/datetime.rs:326-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 (14–23 lines × 2) core/translate/sequence.rs:337— core/translate/sequence.rs:337-350 | core/translate/sequence.rs:578-600 — both copies are in the same file, so extract the block into 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 × 4) core/vdbe/execute.rs:7167— core/vdbe/execute.rs:7167-7188 | core/vdbe/execute.rs:7231-7252 | core/vdbe/execute.rs:7279-7300 | core/vdbe/execute.rs:7327-7348 — 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 (17–22 lines × 2) core/util.rs:635— core/util.rs:635-651 | core/util.rs:758-779 — both copies are in the same file, so extract the block into 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 × 3) core/json/jsonb.rs:2760— core/json/jsonb.rs:2760-2780 | core/json/jsonb.rs:2952-2972 | core/json/jsonb.rs:3146-3166 — 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 (18–20 lines × 3) core/translate/sequence.rs:135— core/translate/sequence.rs:135-154 | core/translate/sequence.rs:282-299 | core/translate/sequence.rs:556-573 — 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 (17–20 lines × 2) REDACTED:5450— REDACTED:5450-5466 | REDACTED:5523-5542 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–19 lines × 6) core/json/mod.rs:393— core/json/mod.rs:393-411 | core/json/mod.rs:434-450 | core/json/ops.rs:162-177 | core/json/ops.rs:201-216 | core/json/ops.rs:240-256 | core/json/ops.rs:280-296 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (19 lines × 4) core/time/mod.rs:880— core/time/mod.rs:880-898 | core/time/mod.rs:907-925 | core/time/mod.rs:934-952 | core/time/mod.rs:961-979 — 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) core/translate/emitter/mod.rs:1620— core/translate/emitter/mod.rs:1620-1637 | core/translate/emitter/mod.rs:1730-1747 | core/translate/emitter/mod.rs:1851-1869 — 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 (17–19 lines × 2) core/incremental/vdbe_maintenance/aggregate.rs:152— core/incremental/vdbe_maintenance/aggregate.rs:152-168 | core/incremental/vdbe_maintenance/set_op.rs:333-351 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/set_op.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 79 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) postgres/client/lib.rs:94— postgres/client/lib.rs:94-112 | postgres/regress/main.rs:1483-1500 — before extracting anything, compare `postgres/client/lib.rs` and `postgres/regress/main.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 88 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 4) core/functions/datetime.rs:886— core/functions/datetime.rs:886-903 | core/functions/datetime.rs:1105-1122 | core/functions/datetime.rs:1132-1149 | core/functions/datetime.rs:1307-1324 — 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 (16–18 lines × 3) core/translate/schema.rs:2335— core/translate/schema.rs:2335-2350 | core/translate/schema.rs:2469-2486 | core/translate/schema.rs:2548-2565 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–17 lines × 7) REDACTED:671— REDACTED:671-685 | REDACTED:704-720 | REDACTED:751-767 | REDACTED:1100-1116 | REDACTED:1148-1164 | REDACTED:1202-1218 | REDACTED:1284-1300 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14–17 lines × 3) REDACTED:5670— REDACTED:5670-5686 | REDACTED:5748-5764 | REDACTED:5788-5801 — 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–17 lines × 2) REDACTED:6502— REDACTED:6502-6512 | REDACTED:6727-6743 — both copies are in the same file, so extract the block into 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–17 lines × 2) core/storage/encryption.rs:740— core/storage/encryption.rs:740-752 | core/storage/encryption.rs:834-850 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–17 lines × 2) core/translate/emitter/delete.rs:596— core/translate/emitter/delete.rs:596-612 | core/translate/emitter/delete.rs:972-985 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–17 lines × 2) core/translate/emitter/delete.rs:865— core/translate/emitter/delete.rs:865-879 | core/translate/emitter/update.rs:2581-2597 — before extracting anything, compare `core/translate/emitter/delete.rs` and `core/translate/emitter/update.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. 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–17 lines × 2) core/translate/schema.rs:2018— core/translate/schema.rs:2018-2034 | core/translate/schema.rs:2466-2477 — both copies are in the same file, so extract the block into 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 × 3) cli/read_state_machine.rs:57— cli/read_state_machine.rs:57-72 | postgres/cli/read_state_machine.rs:57-72 | testing/sqltest/src/parser/sql_complete.rs:59-74 — before extracting anything, compare `cli/read_state_machine.rs` and `postgres/cli/read_state_machine.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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–16 lines × 3) core/vdbe/execute.rs:14773— core/vdbe/execute.rs:14773-14788 | core/vdbe/execute.rs:14807-14820 | core/vdbe/execute.rs:14839-14852 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–16 lines × 3) core/vdbe/mod.rs:2279— core/vdbe/mod.rs:2279-2293 | core/vdbe/mod.rs:2377-2392 | core/vdbe/mod.rs:2428-2442 — 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–16 lines × 2) core/translate/window.rs:2205— core/translate/window.rs:2205-2213 | core/translate/window.rs:3096-3111 — both copies are in the same file, so extract the block into 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 × 6) cli/read_state_machine.rs:150— cli/read_state_machine.rs:150-164 | cli/read_state_machine.rs:175-189 | postgres/cli/read_state_machine.rs:185-199 | postgres/cli/read_state_machine.rs:210-224 | testing/sqltest/src/parser/sql_complete.rs:144-158 | testing/sqltest/src/parser/sql_complete.rs:169-183 — before extracting anything, compare `cli/read_state_machine.rs` and `postgres/cli/read_state_machine.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 105 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 lines × 4) core/incremental/vdbe_maintenance/aggregate.rs:398— core/incremental/vdbe_maintenance/aggregate.rs:398-412 | core/incremental/vdbe_maintenance/aggregate.rs:769-783 | core/incremental/vdbe_maintenance/aggregate.rs:1095-1109 | core/incremental/vdbe_maintenance/arrangement.rs:314-328 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/arrangement.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14–15 lines × 3) core/translate/pragma.rs:1221— core/translate/pragma.rs:1221-1235 | core/translate/pragma.rs:1400-1413 | core/translate/pragma.rs:1465-1478 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–14 lines × 5) core/translate/emitter/mod.rs:1696— core/translate/emitter/mod.rs:1696-1709 | core/translate/emitter/mod.rs:1822-1835 | core/translate/emitter/mod.rs:1903-1916 | core/translate/schema.rs:1661-1673 | core/translate/schema.rs:2781-2792 — there are 5 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 5 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (14 lines × 4) core/translate/sequence.rs:1028— core/translate/sequence.rs:1028-1041 | core/translate/view.rs:663-676 | core/translate/view.rs:751-764 | core/translate/view.rs:781-794 — before extracting anything, compare `core/translate/sequence.rs` and `core/translate/view.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 98 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–14 lines × 4) REDACTED:1290— REDACTED:1290-1303 | REDACTED:1308-1318 | REDACTED:1461-1474 | REDACTED:1479-1489 — 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–14 lines × 3) core/time/mod.rs:695— core/time/mod.rs:695-707 | core/time/mod.rs:717-729 | core/time/mod.rs:857-870 — 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–14 lines × 2) bindings/c/src/lib.rs:1925— bindings/c/src/lib.rs:1925-1935 | bindings/c/src/lib.rs:3394-3407 — both copies are in the same file, so extract the block into 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–14 lines × 2) core/translate/emitter/select.rs:501— core/translate/emitter/select.rs:501-509 | core/translate/window.rs:1125-1138 — 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–13 lines × 5) core/incremental/vdbe_maintenance/aggregate.rs:192— core/incremental/vdbe_maintenance/aggregate.rs:192-204 | core/incremental/vdbe_maintenance/arrangement.rs:83-94 | core/incremental/vdbe_maintenance/members.rs:73-84 | core/incremental/vdbe_maintenance/set_op.rs:380-391 | core/incremental/vdbe_maintenance/set_op.rs:394-405 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/arrangement.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 77 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–13 lines × 4) sync/engine/src/database_sync_operations.rs:1960— sync/engine/src/database_sync_operations.rs:1960-1972 | sync/engine/src/database_sync_operations.rs:2124-2135 | sync/engine/src/database_sync_operations.rs:2249-2260 | sync/engine/src/database_sync_operations.rs:3440-3451 — 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–13 lines × 3) core/translate/emitter/delete.rs:436— core/translate/emitter/delete.rs:436-448 | core/translate/fkeys.rs:1371-1382 | core/translate/insert.rs:4045-4055 — before extracting anything, compare `core/translate/fkeys.rs` and `core/translate/insert.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 130 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–13 lines × 3) sync/engine/src/database_sync_operations.rs:2030— sync/engine/src/database_sync_operations.rs:2030-2041 | sync/engine/src/database_sync_operations.rs:2174-2186 | sync/engine/src/database_sync_operations.rs:2349-2361 — 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–13 lines × 2) core/database.rs:2257— core/database.rs:2257-2269 | core/database.rs:2401-2410 — both copies are in the same file, so extract the block into 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–13 lines × 2) core/vdbe/execute.rs:10565— core/vdbe/execute.rs:10565-10577 | core/vdbe/execute.rs:12682-12689 — both copies are in the same file, so extract the block into 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–13 lines × 2) sqlite/parser/src/parser.rs:521— sqlite/parser/src/parser.rs:521-533 | sqlite/parser/src/parser.rs:545-555 — both copies are in the same file, so extract the block into 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 × 9) core/translate/expr/translator.rs:1032— core/translate/expr/translator.rs:1032-1043 | core/translate/expr/translator.rs:1267-1277 | core/translate/expr/translator.rs:1506-1517 | core/translate/expr/translator.rs:1560-1571 | core/translate/expr/translator.rs:1574-1585 | core/translate/expr/translator.rs:1631-1641 | core/translate/expr/translator.rs:1647-1658 | core/translate/expr/translator.rs:1664-1675 | core/translate/expr/translator.rs:1758-1769 — all 9 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12 lines × 5) core/incremental/vdbe_maintenance/linear.rs:115— core/incremental/vdbe_maintenance/linear.rs:115-126 | core/incremental/vdbe_maintenance/linear.rs:194-205 | core/incremental/vdbe_maintenance/set_op.rs:188-199 | core/incremental/vdbe_maintenance/stream.rs:269-280 | core/incremental/vdbe_maintenance/stream.rs:343-354 — before extracting anything, compare `core/incremental/vdbe_maintenance/linear.rs` and `core/incremental/vdbe_maintenance/set_op.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 61 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–12 lines × 3) core/translate/insert.rs:1818— core/translate/insert.rs:1818-1828 | core/translate/schema.rs:3141-3152 | core/translate/sequence.rs:731-739 — before extracting anything, compare `core/translate/insert.rs` and `core/translate/sequence.rs` as WHOLE FILES: this scan already matched 5 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 (7–12 lines × 2) core/translate/window.rs:3118— core/translate/window.rs:3118-3129 | core/translate/window.rs:3271-3277 — both copies are in the same file, so extract the block into 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–12 lines × 2) core/vdbe/execute.rs:15746— core/vdbe/execute.rs:15746-15757 | core/vdbe/execute.rs:15789-15796 — both copies are in the same file, so extract the block into 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–10 lines × 8) core/json/mod.rs:389— core/json/mod.rs:389-397 | core/json/mod.rs:429-438 | core/json/ops.rs:93-102 | core/json/ops.rs:126-135 | core/json/ops.rs:157-166 | core/json/ops.rs:196-205 | core/json/ops.rs:235-244 | core/json/ops.rs:275-284 — there are 8 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 8 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 6) extensions/fuzzy/src/lib.rs:19— extensions/fuzzy/src/lib.rs:19-28 | extensions/fuzzy/src/lib.rs:83-92 | extensions/fuzzy/src/lib.rs:178-187 | extensions/fuzzy/src/lib.rs:199-208 | extensions/fuzzy/src/lib.rs:232-241 | extensions/fuzzy/src/lib.rs:331-340 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 5) core/incremental/vdbe_maintenance/aggregate.rs:170— core/incremental/vdbe_maintenance/aggregate.rs:170-179 | core/incremental/vdbe_maintenance/join.rs:531-540 | core/incremental/vdbe_maintenance/join.rs:781-790 | core/incremental/vdbe_maintenance/linear.rs:37-46 | core/incremental/vdbe_maintenance/linear.rs:389-398 — before extracting anything, compare `core/incremental/vdbe_maintenance/aggregate.rs` and `core/incremental/vdbe_maintenance/join.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 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) testing/simulator/generation/property.rs:783— testing/simulator/generation/property.rs:783-791 | testing/simulator/generation/property.rs:928-936 | testing/simulator/generation/property.rs:1007-1016 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8–10 lines × 2) macros/src/ext/scalars.rs:53— macros/src/ext/scalars.rs:53-60 | macros/src/ext/scalars.rs:148-157 — both copies are in the same file, so extract the block into 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 × 5) core/translate/pragma.rs:1098— core/translate/pragma.rs:1098-1107 | core/translate/pragma.rs:1138-1147 | core/translate/pragma.rs:1220-1229 | core/translate/pragma.rs:1399-1407 | core/translate/pragma.rs:1464-1472 — 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–9 lines × 2) core/incremental/vdbe_maintenance/members.rs:188— core/incremental/vdbe_maintenance/members.rs:188-194 | core/translate/schema.rs:2328-2336 — 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 × 8) sdk-kit/src/capi.rs:180— sdk-kit/src/capi.rs:180-187 | sdk-kit/src/capi.rs:238-245 | sdk-kit/src/capi.rs:270-277 | sdk-kit/src/capi.rs:308-315 | sdk-kit/src/capi.rs:328-335 | sdk-kit/src/capi.rs:365-372 | sdk-kit/src/capi.rs:388-395 | sdk-kit/src/capi.rs:415-422 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 4) testing/simulator/generation/property.rs:728— testing/simulator/generation/property.rs:728-734 | testing/simulator/generation/property.rs:786-791 | testing/simulator/generation/property.rs:931-936 | testing/simulator/generation/property.rs:1011-1016 — 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 (3–6 lines × 4) macros/src/ext/vfs_derive.rs:140— macros/src/ext/vfs_derive.rs:140-145 | macros/src/ext/vfs_derive.rs:167-172 | macros/src/ext/vfs_derive.rs:210-215 | macros/src/ext/vfs_derive.rs:228-230 — 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 (5 lines × 6) core/translate/expr/translator.rs:1121— core/translate/expr/translator.rs:1121-1125 | core/translate/expr/translator.rs:1130-1134 | core/translate/expr/translator.rs:1139-1143 | core/translate/expr/translator.rs:1148-1152 | core/translate/expr/translator.rs:1157-1161 | core/translate/expr/translator.rs:1162-1166 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (2–5 lines × 3) macros/src/ext/vfs_derive.rs:182— macros/src/ext/vfs_derive.rs:182-186 | macros/src/ext/vfs_derive.rs:196-200 | macros/src/ext/vfs_derive.rs:243-244 — 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 (114 lines × 2) sdk-kit/src/bindings.rs:11— sdk-kit/src/bindings.rs:11-396 | sync/sdk-kit/src/bindings.rs:23-136 — 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 × 6) core/vdbe/explain.rs:304— core/vdbe/explain.rs:304-315 | core/vdbe/explain.rs:324-335 | core/vdbe/explain.rs:344-354 | core/vdbe/explain.rs:359-370 | core/vdbe/explain.rs:379-389 | core/vdbe/explain.rs:394-405 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (27–28 lines × 2) bindings/go/driver_db.go:97— bindings/go/driver_db.go:97-124 | bindings/go/driver_db.go:392-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `bindings/go/driver_db.go:97` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 6) REDACTED:411— REDACTED:411-419 | REDACTED:474-482 | REDACTED:514-522 | REDACTED:527-535 | REDACTED:538-546 | REDACTED:642-650 — there are 6 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 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 9) REDACTED:422— REDACTED:422-431 | REDACTED:461-470 | REDACTED:474-483 | REDACTED:488-497 | REDACTED:501-510 | REDACTED:514-523 | REDACTED:527-536 | REDACTED:540-549 | REDACTED:630-639 — there are 9 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 9 sites; resolving a subset leaves the remainder to drift apart.
D4 · Code Duplication· Near-duplicate member family (3 members, 21 shared lines) · ×1
Near-duplicate member family (3 members, 21 shared lines) perf/latency/sqlite_engine.rs:14— perf/latency/sqlite_engine.rs:14-138 | perf/tatp/sqlite_engine.rs:45-115 | perf/throughput/sqlite_engine.rs:12-114 — These 3 members are variants of one another: a block of 21 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 14 shared lines) · ×1
Near-duplicate member family (3 members, 14 shared lines) perf/latency/turso_engine.rs:14— perf/latency/turso_engine.rs:14-101 | perf/tatp/turso_engine.rs:62-142 | perf/throughput/turso_engine.rs:12-95 — These 3 members are variants of one another: a block of 14 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (39 shared lines) perf/latency/turso_engine.rs:135— perf/latency/turso_engine.rs:135-214 | perf/throughput/turso_engine.rs:130-200 — These two members are variants of one another: 39 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.
Duplicated block (36 lines × 4) perf/memory/src/profile/mixed.rs:45— perf/memory/src/profile/mixed.rs:45-80 | perf/memory/src/profile/read.rs:45-80 | perf/memory/src/profile/scan.rs:37-72 | perf/memory/src/profile/update_churn.rs:49-84 — before extracting anything, compare `perf/memory/src/profile/mixed.rs` and `perf/memory/src/profile/read.rs` as WHOLE FILES: this scan already matched 4 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. 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–22 lines × 2) perf/encryption/src/main.rs:421— perf/encryption/src/main.rs:421-439 | perf/encryption/src/main.rs:440-461 — both copies are in the same file, so extract the block into 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) perf/latency/sqlite_engine.rs:112— perf/latency/sqlite_engine.rs:112-125 | perf/latency/turso_engine.rs:72-85 | perf/tatp/sqlite_engine.rs:94-107 | perf/tatp/turso_engine.rs:116-129 | perf/throughput/sqlite_engine.rs:93-106 | perf/throughput/turso_engine.rs:63-76 — before extracting anything, compare `perf/latency/sqlite_engine.rs` and `perf/latency/turso_engine.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 5) REDACTED:1258— REDACTED:1258-1269 | REDACTED:2082-2093 | REDACTED:2528-2538 | REDACTED:2562-2572 | REDACTED:3137-3148 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–12 lines × 2) REDACTED:822— REDACTED:822-833 | REDACTED:933-941 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 5) REDACTED:780— REDACTED:780-787 | REDACTED:804-811 | REDACTED:1737-1744 | REDACTED:1777-1784 | REDACTED:1851-1858 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–8 lines × 3) perf/latency/sqlite_engine.rs:22— perf/latency/sqlite_engine.rs:22-28 | perf/tatp/sqlite_engine.rs:54-61 | perf/throughput/sqlite_engine.rs:17-24 — `perf/latency/sqlite_engine.rs` and `perf/tatp/sqlite_engine.rs` are one unit implemented once per sibling directory, so they are most likely parallel implementations of one contract rather than a copy of each other — this scan matched 3 separate duplicated blocks between them, totalling at least 33 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (35 lines × 3) perf/connection/gen-database.py:9— perf/connection/gen-database.py:9-43 | perf/connection/limbo/gen-database.py:9-43 | perf/connection/rusqlite/gen-database.py:9-43 — before extracting anything, compare `perf/connection/gen-database.py` and `perf/connection/limbo/gen-database.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `perf/connection/gen-database.py:9` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 3) perf/connection/limbo/plot.py:11— perf/connection/limbo/plot.py:11-34 | perf/connection/plot.py:11-34 | perf/connection/rusqlite/plot.py:11-34 — before extracting anything, compare `perf/connection/limbo/plot.py` and `perf/connection/plot.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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) testing/cli_tests/extensions.py:209— testing/cli_tests/extensions.py:209-230 | testing/cli_tests/extensions.py:555-578 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `testing/cli_tests/extensions.py:209` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 3) perf/connection/limbo/plot.py:36— perf/connection/limbo/plot.py:36-50 | perf/connection/plot.py:36-50 | perf/connection/rusqlite/plot.py:36-50 — before extracting anything, compare `perf/connection/limbo/plot.py` and `perf/connection/plot.py` as WHOLE FILES: 100% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 2 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. 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–10 lines × 3) perf/latency/plot/plot-latency-ecdf.py:66— perf/latency/plot/plot-latency-ecdf.py:66-75 | perf/tatp/plot/plot-mqth.py:46-52 | perf/throughput/plot/plot-throughput.py:52-59 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `perf/latency/plot/plot-latency-ecdf.py:66` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 3) perf/tatp/plot/plot-mqth.py:47— perf/tatp/plot/plot-mqth.py:47-54 | perf/tatp/plot/plot-response-times.py:53-61 | perf/throughput/plot/plot-throughput.py:54-61 — 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.
Duplication concentrated across 3 sibling directories (9 clone groups) bindings/javascript/sync/packages/native/promise.ts:64— 9 duplicated blocks under bindings/javascript/sync/packages/ have copies in at least two of the sibling directories common, native, wasm — 8 of them are reported below, and 1 is counted here but not reported individually: those copies match on shape but no longer clear R10's bar for an individually reported row — either they kept neither their own names nor their values, or what was copied is too small to stand on its own (it reports near-exact duplication only, and only of substantial extent). What this row states is the concentration, which the detector measured over all 9 and which does not depend on how exactly each block's copies still match. That concentration is one structural fact, not 9 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 9 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 2 sibling directories (7 clone groups) bindings/javascript/packages/common/promise.ts:151— 7 of the duplicated blocks reported below have copies in at least two of the sibling directories bindings, serverless under the repository root. That concentration is one structural fact, not 7 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 7 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Duplication concentrated across 2 sibling directories (5 clone groups) bindings/javascript/packages/wasm/index-vite-dev-hack.ts:6— 5 of the duplicated blocks reported below have copies in at least two of the sibling directories packages, sync under bindings/javascript/. That concentration is one structural fact, not 5 local ones: the siblings replicate behaviour none of them owns, which is the shape of a missing shared module — a common library every sibling imports — rather than 5 separate extractions. Check first whether the siblings are deliberately standalone deliverables (scaffold templates, demo apps that must stay copy-pasteable); where they are, the duplication is the design and the per-block rows are the ones to act on.
Wholesale file copy (223 identical lines × 4 files) bindings/javascript/sync/packages/wasm/promise-bundle.ts:1— bindings/javascript/sync/packages/wasm/promise-bundle.ts:1 · bindings/javascript/sync/packages/wasm/promise-default.ts:1 · bindings/javascript/sync/packages/wasm/promise-turbopack-hack.ts:1 · bindings/javascript/sync/packages/wasm/promise-vite-dev-hack.ts:1 — these 4 files are line-for-line copies of one another — 223 lines are identical, in the same order, in every one of them — so this is one fact about the file set, not a block to extract. An edit made to one file and not the others changes behaviour silently, which is the failure a wholesale copy guarantees. Pick one file as the single source and derive the others from it (re-export it, spread it into the local overrides each variant genuinely needs, or generate the copies at build time) — the few lines that differ between the files are exactly the part each variant should still own. Check first whether the copies are deliberately standalone deliverables (a translation file seeded from its sibling and waiting to be translated); where they are, the duplication is the design, and the honest move is to mark the seeded file as untranslated rather than to let it pass as done.
R10 · Code Duplication· Duplicated block with local edits (90 matched lines × 2 locations) · ×1
Duplicated block with local edits (90 matched lines × 2 locations) testing/simulator/simulator-docker-runner/github.ts:28— testing/simulator/simulator-docker-runner/github.ts:28 · testing/sqlancer/sqlancer-runner/github.ts:5 — the two spans are one implementation copied and then locally edited — 700 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 (71 lines × 5 locations) bindings/javascript/sync/packages/native/promise.ts:64— bindings/javascript/sync/packages/native/promise.ts:64 · bindings/javascript/sync/packages/wasm/promise-bundle.ts:66 · bindings/javascript/sync/packages/wasm/promise-default.ts:66 · bindings/javascript/sync/packages/wasm/promise-turbopack-hack.ts:66 · +1 more site(s) not listed — the 5 copies are spread across 5 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.
R10 · Code Duplication· Duplicated block with local edits (65 matched lines × 2 locations) · ×1
Duplicated block with local edits (65 matched lines × 2 locations) testing/simulator/simulator-docker-runner/slack.ts:27— testing/simulator/simulator-docker-runner/slack.ts:27 · testing/sqlancer/sqlancer-runner/slack.ts:33 — the two spans are one implementation copied and then locally edited — 437 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 (58 lines × 5 locations) bindings/javascript/sync/packages/native/promise.ts:210— bindings/javascript/sync/packages/native/promise.ts:210 · bindings/javascript/sync/packages/wasm/promise-bundle.ts:224 · bindings/javascript/sync/packages/wasm/promise-default.ts:224 · bindings/javascript/sync/packages/wasm/promise-turbopack-hack.ts:224 · +1 more site(s) not listed — the 5 copies are spread across 5 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.
R10 · Code Duplication· Duplicated block with local edits (51 matched lines × 2 locations) · ×1
Duplicated block with local edits (51 matched lines × 2 locations) serverless/javascript/src/connection.ts:186— serverless/javascript/src/connection.ts:186 · serverless/javascript/src/connection.ts:652 — the two spans are one implementation copied and then locally edited — 464 tokens are still identical, in the same order in both spans, with only local edits between them. The copies have already begun to drift, which is this row's finding: an edit made to one and not the other changes behaviour silently. Diff the two spans first to learn what genuinely differs, then extract the shared core into one module both sites use, passing the differences in as parameters — or, if one copy exists only because the other could not be imported from its context, make one of them the single source the other is generated or re-exported from. If one copy is no longer reachable, delete it rather than letting it shadow the live one.
Duplicated block (47 lines × 2 locations) bindings/javascript/packages/common/compat.ts:5— bindings/javascript/packages/common/compat.ts:5 · bindings/javascript/packages/common/promise.ts:6 — the 2 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it.
Duplicated block (41 lines × 3 locations) bindings/javascript/packages/wasm/promise-bundle.ts:5— bindings/javascript/packages/wasm/promise-bundle.ts:5 · bindings/javascript/packages/wasm/promise-turbopack-hack.ts:5 · bindings/javascript/packages/wasm/promise-vite-dev-hack.ts:5 — the 3 copies sit in sibling files in one directory, so check first whether one of them (or an existing module there) already owns this behaviour and the others should call it; otherwise extract it into one module in that directory and have each site call it. There is one copy in each of 3 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (36 lines × 2 locations) bindings/javascript/packages/common/promise.ts:571— bindings/javascript/packages/common/promise.ts:571 · bindings/javascript/packages/common/promise.ts:1037 — 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 (34 lines × 2 locations) testing/simulator/simulator-docker-runner/levenshtein.ts:7— testing/simulator/simulator-docker-runner/levenshtein.ts:7 · testing/sqlancer/sqlancer-runner/levenshtein.ts:8 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (32 lines × 2 locations) bindings/javascript/packages/common/compat.ts:68— bindings/javascript/packages/common/compat.ts:68 · bindings/javascript/packages/common/promise.ts:117 — 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 (30 lines × 4 locations) bindings/javascript/packages/wasm/promise-bundle.ts:18— bindings/javascript/packages/wasm/promise-bundle.ts:18 · bindings/javascript/packages/wasm/promise-default.ts:22 · bindings/javascript/packages/wasm/promise-turbopack-hack.ts:18 · bindings/javascript/packages/wasm/promise-vite-dev-hack.ts:18 — the 4 copies are spread across 4 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 (27 lines × 2 locations) bindings/javascript/packages/wasm/index-vite-dev-hack.ts:6— bindings/javascript/packages/wasm/index-vite-dev-hack.ts:6 · bindings/javascript/sync/packages/wasm/index-vite-dev-hack.ts:14 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (25 lines × 2 locations) bindings/javascript/packages/common/compat.ts:225— bindings/javascript/packages/common/compat.ts:225 · bindings/javascript/packages/common/promise.ts:651 — 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 (23 lines × 2 locations) bindings/javascript/packages/common/promise.ts:151— bindings/javascript/packages/common/promise.ts:151 · serverless/javascript/src/session.ts:57 — the 2 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another.
Duplicated block (22 lines × 2 locations) serverless/javascript/src/session.ts:215— serverless/javascript/src/session.ts:215 · serverless/javascript/src/session.ts:729 — all 2 copies are in the same file, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (21 lines × 2 locations) bindings/javascript/packages/common/promise.ts:694— bindings/javascript/packages/common/promise.ts:694 · bindings/javascript/packages/common/promise.ts:995 — both copies are in the same file, so extract the block into 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 × 3 locations) bindings/javascript/sync/packages/wasm/index-bundle.ts:11— bindings/javascript/sync/packages/wasm/index-bundle.ts:11 · bindings/javascript/sync/packages/wasm/index-default.ts:9 · bindings/javascript/sync/packages/wasm/index-turbopack-hack.ts:11 — the 3 copies are spread across 3 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (18 lines × 9 locations) bindings/javascript/packages/common/promise.ts:403— bindings/javascript/packages/common/promise.ts:403 · bindings/javascript/packages/common/promise.ts:471 · bindings/javascript/sync/packages/native/promise.ts:285 · bindings/javascript/sync/packages/wasm/promise-bundle.ts:295 · +5 more site(s) not listed — the 9 copies are spread across 7 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (17 lines × 2 locations) bindings/javascript/packages/wasm/index-bundle.ts:5— bindings/javascript/packages/wasm/index-bundle.ts:5 · bindings/javascript/packages/wasm/index-default.ts:3 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (17 lines × 5 locations) bindings/javascript/sync/packages/native/promise.ts:140— bindings/javascript/sync/packages/native/promise.ts:140 · bindings/javascript/sync/packages/wasm/promise-bundle.ts:141 · bindings/javascript/sync/packages/wasm/promise-default.ts:141 · bindings/javascript/sync/packages/wasm/promise-turbopack-hack.ts:141 · +1 more site(s) not listed — the 5 copies are spread across 2 directories, so the shared home is a decision rather than an obvious spot: check first whether one of them already owns this behaviour, and otherwise put the extracted module somewhere all of the sites already reach rather than making one of them depend on another. There is one copy in each of 5 separate files rather than several in one place, so check first whether these are sibling modules that each declare their own version of one shape — one per entity, per provider, per language. Where they are, no single extracted module collapses them: each module still has to be written, and what recurs is the TEMPLATE. The moves that do collapse a template are to generate these modules from the set they enumerate, or to replace the repeated construction with one factory each site calls with its own values — and where the set is the point, each module pinning one distinct thing, the repetition IS the enumeration and there is nothing to delete.
Duplicated block (16 lines × 2 locations) bindings/javascript/packages/wasm/index-turbopack-hack.ts:6— bindings/javascript/packages/wasm/index-turbopack-hack.ts:6 · bindings/javascript/sync/packages/wasm/index-turbopack-hack.ts:6 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (16 lines × 5 locations) bindings/javascript/sync/packages/native/promise.ts:299— bindings/javascript/sync/packages/native/promise.ts:299 · bindings/javascript/sync/packages/wasm/promise-bundle.ts:309 · bindings/javascript/sync/packages/wasm/promise-default.ts:309 · bindings/javascript/sync/packages/wasm/promise-turbopack-hack.ts:309 · +1 more site(s) not listed — the 5 copies are spread across 5 files, and the CITED SPAN is not a self-contained block — it runs from inside one construct into the next (the tail of a branch plus the head of the following one, a run of switch arms, the end of a declaration plus the list that follows it) rather than covering a whole unit. So do not lift these lines literally: no call can be substituted for a half-open construct. Extract the enclosing repeated UNIT instead — the whole function, component or branch these lines sit in — and where the repetition IS the construct (a run of switch arms, a stack of near-identical declarations) replace it with one table or registry looked up by key rather than a helper each arm calls. The copies still drift apart the first time only one of them is edited, which is why this is reported.
Duplicated block (15 lines × 2 locations) bindings/javascript/packages/native/compat.ts:5— bindings/javascript/packages/native/compat.ts:5 · bindings/javascript/packages/native/promise.ts:5 — the 2 copies are spread across 2 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (15 lines × 3 locations) bindings/javascript/packages/wasm/index-default.ts:6— bindings/javascript/packages/wasm/index-default.ts:6 · bindings/javascript/packages/wasm/index-turbopack-hack.ts:8 · bindings/javascript/sync/packages/wasm/index-turbopack-hack.ts:8 — the 3 copies are spread across 3 files, and the SHAPE of this repetition could not be determined. It is not a run of declarations, a listing, a declaration header, a type body or a slice through a construct — and it was not measured as a run of executable statements either, so this row cannot tell you whether a function can stand where these lines are. Read the two spans before acting, because the move is opposite in the two cases. Where they are statements, the ordinary answer holds: give the shared part one home and call it from each site. Where they turn out to be declarations, a literal's entries, or the cases of an enumeration, there is no call site to call anything from, and collapsing them would delete what each copy pins — a shared base type, a generated set, or one exported constant each site refers to is the move instead, and sometimes the honest answer is that there is nothing to extract at all. Reported because the copies drift apart the first time only one of them is edited, which is true whichever of those they are.
Duplicated block (14 lines × 4 locations) bindings/javascript/packages/common/promise.ts:1251— bindings/javascript/packages/common/promise.ts:1251 · bindings/javascript/packages/common/promise.ts:1294 · bindings/javascript/packages/common/promise.ts:1332 · bindings/javascript/packages/common/promise.ts:1370 — 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 (13 lines × 2 locations) bindings/javascript/packages/common/promise.ts:968— bindings/javascript/packages/common/promise.ts:968 · serverless/javascript/src/connection.ts:627 — 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 (12 lines × 3 locations) bindings/javascript/packages/common/promise.ts:1291— bindings/javascript/packages/common/promise.ts:1291 · bindings/javascript/packages/common/promise.ts:1329 · bindings/javascript/packages/common/promise.ts:1367 — 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.
Complex function transition (cyclomatic 37, cognitive 17) bindings/javascript/turso-sql-split.mjs:137— transition has cyclomatic complexity 37 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function executeOpLocal (cyclomatic 29, cognitive 47) serverless/javascript/differential/parity.test.mjs:457— executeOpLocal has cyclomatic complexity 29 and cognitive complexity 47; 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 batch (cyclomatic 27, cognitive 31) serverless/javascript/src/session.ts:501— batch has cyclomatic complexity 27 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 _buildOpArb (cyclomatic 27, cognitive 25) serverless/javascript/differential/parity.test.mjs:275— _buildOpArb has cyclomatic complexity 27 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 26, cognitive 54) serverless/javascript/differential/parity.test.mjs:688— (anonymous) has cyclomatic complexity 26 and cognitive complexity 54; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function process (cyclomatic 25, cognitive 44) · ×1
Complex function process (cyclomatic 25, cognitive 44) bindings/javascript/sync/packages/common/run.ts:25— process has cyclomatic complexity 25 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function nextToken (cyclomatic 25, cognitive 44) bindings/javascript/turso-sql-split.mjs:56— nextToken has cyclomatic complexity 25 and cognitive complexity 44; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function batch (cyclomatic 21, cognitive 36) bindings/javascript/packages/common/compat.ts:288— batch has cyclomatic complexity 21 and cognitive complexity 36; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 20, cognitive 28) serverless/javascript/differential/parity.test.mjs:1022— (anonymous) has cyclomatic complexity 20 and cognitive complexity 28; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R2 · Cyclomatic Complexity· Complex function main (cyclomatic 19, cognitive 52) · ×1
Complex function main (cyclomatic 19, cognitive 52) testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.ts:510— main has cyclomatic complexity 19 and cognitive complexity 52; 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 cellsEqual (cyclomatic 19, cognitive 19) serverless/javascript/differential/parity.test.mjs:120— cellsEqual has cyclomatic complexity 19 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 processHttpRequest (cyclomatic 17, cognitive 23) bindings/react-native/src/internal/ioProcessor.ts:156— processHttpRequest has cyclomatic complexity 17 and cognitive complexity 23; 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 buildSql (cyclomatic 17, cognitive 15) serverless/javascript/differential/parity.test.mjs:409— buildSql has cyclomatic complexity 17 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function executeBatch (cyclomatic 15, cognitive 25) bindings/javascript/packages/common/promise.ts:757— executeBatch has cyclomatic complexity 15 and cognitive complexity 25; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function processCursorEntries (cyclomatic 14, cognitive 21) serverless/javascript/src/session.ts:393— processCursorEntries has cyclomatic complexity 14 and cognitive complexity 21; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function encodeValue (cyclomatic 14, cognitive 17) serverless/javascript/src/protocol.ts:124— encodeValue has cyclomatic complexity 14 and cognitive complexity 17; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function _buildValueArbs (cyclomatic 14, cognitive 13) serverless/javascript/differential/parity.test.mjs:212— _buildValueArbs has cyclomatic complexity 14 and cognitive complexity 13; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive sits below cyclomatic here, so much of the count is breadth — arms side by side rather than stacked — and splitting per arm would leave a function per arm; group the work between the checks into named steps instead. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function iterate (cyclomatic 13, cognitive 19) serverless/javascript/src/statement.ts:259— iterate has cyclomatic complexity 13 and cognitive complexity 19; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function trackAutocommit (cyclomatic 13, cognitive 18) serverless/javascript/src/session.ts:286— trackAutocommit has cyclomatic complexity 13 and cognitive complexity 18; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
Complex function (anonymous) (cyclomatic 13, cognitive 15) bindings/javascript/packages/common/promise.ts:819— (anonymous) has cyclomatic complexity 13 and cognitive complexity 15; this row is raised above a cyclomatic bar of 10. The two numbers answer different questions and the gap between them is what decides whether to act: cyclomatic counts the independent arms through the body, cognitive counts what it costs to hold them in your head, so nesting and mixed boolean chains raise it while a flat run of independent arms does not. Cognitive is at or above cyclomatic here, so the branching is nested or entangled rather than laid out side by side — extracting each decision into its own named function is the change that pays. Measured by this repository's own parse of the file, so a body assembled at runtime, or generated, is counted as written rather than as it executes.
R3 · Large Files· bindings/javascript/packages/common/promise.ts · ×1
bindings/javascript/packages/common/promise.ts: 1327 lines of code bindings/javascript/packages/common/promise.ts:1— bindings/javascript/packages/common/promise.ts has 1327 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· serverless/javascript/src/session.ts · ×1
serverless/javascript/src/session.ts: 731 lines of code serverless/javascript/src/session.ts:1— serverless/javascript/src/session.ts has 731 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· serverless/javascript/src/connection.ts · ×1
serverless/javascript/src/connection.ts: 725 lines of code serverless/javascript/src/connection.ts:1— serverless/javascript/src/connection.ts has 725 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· serverless/javascript/src/compat.ts · ×1
serverless/javascript/src/compat.ts: 571 lines of code serverless/javascript/src/compat.ts:1— serverless/javascript/src/compat.ts has 571 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· testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.ts · ×1
testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.ts: 549 lines of code testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.ts:1— testing/sqlancer/sqlancer-runner/docker-entrypoint.sqlancer.ts has 549 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· bindings/javascript/packages/common/compat.ts · ×1
bindings/javascript/packages/common/compat.ts: 526 lines of code bindings/javascript/packages/common/compat.ts:1— bindings/javascript/packages/common/compat.ts has 526 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· bindings/javascript/packages/wasm-common/index.ts · ×1
bindings/javascript/packages/wasm-common/index.ts: 457 lines of code bindings/javascript/packages/wasm-common/index.ts:1— bindings/javascript/packages/wasm-common/index.ts has 457 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
R3 · Large Files· bindings/react-native/src/Database.ts · ×1
bindings/react-native/src/Database.ts: 424 lines of code bindings/react-native/src/Database.ts:1— bindings/react-native/src/Database.ts has 424 significant lines (blank lines excluded), over the 400-line bar, and contains logic — a file this long is usually several responsibilities in one module.
Unused dependency '@emnapi/core' — Declared in bindings/javascript/packages/wasm-common/package.json but never imported anywhere in that package or its workspace members — no static import reaches it. Usually that is dead weight and attack surface, but two shapes are indistinguishable from source and are NOT dead: an optional or native peer that another dependency loads dynamically at runtime, and a package a build, docs or test step installs and invokes separately. Confirm which of the three this is before removing it.
Unused dependency '@emnapi/runtime' — Declared in bindings/javascript/packages/wasm-common/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.
SC1 · Supply-chain hygiene· NuGet dependencies are not locked · ×1
NuGet dependencies are not locked — No packages.lock.json and no central package management — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
Blocking `SqliteCommand.ExecuteNonQuery` inside an `async` method bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:222— `SqliteCommand.ExecuteNonQuery` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll).
Blocking `SqliteCommand.ExecuteScalar` inside an `async` method bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:238— `SqliteCommand.ExecuteScalar` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll).
Blocking `SqliteCommand.Execute` inside an `async` method bindings/dotnet/src/Turso.Data.Sqlite/SqliteCommand.cs:253— `SqliteCommand.Execute` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll).
Blocking `SqliteTransaction.Commit` inside an `async` method bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:102— `SqliteTransaction.Commit` is a synchronous helper that blocks (`Thread.Sleep`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll).
Blocking `TursoReplicaRegistry.ReleaseReference` inside an `async` method bindings/dotnet/src/Turso.Data/TursoReplicaRegistry.cs:68— `TursoReplicaRegistry.ReleaseReference` is a synchronous helper that blocks (`SemaphoreSlim.Wait`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll).
Blocking `TursoReplicaRegistry.DisposeHolder` inside an `async` method bindings/dotnet/src/Turso.Data/TursoReplicaRegistry.cs:146— `TursoReplicaRegistry.DisposeHolder` is a synchronous helper that blocks (`SemaphoreSlim.Wait`): called from an `async` method it parks the thread exactly as the inline call would. Make the helper `async` and `await` it (`await Task.Delay`, `SemaphoreSlim.WaitAsync`, a `TaskCompletionSource` instead of the poll).
Duplicated predicate bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs:39— `_isolationLevel == IsolationLevel.Serializable && !deferred` appears character-identically in 2 files — bindings/dotnet/src/Turso.Data.Sqlite/SqliteTransaction.cs, bindings/dotnet/src/Turso.Data/TursoTransaction.cs. 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 bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:376— `_transaction is not null && !ReferenceEquals(_transaction.Connection, connection)` appears character-identically in 2 files — bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs, bindings/dotnet/src/Turso.Data/TursoBatch.cs. 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 bindings/go/driver_db.go:844— `upper == "TIMESTAMP" || upper == "DATETIME" || upper == "DATE"` appears character-identically in 2 files — bindings/go/driver_db.go, serverless/go/driver.go. 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 bindings/dotnet/src/Turso.Data.Sqlite/ManagedSqliteStatement.cs:149— `index + 1 < sql.Length && sql[index + 1] == closing` appears character-identically in 2 files — bindings/dotnet/src/Turso.Data.Sqlite/ManagedSqliteStatement.cs, bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Storage/Internal/TursoSqliteRelationalConnection.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate REDACTED:1079— `index < sql.Length && char.IsWhiteSpace(sql[index])` appears character-identically in 2 files — REDACTED, bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Storage/Internal/TursoSqliteRelationalConnection.cs. 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 bindings/javascript/packages/common/compat.ts:39— `bindParameters.length > 1 && isQueryOptions(bindParameters[bindParameters.length - 1])` appears character-identically in 2 files — bindings/javascript/packages/common/compat.ts, bindings/javascript/packages/common/promise.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 serverless/javascript/src/session.ts:427— `entry.error?.message || 'SQL execution failed'` appears character-identically in 2 files — serverless/javascript/src/session.ts, serverless/javascript/src/statement.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 bindings/javascript/packages/common/promise.ts:807— `keyword !== undefined && TRANSACTION_CONTROL_KEYWORDS.has(keyword)` appears character-identically in 2 files — bindings/javascript/packages/common/promise.ts, serverless/javascript/src/session.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 bindings/javascript/packages/common/compat.ts:90— `options != null && typeof options === "object"` appears character-identically in 3 files — bindings/javascript/packages/common/compat.ts, bindings/javascript/packages/common/promise.ts, serverless/javascript/src/compat.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 bindings/javascript/sync/packages/native/promise.ts:146— `opts.remoteWritesExperimental && opts.url` appears character-identically in 5 files — bindings/javascript/sync/packages/native/promise.ts, bindings/javascript/sync/packages/wasm/promise-bundle.ts, bindings/javascript/sync/packages/wasm/promise-default.ts, bindings/javascript/sync/packages/wasm/promise-turbopack-hack.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 testing/simulator/simulator-docker-runner/github.ts:53— `process.env.GITHUB_APP_INSTALLATION_ID || "0"` appears character-identically in 2 files — testing/simulator/simulator-docker-runner/github.ts, testing/sqlancer/sqlancer-runner/github.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 testing/simulator/simulator-docker-runner/github.ts:51— `process.env.GITHUB_APP_PRIVATE_KEY || ""` appears character-identically in 2 files — testing/simulator/simulator-docker-runner/github.ts, testing/sqlancer/sqlancer-runner/github.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 bindings/javascript/packages/common/compat.ts:504— `stepResult === STEP_ROW && row === undefined` appears character-identically in 2 files — bindings/javascript/packages/common/compat.ts, bindings/javascript/packages/common/promise.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 bindings/javascript/packages/wasm/promise-bundle.ts:39— `this.name != null && this.#worker != null` appears character-identically in 8 files — bindings/javascript/packages/wasm/promise-bundle.ts, bindings/javascript/packages/wasm/promise-default.ts, bindings/javascript/packages/wasm/promise-turbopack-hack.ts, bindings/javascript/packages/wasm/promise-vite-dev-hack.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 bindings/javascript/sync/packages/native/promise.ts:96— `typeof opts.url != "function" || opts.url() != null` appears character-identically in 5 files — bindings/javascript/sync/packages/native/promise.ts, bindings/javascript/sync/packages/wasm/promise-bundle.ts, bindings/javascript/sync/packages/wasm/promise-default.ts, bindings/javascript/sync/packages/wasm/promise-turbopack-hack.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 bindings/javascript/packages/common/compat.ts:29— `value != null && typeof value === "object" && !Array.isArray(value) && Object.prototype.hasOwnProperty.call(value, "queryTimeout")` appears character-identically in 2 files — bindings/javascript/packages/common/compat.ts, bindings/javascript/packages/common/promise.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 REDACTED:1471— `normalized.Contains("REAL", StringComparison.Ordinal) || normalized.Contains("FLOA", StringComparison.Ordinal) || normalized.Contains("DOUB"…` appears character-identically in 2 files — REDACTED, bindings/dotnet/src/Turso.Data/TursoDataReader.cs. 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 testing/sqlright/crash_reports/collect_crashes.py:253— `args.db or Path(__file__).parent / "crashes.db"` appears character-identically in 2 files — testing/sqlright/crash_reports/collect_crashes.py, testing/sqlright/crash_reports/query_crashes.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate bindings/python/turso/lib.py:149— `c == "-" and i + 1 < n and sql[i + 1] == "-"` appears character-identically in 2 files — bindings/python/turso/lib.py, serverless/python/turso_serverless/dbapi.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate bindings/python/turso/lib.py:155— `c == "/" and i + 1 < n and sql[i + 1] == "*"` appears character-identically in 2 files — bindings/python/turso/lib.py, serverless/python/turso_serverless/dbapi.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate testing/antithesis/stress-composer/parallel_driver_nested_savepoint.py:51— `dtype == "BLOB" and get_random() % 2 == 0` appears character-identically in 2 files — testing/antithesis/stress-composer/parallel_driver_nested_savepoint.py, testing/antithesis/stress-composer/parallel_driver_savepoint.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate bindings/python/turso/lib.py:1080— `isinstance(rf, type) and issubclass(rf, Row)` appears character-identically in 2 files — bindings/python/turso/lib.py, serverless/python/turso_serverless/connection.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate bindings/python/turso/lib.py:243— `isinstance(statement, (tuple, list)) and len(statement) == 2 and isinstance(statement[0], str)` appears character-identically in 2 files — bindings/python/turso/lib.py, serverless/python/turso_serverless/connection.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate bindings/python/turso/lib.py:1183— `self._keys == value._keys and self._data == value._data` appears character-identically in 2 files — bindings/python/turso/lib.py, serverless/python/turso_serverless/dbapi.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs:449— `reader.FieldCount > 0 && await reader.ReadAsync(cancellationToken).ConfigureAwait(false)` appears character-identically in 2 files — bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs, bindings/dotnet/src/Turso.Data/TursoBatch.cs. 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.
Orphaned file bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java: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.
Orphaned file bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Statement.java: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.
Orphaned file bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java: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.
Orphaned file REDACTED: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.
Orphaned file extensions/fuzzy/src/editdist.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.
Orphaned file bindings/java/build.gradle.kts: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.
Orphaned file bindings/java/src/main/java/tech/turso/core/TursoResultSet.java: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.
Orphaned file bindings/dotnet/src/Turso.Data/TursoParameterCollection.cs: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.
Orphaned file bindings/java/src/main/java/tech/turso/core/SqliteCode.java: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.
Orphaned file bindings/java/src/main/java/tech/turso/TursoErrorCode.java: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.
Orphaned file bindings/java/src/main/java/tech/turso/utils/LoggerFactory.java: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.
Orphaned file extensions/crypto/src/lib.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.
Orphaned file bindings/java/src/main/java/tech/turso/core/TursoStepResult.java: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.
Orphaned file bindings/java/src/main/java/tech/turso/core/TursoTransactionMode.java: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.
Orphaned file bindings/java/src/main/java/tech/turso/JDBC.java: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.
Silent fallback default on Err bindings/c/src/lib.rs:2134— `sqlite3_bind_parameter_index` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err core/translate/optimizer/cost_params.rs:183— `from_env_or_default` turns every `Err` into `Self::default()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err extensions/fuzzy/src/translit.rs:492— `transliterate_str` turns every `Err` into `"?".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err sdk-kit/src/capi.rs:147— `turso_connection_last_insert_rowid` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err sdk-kit/src/capi.rs:548— `turso_statement_n_change` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err sdk-kit/src/capi.rs:575— `turso_statement_column_count` turns every `Err` into `-1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err sdk-kit/src/capi.rs:658— `turso_statement_column_array_dimensions` turns every `Err` into `0` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err sdk-kit/src/capi.rs:838— `turso_statement_named_position` turns every `Err` into `-1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err sdk-kit/src/capi.rs:855— `turso_statement_parameters_count` turns every `Err` into `-1` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default in catch bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs:657— `HandleFullReadAsync` swallows `FileNotFoundException` into `return Task.CompletedTask;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Storage/Internal/TursoSqliteDatabaseCreator.cs:85— `Exists` swallows `TursoSqliteException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Storage/Internal/TursoSqliteDatabaseCreator.cs:116— `ExistsAsync` swallows `TursoSqliteException` into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch bindings/javascript/packages/wasm-common/index.ts:116— `workerImports.lookup_file` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch bindings/javascript/packages/wasm-common/index.ts:123— `workerImports.read` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch bindings/javascript/packages/wasm-common/index.ts:130— `workerImports.write` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch bindings/javascript/packages/wasm-common/index.ts:137— `workerImports.sync` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default in catch bindings/javascript/packages/wasm-common/index.ts:152— `workerImports.size` swallows every exception into `return -1` — a data error becomes a silent behavior change with no trail. Log the failure or let it raise. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Unused export 'default' bindings/javascript/packages/wasm/index-bundle.ts:18— Nothing imports this binding — it is safe to review for removal.
Unused export 'default' bindings/javascript/packages/wasm/index-default.ts:16— Nothing imports this binding — it is safe to review for removal.
Unused export 'default' bindings/javascript/packages/wasm/index-turbopack-hack.ts:19— Nothing imports this binding — it is safe to review for removal.
Unused export 'default' bindings/javascript/packages/wasm/index-vite-dev-hack.ts:34— Nothing imports this binding — it is safe to review for removal.
Unused export 'default' bindings/javascript/sync/packages/wasm/index-bundle.ts:19— Nothing imports this binding — it is safe to review for removal.
Unused export 'default' bindings/javascript/sync/packages/wasm/index-default.ts:17— Nothing imports this binding — it is safe to review for removal.
Unused export 'default' bindings/javascript/sync/packages/wasm/index-turbopack-hack.ts:19— Nothing imports this binding — it is safe to review for removal.
Unused export 'Opfs' bindings/javascript/packages/wasm/index-bundle.ts:20— Nothing imports this binding — it is safe to review for removal.
Unused export 'Opfs' bindings/javascript/packages/wasm/index-default.ts:18— Nothing imports this binding — it is safe to review for removal.
Unused export 'Opfs' bindings/javascript/packages/wasm/index-turbopack-hack.ts:21— Nothing imports this binding — it is safe to review for removal.
Unused export 'Opfs' bindings/javascript/packages/wasm/index-vite-dev-hack.ts:36— Nothing imports this binding — it is safe to review for removal.
Unused export 'Opfs' bindings/javascript/sync/packages/wasm/index-bundle.ts:22— Nothing imports this binding — it is safe to review for removal.
Unused export 'Opfs' bindings/javascript/sync/packages/wasm/index-default.ts:20— Nothing imports this binding — it is safe to review for removal.
Unused export 'Opfs' bindings/javascript/sync/packages/wasm/index-turbopack-hack.ts:22— Nothing imports this binding — it is safe to review for removal.
Unused export 'OpfsFile' bindings/javascript/packages/wasm/index-bundle.ts:21— Nothing imports this binding — it is safe to review for removal.
Unused export 'OpfsFile' bindings/javascript/packages/wasm/index-default.ts:19— Nothing imports this binding — it is safe to review for removal.
Unused export 'OpfsFile' bindings/javascript/packages/wasm/index-turbopack-hack.ts:22— Nothing imports this binding — it is safe to review for removal.
Unused export 'OpfsFile' bindings/javascript/packages/wasm/index-vite-dev-hack.ts:37— Nothing imports this binding — it is safe to review for removal.
Unused export 'OpfsFile' bindings/javascript/sync/packages/wasm/index-bundle.ts:23— Nothing imports this binding — it is safe to review for removal.
Unused export 'OpfsFile' bindings/javascript/sync/packages/wasm/index-default.ts:21— Nothing imports this binding — it is safe to review for removal.
Unused export 'OpfsFile' bindings/javascript/sync/packages/wasm/index-turbopack-hack.ts:23— Nothing imports this binding — it is safe to review for removal.
Unused export 'Statement' bindings/javascript/packages/wasm/index-bundle.ts:22— Nothing imports this binding — it is safe to review for removal.
Unused export 'Statement' bindings/javascript/packages/wasm/index-default.ts:20— Nothing imports this binding — it is safe to review for removal.
Unused export 'Statement' bindings/javascript/packages/wasm/index-turbopack-hack.ts:23— Nothing imports this binding — it is safe to review for removal.
Unused export 'Statement' bindings/javascript/packages/wasm/index-vite-dev-hack.ts:38— Nothing imports this binding — it is safe to review for removal.
Unused export 'Statement' bindings/javascript/sync/packages/wasm/index-bundle.ts:21— Nothing imports this binding — it is safe to review for removal.
Unused export 'Statement' bindings/javascript/sync/packages/wasm/index-default.ts:19— Nothing imports this binding — it is safe to review for removal.
Unused export 'Statement' bindings/javascript/sync/packages/wasm/index-turbopack-hack.ts:21— Nothing imports this binding — it is safe to review for removal.
Subsumed condition operand testing/sqltest/src/backends/cli.rs:255— `file_name.starts_with("tursodb")` can never decide this `||` — every value satisfying `file_name.starts_with("tursodb")` also satisfies `file_name.starts_with("turso")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand testing/differential-oracle/sql_gen/src/generate/expr.rs:1008— `where_part.contains("NOT IN (SELECT")` can never decide this `||` — every value satisfying `where_part.contains("NOT IN (SELECT")` also satisfies `where_part.contains("IN (SELECT")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand testing/differential-oracle/sql_gen/src/generate/expr.rs:1079— `sql.contains(" NOT IN (SELECT")` can never decide this `||` — every value satisfying `sql.contains(" NOT IN (SELECT")` also satisfies `sql.contains(" IN (SELECT")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand REDACTED:1384— `eidx.expr_sql.contains("LOWER(union_tag(")` can never decide this `||` — every value satisfying `eidx.expr_sql.contains("LOWER(union_tag(")` also satisfies `eidx.expr_sql.contains("union_tag(")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand REDACTED:1407— `eidx.expr_sql.contains("LOWER(union_tag(")` can never decide this `||` — every value satisfying `eidx.expr_sql.contains("LOWER(union_tag(")` also satisfies `eidx.expr_sql.contains("union_tag(")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand REDACTED:1632— `eidx.expr_sql.contains("LOWER(union_tag(")` can never decide this `||` — every value satisfying `eidx.expr_sql.contains("LOWER(union_tag(")` also satisfies `eidx.expr_sql.contains("union_tag(")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 149 significant file(s) lose their only recent owner: REDACTED, testing/differential-oracle/sql_gen/src/generate/select.rs, testing/differential-oracle/sql_gen/src/ast.rs, postgres/parser/parser.rs, cli/opcodes_dictionary.rs, core/skiplist/base.rs, testing/differential-oracle/sql_gen/src/generate/stmt.rs, testing/differential-oracle/sql_gen/src/policy.rs (+141 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 7 significant file(s) lose their only recent owner: bindings/react-native/src/Database.ts, sync/sdk-kit/src/turso_async_operation.rs, bindings/javascript/sync/packages/native/turso-server.ts, bindings/react-native/src/index.ts, bindings/react-native/src/internal/asyncOperation.ts, bindings/javascript/sync/src/generator.rs, bindings/react-native/android/src/main/java/com/turso/sync/reactnative/TursoModule.java. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 4 significant file(s) lose their only recent owner: perf/fts/src/main.rs, perf/fts/plot/plot-fts.py, perf/fts/scripts/memory.py, perf/fts/src/profiling.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 5 significant file(s) lose their only recent owner: bindings/dotnet/src/Turso.Data/TursoSyncDatabase.cs, bindings/dotnet/src/Turso.Data/TursoReplicaRegistry.cs, bindings/dotnet/src/Turso.Data/TursoSyncDatabaseOptions.cs, bindings/dotnet/src/Turso.Data/TursoAutomaticSyncCoordinator.cs, bindings/dotnet/scripts/check_elf_dynsym_exports.py. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 3 significant file(s) lose their only recent owner: perf/encryption/src/main.rs, core/storage/page_transform.rs, testing/concurrent-simulator/yield_injection.rs. Pair on, review, or document these before any departure.
Fat interface: ITursoPlatformClient (49 members) bindings/dotnet/src/Turso.Platform.Client/obj/net8.0/TursoPlatformClient.generated.cs:29— `ITursoPlatformClient` declares 49 members: `ListDatabasesAsync`, `CreateDatabaseAsync`, `GetDatabaseAsync`, `DeleteDatabaseAsync`, `GetDatabaseConfigurationAsync`, `UpdateDatabaseConfigurationAsync`, `ListDatabaseInstancesAsync`, `GetDatabaseInstanceAsync`, `CreateDatabaseTokenAsync`, `GetDatabaseUsageAsync`, `GetDatabaseStatsAsync`, `InvalidateDatabaseTokensAsync`, `ListGroupsAsync`, `CreateGroupAsync`, `GetGroupAsync`, `DeleteGroupAsync`, `GetGroupConfigurationAsync`, `UpdateGroupConfigurationAsync`, `TransferGroupAsync`, `UnarchiveGroupAsync`, `AddLocationToGroupAsync`, `RemoveLocationFromGroupAsync`, `UpdateGroupDatabasesAsync`, `CreateGroupTokenAsync`, `InvalidateGroupTokensAsync`, `ListLocationsAsync`, `ListOrganizationsAsync`, `GetOrganizationAsync`, `UpdateOrganizationAsync`, `ListOrganizationPlansAsync`, `ListOrganizationInvoicesAsync`, `GetOrganizationSubscriptionAsync`, `GetOrganizationUsageAsync`, `ListOrganizationMembersAsync`, `AddOrganizationMemberAsync`, `GetOrganizationMemberAsync`, `UpdateMemberRoleAsync`, `RemoveOrganizationMemberAsync`, `ValidateAPITokenAsync`, `ListAPITokensAsync`, and 9 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: ITursoPlatformClient (49 members) bindings/dotnet/src/Turso.Platform.Client/obj/net9.0/TursoPlatformClient.generated.cs:29— `ITursoPlatformClient` declares 49 members: `ListDatabasesAsync`, `CreateDatabaseAsync`, `GetDatabaseAsync`, `DeleteDatabaseAsync`, `GetDatabaseConfigurationAsync`, `UpdateDatabaseConfigurationAsync`, `ListDatabaseInstancesAsync`, `GetDatabaseInstanceAsync`, `CreateDatabaseTokenAsync`, `GetDatabaseUsageAsync`, `GetDatabaseStatsAsync`, `InvalidateDatabaseTokensAsync`, `ListGroupsAsync`, `CreateGroupAsync`, `GetGroupAsync`, `DeleteGroupAsync`, `GetGroupConfigurationAsync`, `UpdateGroupConfigurationAsync`, `TransferGroupAsync`, `UnarchiveGroupAsync`, `AddLocationToGroupAsync`, `RemoveLocationFromGroupAsync`, `UpdateGroupDatabasesAsync`, `CreateGroupTokenAsync`, `InvalidateGroupTokensAsync`, `ListLocationsAsync`, `ListOrganizationsAsync`, `GetOrganizationAsync`, `UpdateOrganizationAsync`, `ListOrganizationPlansAsync`, `ListOrganizationInvoicesAsync`, `GetOrganizationSubscriptionAsync`, `GetOrganizationUsageAsync`, `ListOrganizationMembersAsync`, `AddOrganizationMemberAsync`, `GetOrganizationMemberAsync`, `UpdateMemberRoleAsync`, `RemoveOrganizationMemberAsync`, `ValidateAPITokenAsync`, `ListAPITokensAsync`, and 9 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: ITursoPlatformClient (49 members) bindings/dotnet/src/Turso.Platform.Client/obj/net10.0/TursoPlatformClient.generated.cs:29— `ITursoPlatformClient` declares 49 members: `ListDatabasesAsync`, `CreateDatabaseAsync`, `GetDatabaseAsync`, `DeleteDatabaseAsync`, `GetDatabaseConfigurationAsync`, `UpdateDatabaseConfigurationAsync`, `ListDatabaseInstancesAsync`, `GetDatabaseInstanceAsync`, `CreateDatabaseTokenAsync`, `GetDatabaseUsageAsync`, `GetDatabaseStatsAsync`, `InvalidateDatabaseTokensAsync`, `ListGroupsAsync`, `CreateGroupAsync`, `GetGroupAsync`, `DeleteGroupAsync`, `GetGroupConfigurationAsync`, `UpdateGroupConfigurationAsync`, `TransferGroupAsync`, `UnarchiveGroupAsync`, `AddLocationToGroupAsync`, `RemoveLocationFromGroupAsync`, `UpdateGroupDatabasesAsync`, `CreateGroupTokenAsync`, `InvalidateGroupTokensAsync`, `ListLocationsAsync`, `ListOrganizationsAsync`, `GetOrganizationAsync`, `UpdateOrganizationAsync`, `ListOrganizationPlansAsync`, `ListOrganizationInvoicesAsync`, `GetOrganizationSubscriptionAsync`, `GetOrganizationUsageAsync`, `ListOrganizationMembersAsync`, `AddOrganizationMemberAsync`, `GetOrganizationMemberAsync`, `UpdateMemberRoleAsync`, `RemoveOrganizationMemberAsync`, `ValidateAPITokenAsync`, `ListAPITokensAsync`, and 9 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: NativeStatement (22 required operations) bindings/react-native/src/types.ts:39— `NativeStatement` declares 22 required operations: `bindPositionalNull`, `bindPositionalInt`, `bindPositionalDouble`, `bindPositionalBlob`, `bindPositionalText`, `execute`, `step`, `runIo`, `reset`, `finalize`, `nChange`, `columnCount`, `columnName`, `rowValueKind`, `rowValueBytesCount`, `rowValueBytesPtr`, `rowValueText`, `rowValueInt`, `rowValueDouble`, `namedPosition`, `parametersCount`, `getAllRows`. Counted over its REQUIRED operations — a method signature or a function-typed property with no `?`, once per signature; optional members and data properties are not counted, because no implementer is forced to write them. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
IC1 · Incompleteness & stubs· Member throws NotSupportedException · ×3
Member throws NotSupportedException bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:633— `GetCustomAttributes`'s body only throws NotSupportedException — sometimes a deliberate contract, often an unfinished stub. Confirm it's intentional.
Member throws NotSupportedException bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:636— `GetCustomAttributes`'s body only throws NotSupportedException — sometimes a deliberate contract, often an unfinished stub. Confirm it's intentional.
Member throws NotSupportedException bindings/dotnet/src/Turso.EntityFrameworkCore.Sqlite/Query/Internal/TursoSqliteQueryableMethodTranslatingExpressionVisitor.cs:639— `IsDefined`'s body only throws NotSupportedException — sometimes a deliberate contract, often an unfinished stub. Confirm it's intentional.
Documentation: no build, run or usage example bindings/dotnet/src/Turso.Data/README.md:1— `Turso.Data` is a package (`IsPackable true`) and neither `bindings/dotnet/src/Turso.Data/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
Documentation: no build, run or usage example bindings/dotnet/src/Turso.Raw/README.md:1— `Turso.Raw` is a package (`IsPackable true`) and neither `bindings/dotnet/src/Turso.Raw/README.md` nor the documents it links hold a code block or a command. Show the command that builds or runs it, or a usage snippet.
Unused export 'connect' bindings/javascript/sync/packages/wasm/index-bundle.ts:24— Nothing imports this binding — it is safe to review for removal.
Unused export 'connect' bindings/javascript/sync/packages/wasm/index-default.ts:22— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'JsDataCompletion' · ×2
Unused export 'JsDataCompletion' bindings/javascript/sync/packages/wasm/index-bundle.ts:27— Nothing imports this binding — it is safe to review for removal.
Unused export 'JsDataCompletion' bindings/javascript/sync/packages/wasm/index-default.ts:25— Nothing imports this binding — it is safe to review for removal.
Unused export 'JsProtocolIo' bindings/javascript/sync/packages/wasm/index-bundle.ts:28— Nothing imports this binding — it is safe to review for removal.
Unused export 'JsProtocolIo' bindings/javascript/sync/packages/wasm/index-default.ts:26— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'JsProtocolRequestBytes' · ×2
Unused export 'JsProtocolRequestBytes' bindings/javascript/sync/packages/wasm/index-bundle.ts:29— Nothing imports this binding — it is safe to review for removal.
Unused export 'JsProtocolRequestBytes' bindings/javascript/sync/packages/wasm/index-default.ts:27— Nothing imports this binding — it is safe to review for removal.
R7 · Dead Code· Unused export 'DatabaseChangeTypeJs' · ×2
Unused export 'DatabaseChangeTypeJs' bindings/javascript/sync/packages/wasm/index-bundle.ts:31— Nothing imports this binding — it is safe to review for removal.
Unused export 'DatabaseChangeTypeJs' bindings/javascript/sync/packages/wasm/index-default.ts:29— Nothing imports this binding — it is safe to review for removal.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 5 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 (174 single-owned of 707 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; 707 of the 933 production source files in this repository met that bar). They are anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)), anonymized user #9 (1 file(s)), anonymized user #10 (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: core/io/windows_lock.rs, perf/checkpoint-bench/src/main.rs, bindings/python/turso/sqlalchemy/dialect.py, extensions/fuzzy/src/lib.rs, REDACTED.
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/`.
redundant comment bindings/dotnet/src/Turso.Platform.Client/tools/OpenApiTitler/Program.cs:103— "Resolves requestBody/response -> content -> application/json -> schema." repeats the code it sits on: 7 of its 8 words (request, body, response, content, application, json, schema) are already in `JsonObject? GetJsonSchema(JsonNode? requestBodyOrResponse)`. Delete it, or replace it with what the code cannot say (why it is done here, a constraint, or a consequence).
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 15 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: bindings/java/src/main/java/tech/turso/jdbc4/JDBC4PreparedStatement.java, bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Statement.java, bindings/java/src/main/java/tech/turso/jdbc4/JDBC4Connection.java, REDACTED, extensions/fuzzy/src/editdist.rs, bindings/java/build.gradle.kts, bindings/java/src/main/java/tech/turso/core/TursoResultSet.java, bindings/java/src/main/java/tech/turso/core/SqliteCode.java (and 7 more) (17 orphaned of 707 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; 707 of the 933 production source files in this repository met that bar). 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.
Disabled test bindings/dotnet/src/Turso.Tests/TursoTests.cs:304— A test is skipped/ignored — coverage that looks present but never runs. Re-enable it or delete it so the green run means something.
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.
P12 · CI test-gate honesty· Sleep-based test synchronization · ×1
Sleep-based test synchronization — 8 Task.Delay/Thread.Sleep call(s) in test code synchronize with background work by sleeping — a known flakiness precursor on slow runners. Prefer polling with a deadline or completion signals.
R7 · Dead Code· Unused export 'GeneratorHolder' · ×1
Unused export 'GeneratorHolder' bindings/javascript/sync/packages/wasm/index-bundle.ts:26— Nothing imports THIS copy of 'GeneratorHolder' — but bindings/javascript/sync/packages/wasm/index-default.ts:24 in the same directory exports that same name, and it is the copy every import site resolves to. Grepping the name therefore finds live callers that do not reach this binding: it is the dead half of a duplicated pair, left behind when the API moved. Delete it here and keep bindings/javascript/sync/packages/wasm/index-default.ts's, or, if this one is meant to be the survivor, repoint the importers before removing the other.
R8 · Dependency Hygiene· Test-only dependency '@libsql/client' in production deps · ×1
Test-only dependency '@libsql/client' in production deps testing/conformance/javascript/package.json:22— Only test files import it (first: testing/conformance/javascript/__test__/compat.test.js:40) — move it to devDependencies.
X2 · Cancellation propagation· Not all async methods take a CancellationToken · ×1
Not all async methods take a CancellationToken — Only 74/77 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
Null-forgiving operator (`!`) suppressions reduce the NRT score — ~0.6 `!` suppressions per 1k syntax nodes — 53 suppression(s) across the 83182 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.
Off the main sequence: @tursodatabase/database-wasm-common — @tursodatabase/database-wasm-common: abstractness 0.25, instability 0.00, distance 0.75 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 24 file(s) — `bindings/dotnet/src/Turso.Data.Sqlite/SqliteBatch.cs`, `bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.Aggregates.cs`, `bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.Collations.cs`, `bindings/dotnet/src/Turso.Data.Sqlite/SqliteConnection.Functions.cs`, `bindings/dotnet/src/Turso.Data/TursoAutomaticSyncCoordinator.cs`, … (+19 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a17666-70b1-7db3-8021-ad6c0ce9ff33 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 806 · Warnings: 3316 · Recommendations: 165 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 26-10-2026 @ 04:09 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.