Public report — lance, published 29 Sep 2026.
Concrete security findings (which rule fired, in which file, on which line; CVE IDs, secret matches,
dependency versions) are REDACTED in this version; ask the repo owner for the full report.
Public
Codebase surveyMeasured under the Code Assurance Index · rubric rubric-2026.09.18 (frozen) · verify this surveyFiledcd_2c362de438de47458dda891aea2bf109
Filed 29 September 2026, 14:55 UTC
Public
Very large · 776,549 LoC · 30 projects · rebuild ~8.3 person-years · weakest lens: Security (62%)
Findings by grade
64 critical2592 serious30 minor43 could not be resolved — could be critical — see Limitations
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
29 September 2026, 14:38 UTC
A measurement, not a certificate. The Code Assurance Index does not certify,
approve or guarantee this codebase; it records a reproducible number and the evidence it was computed from. The
standard is authored by Canine Development, who also build Watchdog — its only implementation today. That is said
here so the number is checked rather than believed.
Grounded in facts. Every number here is computed, not narrated — reproducible, tool-backed, and traceable to a line of code. How to trust this ▸
2660findings with an exact file:lineof 2686 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
49/120dimensions across the health lenses776549 LoC · 30 projects — wide & deep
⚠ A critical security finding caps this grade — resolve it before relying on the score below; see the Security lens.
The platform is a high-value asset currently rated as at risk, with a composite health score of 70%. While the underlying architecture is robust and the codebase is well-structured, significant security gaps and a persistent velocity tax threaten delivery speed and operational reliability. This standing means the business is paying a hidden premium for every change made to the system.
The system is exceptionally large, comprising nearly 780,000 lines of production code, with a rebuild effort estimated at 8.3 person-years and a cost exceeding €1.2 million. This scale concentrates risk; a failure in any component can have widespread consequences. The sheer volume of code means that even small inefficiencies compound quickly, creating a drag on the team’s ability to ship features rapidly and predictably.
The most critical issue is security exposure. With a security score of 62%, the platform faces tangible risks from known vulnerabilities and potential injection flaws. For an asset of this size, these gaps are not just technical debt but business liabilities that could lead to outages, data breaches, or compliance failures. Addressing these is not optional; it is a prerequisite for safe operation.
Second, the team faces a velocity tax. Code quality signals indicate that modifications in weaker areas cost 2–5% more effort than in clean code. This inefficiency acts as a recurring tax on every release, slowing down time-to-market and increasing long-term maintenance costs. Over time, this drag erodes competitive advantage as the team spends more time managing complexity than delivering value.
On the positive side, the architecture is strong (96%) and code health is solid (82%), providing a stable foundation. The system is mature and generally ready for production use, with good observability and testing coverage in core areas. These strengths ensure that when fixes are applied, they will be effective and sustainable.
Focus first on resolving the 22 shell-injection findings and 8 high-severity vulnerabilities. This work pays for itself within months by reducing the annual drag on engineering capacity. It is the highest-leverage action to secure the platform and restore confidence in its long-term viability.
How the score is built — each lens's share of the headlineWidth is the lens's weight in the worst-heaviest fold (the weakest area pulls hardest); colour is that lens's own band. A lens fixes the score in proportion to its width.
329 finding(s) are new versus the previous scan (2026-09-13) — surfaced by this scheduled scan itself, no pull request required. Showing the first 100; the full set is in the report.
A full-fidelity diff against the previous run's complete recorded findings — line-move tolerant: a finding that only shifted line counts as unchanged, only genuinely new titles/files surface here.
Rebuild cost & value ~ Modeled — €400,000–€2,000,000
1.0× (at 70% quality) — the last 20% of quality is most of the work
Size & shape
Very large · effort split not classified (source measured from disk; the effort-tier breakdown is a C#-only syntax walk)
This codebase represents roughly ~8.3 person-years of build effort (about ~€1,200,000 to rebuild). Its weakest lens is Security at 62% — the part of that asset most exposed by the findings below.
How we model this: boilerplate at a scaffolding rate + logic × domain Standard (×1.0) — standard service × a 1.0× quality factor, at €60–95/h; indicative, ±~30% · size measured directly from source · effort from total production LoC as straight-line logic (the tier split is a C#-only syntax walk), a conservative lower bound. Indicative only — most sensitive to the hourly rate and the domain tier (both tunable in config).
Top priorities
The highest-leverage moves; the full ranked list is in the Roadmap below.
1
Resolve the 8 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (6), REDACTED (2).
The top-ranked fix costs roughly 1–3 engineer-days once. Not doing it costs about 116–753.7 engineer-days every year, paid as drag on the ~2,261,061 lines this team changes annually — a bill that arrives whether or not anyone books it. On those figures the fix breaks even in roughly 1–2 months and is free after that. Method, stated so this is not read as a quotation: debt from the ranked task's effort band; interest = annual changed lines (measured, annualised from the 90-day window) ÷ an ASSUMED 150–400 lines per engineer-day × the 2–5% drag implied by the code-quality signals; breaking point = debt ÷ annual interest. A modelled planning range built from measured inputs and one named assumption — not a quotation, a valuation, or a certified figure.
Evidence: D15 churn: 557,522 line(s) changed over a 90-day window ⇒ ~2,261,061/year · D1/D2/D4/D6 code quality: averaging 7.2/10 ⇒ a 2–5% drag on each change · top-ranked remediation: Low effort ⇒ about 1–3 engineer-day(s)
→ Do the top-ranked fix now if this code will still be yours in 2 months.
Value concentrated against a weak lens · Medium · Value at risk
This is a Very large asset (~8.3 person-years to rebuild), and its weakest lens is Security at 62%. The operational and business risk on an asset this size concentrates there — that's where remediation buys the most protection.
→ Direct remediation budget at Security first — highest risk-reduction per euro on an asset this size.
Highest-leverage move · Medium · Leverage
Of everything flagged, the best return on effort is: Resolve the 22 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (4), REDACTED (4). The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Resolve the 22 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (4), REDACTED (4).
A velocity tax on every change · Medium · Economics
The code-quality signals (complexity, duplication, cohesion) average 7.2/10, which acts as a tax on every change in the weaker areas: modifications there plausibly cost on the order of 2–5% more than in clean code, and the tax compounds as the codebase grows. (A modelled estimate, not a measured fact.)
Evidence: D1/D2/D4/D6 code quality: averaging 7.2/10 across the code-quality signals actually measured
→ Pay it down where churn is highest — the hotspots — not everywhere; that's where the tax is actually paid.
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways — a layering smell or cycle. A clean layered graph has none.
Architecture — module dependency matrix
Rows and columns are the same modules, ordered so that a module only depends on ones above it. A cell means the row depends on the column, and its number is how many type pairs create that dependency. Read one thing: is anything above the diagonal? A mark there is a dependency cycle. (A cycle is all this shows — an unusual but cycle-free dependency sits below the diagonal like any other.)
813 modules, 2475 dependencies. 9 dependency cycles across 180 modules, marked above the diagonal.
Showing the 40 most-connected modules; 773 more are not drawn.
Module dependency matrix. The row depends on the column; the number is how many type pairs create the dependency. A cell above the diagonal is part of a dependency cycle.
lance_core.datatypes.schema uses lance_core.datatypes.field. Changing lance_core.datatypes.field can break lance_core.datatypes.schema, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
11→2 lance_core.utils.row_addr_remap depends on lance_core.deepsize✕
Type pairs
16 distinct (type in lance_core.utils.row_addr_remap → type in lance_core.deepsize) references.
lance_core.datatypes.field uses lance_core.datatypes.schema. Changing lance_core.datatypes.schema can break lance_core.datatypes.field, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
18→2 lance_index.vector.hnsw.builder depends on lance_core.deepsize✕
Type pairs
8 distinct (type in lance_index.vector.hnsw.builder → type in lance_core.deepsize) references.
lance_index.vector.hnsw.builder uses lance_core.utils.row_addr_remap. Changing lance_core.utils.row_addr_remap can break lance_index.vector.hnsw.builder, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
19→5 lance_io.scheduler depends on lance_jni.error✕
Type pairs
1 distinct (type in lance_io.scheduler → type in lance_jni.error) reference.
lance_table.format.fragment uses lance_core.datatypes.schema. Changing lance_core.datatypes.schema can break lance_table.format.fragment, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
20→13 lance_table.format.fragment depends on lance_file.version✕
Type pairs
2 distinct (type in lance_table.format.fragment → type in lance_file.version) references.
lance.dataset.mem_wal.index uses lance_index.vector.hnsw.builder. Changing lance_index.vector.hnsw.builder can break lance.dataset.mem_wal.index, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
22→3 lance_encoding.encoder depends on lance_encoding.buffer✕
Type pairs
3 distinct (type in lance_encoding.encoder → type in lance_encoding.buffer) references.
lance_file.versions.v1.writer uses lance_core.datatypes.schema. Changing lance_core.datatypes.schema can break lance_file.versions.v1.writer, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
23→15 lance_file.versions.v1.writer depends on lance_io.object_store✕
Type pairs
1 distinct (type in lance_file.versions.v1.writer → type in lance_io.object_store) reference.
lance_file.versions.v1.writer uses lance_core.datatypes.field. Changing lance_core.datatypes.field can break lance_file.versions.v1.writer, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
24→2 lance_index.vector.quantizer depends on lance_core.deepsize✕
Type pairs
5 distinct (type in lance_index.vector.quantizer → type in lance_core.deepsize) references.
lance_index.vector.quantizer uses lance_core.utils.row_addr_remap. Changing lance_core.utils.row_addr_remap can break lance_index.vector.quantizer, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
24→17 lance_index.vector.quantizer depends on lance_core.datatypes.field✕
Type pairs
1 distinct (type in lance_index.vector.quantizer → type in lance_core.datatypes.field) reference.
lance_index.vector.quantizer uses lance_core.datatypes.field. Changing lance_core.datatypes.field can break lance_index.vector.quantizer, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
25→10 lance_table.format.transaction depends on lance_core.datatypes.schema✕
Type pairs
1 distinct (type in lance_table.format.transaction → type in lance_core.datatypes.schema) reference.
lance_table.format.transaction uses lance_core.datatypes.schema. Changing lance_core.datatypes.schema can break lance_table.format.transaction, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
25→13 lance_table.format.transaction depends on lance_file.version✕
Type pairs
1 distinct (type in lance_table.format.transaction → type in lance_file.version) reference.
lance_table.format.transaction uses lance_table.format.fragment. Changing lance_table.format.fragment can break lance_table.format.transaction, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
25→30 lance_table.format.transaction depends on lance_table.format.manifestcycle✕
Type pairs
2 distinct (type in lance_table.format.transaction → type in lance_table.format.manifest) references.
lance_table.format.transaction uses lance_table.format.manifest. Changing lance_table.format.manifest can break lance_table.format.transaction, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
26→2 lance_encoding.decoder depends on lance_core.deepsize✕
Type pairs
6 distinct (type in lance_encoding.decoder → type in lance_core.deepsize) references.
lance.dataset.scanner uses lance_index.scalar.inverted.query. Changing lance_index.scalar.inverted.query can break lance.dataset.scanner, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
28→10 lance.dataset.scanner depends on lance_core.datatypes.schema✕
Type pairs
5 distinct (type in lance.dataset.scanner → type in lance_core.datatypes.schema) references.
lance_table.format.manifest uses lance_core.datatypes.schema. Changing lance_core.datatypes.schema can break lance_table.format.manifest, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
30→13 lance_table.format.manifest depends on lance_file.version✕
Type pairs
1 distinct (type in lance_table.format.manifest → type in lance_file.version) reference.
lance_table.format.manifest uses lance_table.format.fragment. Changing lance_table.format.fragment can break lance_table.format.manifest, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
30→29 lance_table.format.manifest depends on lance.dataset✕
Type pairs
2 distinct (type in lance_table.format.manifest → type in lance.dataset) references.
lance.dataset.write.merge_insert uses lance_core.datatypes.schema. Changing lance_core.datatypes.schema can break lance.dataset.write.merge_insert, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→13 lance.dataset.write.merge_insert depends on lance_file.version✕
Type pairs
4 distinct (type in lance.dataset.write.merge_insert → type in lance_file.version) references.
lance.dataset.write.merge_insert uses lance_core.datatypes.field. Changing lance_core.datatypes.field can break lance.dataset.write.merge_insert, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→20 lance.dataset.write.merge_insert depends on lance_table.format.fragment✕
Type pairs
2 distinct (type in lance.dataset.write.merge_insert → type in lance_table.format.fragment) references.
lance.dataset.write.merge_insert uses lance_table.format.fragment. Changing lance_table.format.fragment can break lance.dataset.write.merge_insert, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→25 lance.dataset.write.merge_insert depends on lance_table.format.transaction✕
Type pairs
1 distinct (type in lance.dataset.write.merge_insert → type in lance_table.format.transaction) reference.
lance.dataset.write.merge_insert uses lance_table.format.transaction. Changing lance_table.format.transaction can break lance.dataset.write.merge_insert, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
32→31 lance.dataset.write.merge_insert depends on lance.dataset.write✕
Type pairs
1 distinct (type in lance.dataset.write.merge_insert → type in lance.dataset.write) reference.
lance.index.vector.ivf.v2 uses lance_core.utils.row_addr_remap. Changing lance_core.utils.row_addr_remap can break lance.index.vector.ivf.v2, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
36→15 lance.index.vector.ivf.v2 depends on lance_io.object_store✕
Type pairs
4 distinct (type in lance.index.vector.ivf.v2 → type in lance_io.object_store) references.
lance.index.vector.ivf.v2 uses lance_index.vector.quantizer. Changing lance_index.vector.quantizer can break lance.index.vector.ivf.v2, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
36→27 lance.index.vector.ivf.v2 depends on lance_file.reader✕
Type pairs
4 distinct (type in lance.index.vector.ivf.v2 → type in lance_file.reader) references.
lance_index_core.scalar uses lance_core.utils.row_addr_remap. Changing lance_core.utils.row_addr_remap can break lance_index_core.scalar, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
37→16 lance_index_core.scalar depends on lance_select.mask✕
Type pairs
2 distinct (type in lance_index_core.scalar → type in lance_select.mask) references.
lance.index.vector.ivf uses lance_core.utils.row_addr_remap. Changing lance_core.utils.row_addr_remap can break lance.index.vector.ivf, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
38→14 lance.index.vector.ivf depends on lance_index✕
Type pairs
1 distinct (type in lance.index.vector.ivf → type in lance_index) reference.
lance.index.vector.ivf uses lance_index.vector.hnsw.builder. Changing lance_index.vector.hnsw.builder can break lance.index.vector.ivf, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
38→19 lance.index.vector.ivf depends on lance_io.scheduler✕
Type pairs
1 distinct (type in lance.index.vector.ivf → type in lance_io.scheduler) reference.
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
A03:2021 — Injection
53
High / Critical
A06:2021 — Vulnerable & Outdated Components
21
High / Critical
A05:2021 — Security Misconfiguration
4
Medium
A02:2021 — Cryptographic Failures
3
High / Critical
Roadmap
Begin by addressing the 22 shell injection vulnerabilities in static analysis, prioritizing fixes in the create-rc, create-release-branch, and publish-beta workflows. Next, resolve the eight high-severity dependency vulnerabilities, focusing first on REDACTED and REDACTED, while simultaneously remediating the 13 unpinned package installation issues in key CI/CD files. Finally, clear the remaining security debt by removing two exposed secrets from notebook history and fixing two secret interpolation issues in the file verification and java publish workflows.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 8 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (6), REDACTED (2).
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 — 64
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 — 2592
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 — 30
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 43
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. 44 of 49 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 5 documentation/naming judgement(s) are LLM-assisted and labelled advisory. 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 — 49 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, 2660 of 2686 do; the remainder are repo-wide signals — a dimension-level measurement, not a single line. (Every path in this report is repo-relative by construction: paths are normalized at the producer and the report is rejected if any rooted path leaks through.)
Is there a tool behind the number? Every score below names the method that produced it — Roslyn, git, a scanner, or (for a handful of documentation/naming dimensions) an LLM labelled sampled · advisory — not a narrative.
Does re-running give the same result? Run it again on the same commit and the score — and this report, byte for byte — is identical. A report whose numbers move between runs is describing the run, not the code.
This report answers yes to all three. That's the bar to hold any assessment to.
Tools & methods
The actual versions used this run (captured at analysis time) — re-run on the same commit for the identical score.
Method
Backs
Version
Evaluator
Roslyn static analysis
Complexity, cohesion, coupling, dead code, API surface, layering
What ran differently this time — a tool absent, degraded, or that fell back to an estimate. Named openly, not folded silently into the scores. A degraded run also records its exact cause in diagnostics.md.
D8 Code Coverage — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Coverage NOT READ here — but this repository measures it: a coverage step in CI (`codecov/codecov-action`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.py, .java, .rs), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`, or JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task, or 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. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`, or JaCoCo XML — `mvn jacoco:report` or the Gradle `jacocoTestReport` task, or 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 — then the real number is read on the next scan.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.py, .java, .rs) and this repository declares a Cargo test suite (repository root, 525 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D12 Dependency Hygiene — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Dependency Hygiene ran out of its 5-minute budget before it had finished, so what it reports here is a floor rather than a complete count. The rows above are real and stand; what is not known is how many more there are. This is a limit of the analysis run, not a finding about this repository.
AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and no container it models, or knows cannot hold a captive, was found in this repository's source, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AX2 Stateful singletons — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection singletons in C# and Spring/JSR-330/CDI singletons in Java and Kotlin only, and this repository's product is written in Python, which was left unread, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
AX6 Interface segregation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is computed over the public interfaces this run's compilations declare, and none was loaded, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
C1 Data Protection — 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. These personal data controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks personal data controls.
C2 Access Controls — 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. These authorization controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks authorization controls.
C3 Audit Trail — 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. These audit controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks audit controls.
C4 Data Retention — 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. These retention controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks retention controls.
C5 Data-Subject Rights — 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. These data-subject rights controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks data-subject rights controls.
ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check finds retry-prone mutations by walking the repository's declared types, and NONE was loaded on this run, so it had nothing to look at. That is a limit of the analyzer's reach — it reads .NET projects — not a finding that this repository has no command handlers or message consumers.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
S1 Web-Security Posture — 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. These web-security controls are read from declarative annotations, request middleware, entity/column names and guard methods in a C# source model, and none was loaded on this run, so there was nothing to gather. That is a gap in this analyzer's language reach — not a finding that the repository lacks web-security controls.
X1 Async correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X12 Unreachable branch — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X13 Undrained process stream — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X14 Bypassable address classification — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X15 Unvalidated length from an untrusted reader — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X16 Unfloored truncation loop — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X17 Uncapped recursion over a caller-supplied document — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X18 Disposal-pattern correctness — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X19 Unrestored process-global state — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X2 Cancellation propagation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X20 Mistyped argument guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X21 Side-effecting pattern guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X22 Contradicted release guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X23 Unguarded diagnostic materialisation — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X24 Document value interpolated into markup unescaped — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X25 Inert configuration knob — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X26 Unsynchronised callback handoff — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X27 Collection changed while being enumerated — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X28 Index access outside its own emptiness guard — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X29 Per-element action decided by a fixed element — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X3 Exception handling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X30 Support guard that admits what it rejects — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X32 Type resolved by simple name across every loaded assembly — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X4 Structured logging — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X5 Nullable reference types — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check is implemented over the C# syntax tree, and no C# was loaded on this run, so it had nothing to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
X7 Silent fallback defaults — 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. X7 measured this repository's Python, and its Java, Rust, TypeScript/JavaScript source is outside the check's reach, so the card covers only part of the product. That is a gap in this analyzer's language reach — not a finding that the unread source is free of silent defaults.
Repo exclusion declarations: 3 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
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").
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 is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
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.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is 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.
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 (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AC2 Forms & labels: Label association is read from static markup — a label wired up at runtime (JS-set aria-labelledby, framework-injected ids) reads as missing, a present label says nothing about whether its text is correct. A known UI-library field component (e.g. a JSX <TextField>) is now checked conservatively — flagged only when it carries NO label/aria-label/aria-labelledby/id/name — but wrapper/context-labelled libraries (Chakra/Radix FormControl+FormLabel) aren't statically visible (possible false positive) and non-JSX lowercased components are still skipped. A click handler on a plain element is now asked for a name too (it is a control the author declared), but the subtree test that answers it is deliberately generous: any DYNAMIC text expression in the subtree counts as a name, so an icon chosen by a ternary ({cond ? <IconA/> : <IconB/>}) reads as named, and a glyph component from a library the icon-import list does not know still names its parent. A clean result is "no unlabelled control found", not a labelling proof.
AC3 Page structure: Page structure is read from the static markup tree — landmarks, headings and lang injected at runtime aren't seen, heading ORDER is checked structurally (not against the rendered visual hierarchy), and lang/title/main fire only on full documents, never partials, and the data-table check sees header-cell presence (a <th> exists), not whether each header correctly associates with its cells. Static readiness, not conformance.
AC5 ARIA correctness: ARIA correctness is checked against the static role/attribute shape — roles/attributes set dynamically aren't seen, a valid role says nothing about whether it matches the element's real behaviour, and required-state checks are suppressed when a JSX spread could supply them. The two-branch toggle check (a control whose state is conveyed only by which of two mutually exclusive branches renders) reads CONDITIONALS THAT ARE ATTRIBUTES — Vue v-if/v-else/v-show and Alpine x-if/x-show — so the same toggle written as a Svelte {#if} block or a JSX ternary is control flow the markup model never projects as a branch and is not seen at all.
AC6 Visual & motion safety: Contrast and motion safety are PARTIAL by construction — literal colours (hex/rgb/hsl/named) in inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS top-level declarations are read (same-rule/same-element colour+background pairs only); computed/runtime/theme colour, external-CDN stylesheets, CSS-in-JS dynamic (${…}) and nested-selector colours, cross-element pairs and image contrast stay out of reach, so a clean result is bounded by what the static CSS itself shows.
AC7 A11y enforcement: Enforcement is scored from in-repo config/CI evidence only — an a11y gate enforced in external tooling with no in-repo trace can't be credited, and a configured linter is presence, not proof the rules actually run or block a merge.
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".
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.
The LLM boundary
LLM-set scores this run (5): D19, D21, D22, D26, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
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.
224 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Operation::eq at 238. A further 29 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 lance_arrow_scalar::serde::data_type_to_format_string at 46 — they are counted neither in the figure above nor in this dimension's score. 11 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: rust/lance-datagen/src/generator.rs (lance_datagen::generator::array::rand_type at 38), rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs (lance_bitpacking::bitpacker_internal::bitpacker4x::neon::right_shift_32 at 34), rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs (lance_bitpacking::bitpacker_internal::bitpacker8x::neon::right_shift_32 at 34), java/lance-jni/src/schema.rs (lance_jni::schema::convert_arrow_type at 33), rust/lance-file/src/versions/v1/writer/statistics.rs (StatisticsBuilder::append at 31), and 6 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.
+ 111 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 31 lance finding(s) in Cyclomatic Complexity — start with commit.rs (3), vector.rs (3), frag_reuse.rs (2). — One of this dimension's main actionable groups (31 warning-level).
Resolve the 12 Scanner finding(s) in Cyclomatic Complexity — start with scanner.rs (12). — One of this dimension's main actionable groups (12 warning-level).
Resolve the 11 lance_index finding(s) in Cyclomatic Complexity — start with index_merger.rs (3), ex_dot.rs (2), graph.rs. — One of this dimension's main actionable groups (11 warning-level).
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.
+ 193 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 74 lance finding(s) in Cognitive Complexity — start with ivf.rs (8), write.rs (6), commit.rs (6). — One of this dimension's main actionable groups (74 warning-level).
Resolve the 36 lance_index finding(s) in Cognitive Complexity — start with cross_column.rs (5), flat_search.rs (4), index_merger.rs (3). — One of this dimension's main actionable groups (36 warning-level).
Resolve the 16 Scanner finding(s) in Cognitive Complexity — start with scanner.rs (16). — One of this dimension's main actionable groups (16 warning-level).
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.8 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 166 FileTooLong finding(s) in God Classes — start with REDACTED (8), fragment.rs (4), index.rs (3). — One of this dimension's main actionable groups (166 warning-level).
Resolve the 111 MethodTooLong finding(s) in God Classes — start with scanner.rs (9), fts.rs (8), REDACTED (6). — One of this dimension's main actionable groups (111 warning-level).
Resolve the 67 ClassTooLong finding(s) in God Classes — start with REDACTED (7), fts.rs (3), namespace.rs (3). — One of this dimension's main actionable groups (67 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.
951 duplicated block group(s) detected. A further 36 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 1 of the 987 are in trees this repository does not ship — vendored, example/demo, 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.
+ 184 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 112 Duplicated block (6 lines × 2) finding(s) in Code Duplication — start with namespace.rs (39), dot.rs (4), f32.rs (4). — One of this dimension's main actionable groups (112 warning-level).
Resolve the 70 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with fts.rs (6), otel.rs (3), REDACTED (3). — One of this dimension's main actionable groups (70 warning-level).
Resolve the 66 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with dataset.rs (7), namespace.rs (4), optimize.rs (2). — One of this dimension's main actionable groups (66 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.2 / 10Stronggated by 3 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.
29 production modules (Maven+Cargo), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 3 module(s) off the main sequence, with abstractness counted on 26 of the 29 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).
Off the main sequence: fsst · ×3
What to do
Resolve the 3 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (3 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 5 Low cohesion finding(s) in Cohesion (LCOM4) — start with dataset.rs, filtered_read.rs, mask.rs. — One of this dimension's main actionable groups (5 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.
9434 test methods: 9338 unit, 96 integration, 0 BDD, 0 e2e. The Rust suite contributes 7489 `#[test]` function(s) across 525 file(s) declaring at least one; its unit/integration split is Cargo's own — 16 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 1457 test function(s) across 97 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.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: python/python/lance/dataset.py (71×78=5538); rust/lance-index/src/scalar/inverted/wand.rs (25×139=3475); rust/lance-table/src/transaction/manifest_build.rs (17×151=2567) Repeated repair below the complexity floor: rust/lance-io/src/object_store.rs (10 of 17 changes were fixes); rust/lance-linalg/src/distance/l2.rs (8 of 12 changes were fixes); rust/lance-index/src/scalar/inverted/query.rs (6 of 11 changes were fixes)
Resolve the 73 Hotspot finding(s) in Churn × Complexity Hotspots — start with index.rs (3), fts.rs (3), REDACTED (3). — One of this dimension's main actionable groups (73 warning-level).
Resolve the 16 Repeated repair finding(s) in Churn × Complexity Hotspots — start with object_store.rs, l2.rs, query.rs. — One of this dimension's main actionable groups (16 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 Factor9.3 / 10Exemplary✓ 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.
58 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is rust/lance-encoding/src/encodings/logical/primitive/sparse/writer.rs. Counted over 809 of the 1014 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 · ×3
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
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.
304 deducted task-comment markers across 776549 LoC (0.0/KLoC) → score 9.9. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 297 TodoComment finding(s) in Explicit Debt — start with primitive.rs (12), scanner.rs (11), json.rs (8). — One of this dimension's main actionable groups (297 warning-level).
Resolve the 5 FixmeComment finding(s) in Explicit Debt — start with test_dataset.py, sbbf.rs, planner.rs. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 2 HackComment finding(s) in Explicit Debt — start with vector.py, sql.rs. — One of this dimension's main actionable groups (2 warning-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: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The repository's READMEs are mostly focused on the rust/arrow-stats directory (4 of them), with each one documenting its own directory rather than the root project. The lance-arrow family of crates all share a common 'Important Note' that this crate is not intended for external usage and is internal; they appear to be part of an internal documentation set, not a cohesive project README. There is no single repository-level overview, installation, or contribution guide, so those are judged against the root README rather than these sub-READMEs. (18 of 25 sampled documents could not be assessed: 1 of 2 evaluation groups failed.)
Documentation: no project overviewrust/arrow-stats/README.md
What to do
Resolve the 1 Documentation finding(s) in Documentation Quality — start with README.md. — One of this dimension's main actionable groups (1 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.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
0 naming inconsistencies across 0 sampled symbols.
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md.
Do you agree with this assessment?
D22 · Internal API ConsistencyStrong◐ Sampled · advisory
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.
3 API inconsistencies across a 400-member sample of 1553 exposed types.
Redundant methods with identical signatures and likely identical implementation logic. The distinction between `_size` and `_size_bytes` is semantically unclear for `usize` types, suggesting copy-paste errors or legacy remnants.
Ambiguous distinction between `update_columns` and `update_columns_with_offsets`. Without documentation, it is unclear if the latter is a performance optimization, a different join strategy, or a bug-prone variant. They appear to do the same high-level operation (updating columns via join) but with a signature difference that isn't self-explanatory.
Inconsistent constructor naming pattern. While `new_inline`, `new_dedicated`, and `new_packed` follow a pattern, `new_external` breaks the pattern slightly by using a different semantic category (storage location vs storage format). More importantly, `BlobDescriptorArrayBuilder` uses `push_external` and `push_inline`/`push_dedicated`/`push_packed`, creating a naming mismatch between the builder and the file constructor for the 'external' case.
What to do
Resolve the 1 Redundant methods with identical signatures and likely identical… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Ambiguous distinction between `update_columns` and… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Inconsistent constructor naming pattern. While `new_inline`,… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d22_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.
2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
What to do
Resolve the 2 REDACTED finding(s) in Secrets (history) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 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).
53 finding(s): 0 critical, 41 high, 8 medium, 4 low. semgrep hit a parse error in 16 file(s) — `docs/theme/404.html` (lines 1–3, line 13), `docs/theme/base.html` (lines 1–8), `docs/theme/home.html` (lines 1–3, line 147), `docs/theme/main.html`, `java/mvnw` (line 86, line 121, line 131, …), … (+11 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. Separately, one or more rules could not re-parse an embedded snippet in 14 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
+ 10 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 22 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (5), REDACTED (4), REDACTED (4). — One of this dimension's main actionable groups (22 issue-level).
Resolve the 13 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (3), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (13 issue-level).
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 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.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 8 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (6), REDACTED (2). — One of this dimension's main actionable groups (8 issue-level).
Resolve the 2 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 Critical CVE 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 3 Low IaC finding(s) in IaC & Container Security — start with REDACTED (3). — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 1 Medium IaC finding(s) in IaC & Container Security — start with REDACTED. — One of this dimension's main actionable groups (1 warning-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.
26 of 809 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is benchmarks/hd-vila/datagen.py. Counted over 809 of the 1014 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Orphaned files with no living knowledge
✓ On the Gold path — maintain.
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 2 Boundary-crossing change coupling finding(s) in Change Coupling — start with __init__.py (2). — One of this dimension's main actionable groups (2 issue-level).
Resolve the 13 Change coupling finding(s) in Change Coupling — start with binary.rs (2), fixed_size_list.rs, transform.rs. — One of this dimension's main actionable groups (13 warning-level).
Resolve the 3 Change-coupling hub finding(s) in Change Coupling — start with bitmap.rs, basic.rs, binary.rs. — One of this dimension's main actionable groups (3 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.
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.
0 end-of-life runtime(s) and 0 end-of-life framework(s), read from 3 platform declaration(s) and 28 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
✓ On the Gold path — maintain.
Detailed fixes: d44_recommendation.md.
Do you agree with this assessment?
Frontend & cross-cutting dimensions
R = React/JS · M = Maturity · P = Readiness.
AC2 · Forms & labels10.0 / 10Exemplary○ Nothing flagged
Other · Accessibility — Whether form controls have a programmatic label (an associated label, aria-label or aria-labelledby), buttons have text, links have an accessible name, a click handler on a plain element names the control it declares, fieldsets have a non-empty legend, known UI-library field components carry a label prop, and a placeholder isn't used as the only label. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: inputs/selects/textareas checked for an associated label[for]/wrapping label/aria-label/aria-labelledby (per document), buttons for accessible text, fieldsets for a legend; placeholder-only labelling flagged. Deterministic, hard fact per control.
Coverage: Population: form controls, buttons, links, fieldsets and known UI-library field components in the PARSED MARKUP files only (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx); components, hidden subtrees and spread/dynamic-attribute elements are skipped, so a control whose label arrives through a spread or a runtime expression is deliberately not judged. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Do you agree with this assessment?
AC3 · Page structure7.8 / 10Strong✓ Tool-verified
Other · Accessibility — Whether pages declare a language (well-formed BCP-47) and a non-empty title, expose exactly one main landmark and a sane heading order with non-empty headings, keep zoom enabled, title their iframes, give data tables header cells, and avoid meta-refresh. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: html lang, document <title>, a main landmark and heading order on full documents only, plus zoom-disabling viewports, untitled iframes and meta-refresh anywhere. Deterministic, per structural checkpoint.
Coverage: Population: the PARSED MARKUP documents (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx). The page-level checks — lang, title, single main landmark — fire ONCE PER FULL DOCUMENT (an <html> root) and never on a partial or component fragment, so a repo of fragments is assessed only on the per-element checks (heading order, table headers, iframe titles, meta-refresh, zoom). Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en"). (×4) — RUST_THIRD_PARTY_LICENSES.html:1, REDACTED:1, java/RUST_THIRD_PARTY_LICENSES.html:1, …
A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>. (×4) — RUST_THIRD_PARTY_LICENSES.html:1, REDACTED:1, java/RUST_THIRD_PARTY_LICENSES.html:1, …
What to do
Declare <html lang>, a document <title> and a <main> landmark, keep headings in order, leave zoom enabled, title iframes and drop meta-refresh.
Other · Accessibility — Whether ARIA is used correctly — valid non-abstract roles, the ARIA state a role requires, valid (non-misspelled) aria-* attribute names, in-enum values for token-typed aria-* attributes, and no aria-hidden on (or wrapping) a focusable element. Static markup readiness, not a WCAG conformance claim.
Method: Static markup-model scan: role values checked against the WAI-ARIA role set (abstract/invalid flagged), required ARIA state for a role, and aria-hidden on a focusable element. Deterministic, role/attribute level.
Coverage: Population: elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx) that carry a role or an aria-* attribute; roles and token values are checked against the ARIA enums exhaustively within that set. An expression-valued (dynamic) role or aria-* value is skipped rather than guessed, and markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Other · Accessibility — Whether focus outlines aren't removed without a replacement, motion respects prefers-reduced-motion, and literal CSS colour pairs meet contrast — PARTIAL: inline styles, in-repo <style> blocks, in-repo .css files, var() tokens, Tailwind neutral utilities and CSS-in-JS literals are read (hex/rgb/hsl/named), never computed/runtime/external-CDN colour. Static markup readiness, not a WCAG conformance claim.
Method: Static markup/CSS scan: inline outline:none/0, literal inline colour/background contrast against the 4.5:1 AA floor, and <style>-block animation without a prefers-reduced-motion guard. Deterministic but PARTIAL — only inline styles and in-repo CSS literals are visible.
Coverage: Population: styled elements in the PARSED MARKUP files (.html/.htm/.cshtml/.razor/.vue/.svelte/.jsx/.tsx), plus in-repo <style> blocks, in-repo .css files and CSS-in-JS literals. Colour contrast is computed from LITERAL colour pairs only (hex/rgb/hsl/named, including var() tokens and Tailwind neutral utilities) — computed, runtime-themed and external-CDN colour is never resolved, so this is a partial read of contrast by construction. Markup built in script — tagged-template (html`…`) UIs and hyperscript DOM factories — is not read at all.
Do you agree with this assessment?
AC7 · A11y enforcement4.0 / 10Weak✓ Tool-verified
Other · Accessibility — Whether accessibility is ENFORCED in the toolchain — an accessibility checker configured over the markup (an a11y lint rule set, e.g. eslint-plugin-jsx-a11y or vuejs-accessibility where the project lints JavaScript) and an automated accessibility assertion wired into tests or CI (axe/pa11y/Lighthouse or an equivalent) — on the Documented→Verified→Prevented ladder.
Method: Repo config/CI scan: an accessibility checker configured over the markup (an a11y lint rule set such as eslint-plugin-jsx-a11y / vuejs-accessibility where JavaScript is linted) and an automated accessibility assertion in tests or CI (axe/pa11y/Lighthouse or equivalent), graded on the Documented→Verified→Prevented rungs. Deterministic, presence/rung detection.
Coverage: Population: the repository's own tooling configuration — lint config, test and CI files — NOT the markup. It is read for a configured accessibility checker and an automated accessibility assertion (axe/pa11y/Lighthouse, or a native-toolkit equivalent), and it credits an INVOCATION, never a mention: a licence filename, an import comment or a doc reference earns no rung. Enforcement configured entirely outside the repository leaves no evidence here and cannot be credited.
No accessibility enforcement found — no accessibility linting at author time and no automated accessibility check in tests or CI. Add your UI toolkit's own accessibility assertion to the test suite (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in the pipeline. What was searched, so you can tell an absence from a miss: the 5 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
What to do
Enforce accessibility in the toolchain your project already uses: assert accessibility in your UI test suite with your toolkit's own matcher (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in CI so a regression blocks the merge.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
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
Add a 'Testing' section to the root README — how to run the test suite.
Add a README to the 11 of 34 project(s) that lack one — worth up to 0.6 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 significant decisions one document per decision — dated, stating the context, the decision and its consequences — and keep them together wherever your design docs already live (a conventional `docs/adr/` tree, with each file named `NNNN-title` in whatever markup those docs already use, is the most discoverable form).
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.
`8. Run "cargo fmt --all" to ensure formatting is correct.` invokes cargo fmt in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:138
`- For formatting issues: Run "cargo fmt --all"` invokes cargo fmt in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:139
`- Run "cargo fmt --all" to ensure formatting is correct` invokes cargo fmt in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted. — REDACTED:143
What to do
Add `--check` to the cargo fmt step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--check` to the cargo fmt step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
Add `--check` to the cargo fmt step in `REDACTED` so a change that is not formatted fails CI, instead of being silently reformatted into a checkout that is thrown away — or, if reformatting the branch is the intent, commit the result back so the fix reaches the repository.
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.
Do you agree with this assessment?
P2 · Observability8.6 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Only 15/17 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `memtest`, `rust/lance-tools`.
What to do
Extend structured logging to the remaining runnable modules so everything you run is diagnosable in production.
Add a health-check endpoint (a /health route on your axum/actix router) so orchestrators and load balancers can probe liveness/readiness.
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
Dependabot is configured but does not watch `github-actions`, `gitsubmodule` — add those `package-ecosystem` entries to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Readiness · Readiness — Whether outbound HTTP calls are wrapped in resilience (retry/timeout/circuit-breaker) so a failing dependency doesn't cascade.
Method: Source scan: outbound HTTP clients and what bounds them — resilience handlers (Polly, AddStandardResilienceHandler) on .NET; on Go, the JVM, Python, JavaScript/TypeScript, Ruby, PHP, Rust, Elixir, Swift, Dart and Erlang, a timeout, deadline, retry or breaker beside each call, or a process-wide client default (a framework-wide deadline such as Drupal core's, Laravel's or actix's awc counts). Exhaustive, deterministic.
`urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. 4 of the 7 files that make outbound calls are unbounded; the first 4 are listed. — REDACTED:270
`requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — python/python/lance/download.py:57
`reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — rust/lance-namespace-impls/src/credentials/azure.rs:231
`reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. — rust/lance-namespace-impls/src/rest/tls.rs:77
What to do
Pass `timeout=` on every `requests`/`httpx` call (requests has no default and will wait forever), mount an `HTTPAdapter(max_retries=Retry(...))` on shared sessions, and wrap calls to flaky dependencies in `tenacity` retries or a `pybreaker` circuit breaker.
Give every client a whole-request bound: `reqwest::Client::builder().timeout(Duration::from_secs(10))` (never `reqwest::get` or `Client::new()`, which have none), ureq's `timeout_global`, or wrap the call in `tokio::time::timeout`; add retry with back-off (`reqwest-retry`'s `RetryTransientMiddleware`, `backoff`) around dependencies that fail.
Readiness · Performance — Whether 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 34 use(s) across 25,806 production line(s) (~1.3/1k). More of the idioms below on the allocation-heavy paths climbs this toward 10.
Java: on hot paths, work through buffer views (ByteBuffer/LongBuffer slices, MemorySegment) instead of copies, avoid boxing with primitive collections (fastutil, Eclipse Collections, HPPC, Trove), presize collections and StringBuilders, and pool expensive buffers (Netty's pooled allocator, commons-pool).
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) or inside a Java method returning a Reactor Mono/Flux — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Do you agree with this assessment?
WCAG coverage — what static analysis assessed
Statically assessed 10 of 55 WCAG 2.2 Level A/AA success criteria (18%; ≈20% of the 50 WCAG 2.1 AA criteria for EN 301 549). The other 45 require runtime or manual evaluation. Partial signal only (a clean result is necessary, not sufficient; static analysis fully verifies none). This is accessibility readiness, not a conformance claim — a WCAG conformance claim requires manual evaluation (WCAG-EM 1.0).
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
P12 CI test-gate honesty — 1 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.
X10 Duplicated predicate — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 4 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 — Not assessed: these audit controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks audit controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C4 Data Retention — Not assessed: these retention controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks retention controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C5 Data-Subject Rights — Not assessed: these data-subject rights controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks data-subject rights controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
P5 DR & Backup — not evidenced — repo shows no backup/RTO/RPO controls; absence of evidence is not evidence of a working control
Not included — 64 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 image/media element found in the parsed markup — AC1 not applicable here.
AC4 Keyboard semantics — No interactive element found in the parsed markup — AC4 not applicable here.
AX1 Captive dependencies — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX2 Stateful singletons — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX5 Architecture & structure — not assessed — architecture style/structure is computed from a project graph (projects, types, module namespaces) that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX6 Interface segregation — not assessed — interface segregation is computed over a type surface that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
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 18 — an image could not be pulled) — localstack Pulling localstack Error Get "https://registry-1.docker.io/v2/": Forbidden Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: localstack Pulling localstack Error Get "https://registry-1.docker.io/v2/": Forbidden Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the runtime sandbox reaches registries only through the in-fence pull-through mirror, so an image the mirror does not carry cannot be fetched — this is a limit of our sandbox, not of your stack; runtime evidence skipped This is a statement about this run, not a statement about your application: nothing here says the surface is inaccessible, only that it was never rendered.
C1 Data Protection — Not assessed: these personal data controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks personal data controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
C2 Access Controls — Not assessed: these authorization controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks authorization controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
D10 Test Quality — ~148316 lines of test source are present (.py, .java, .rs) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
D14 License Compliance — Not scored — this repository's 862 shipped crate(s) were read from its REDACTED, but crates.io could not be asked for the licence of 44 of them (HTTP 429 Unknown Error), and a licence verdict over part of a dependency graph is not a licence verdict. Nothing is asserted about this repository's licensing in either direction.
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout nor 2+ sibling source directories each declaring an aggregate root. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — No inline comments to assess — comment value is not applicable here.
D25 ADR Conformance — no ADRs to check
D27 Navigability — symbol resolution incomplete — navigability not assessed
D32 Data Compliance (PII/GDPR) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — D39 measures the IL emitted by a .NET build; this repository has no .NET solution or project files, so the dimension does not apply.
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D7 Architectural Integrity — no checkable ADRs, and no project-reference graph for the cycle pass to read — so this dimension makes no claim about dependency cycles in either direction (where this repository's language has an import-cycle lens, cycles are reported there). Architectural integrity not assessed
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (254 value object(s))
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 — This check finds retry-prone mutations (command handlers and message/event consumers) by walking the repository's declared types, and none was loaded here, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
GD1 Unfinished & placeholder code — no source files were read — this check reads C# syntax, and none was loaded for this repository. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P8 Schema migrations — no ORM, schema-migration tool or schema auto-create was found in this repository's dependency manifests or source, so there is no database schema for this check to judge
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
S1 Web-Security Posture — Not assessed: these web-security controls are read from a source model (declarative annotations, request middleware, entity/column names, guard methods) that was not loaded for this repository — because the repository is written in a language this check does not yet model, or because its projects failed to load. Absence of an idiom this check recognises is NOT evidence that this repository lacks web-security controls: it may implement them entirely in its own ecosystem. This is a gap in the analyzer's language coverage, not a finding about this repository.
X1 Async correctness — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X12 Unreachable branch — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X13 Undrained process stream — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X14 Bypassable address classification — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X15 Unvalidated length from an untrusted reader — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X16 Unfloored truncation loop — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X17 Uncapped recursion over a caller-supplied document — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X18 Disposal-pattern correctness — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X19 Unrestored process-global state — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X2 Cancellation propagation — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X20 Mistyped argument guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X21 Side-effecting pattern guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X22 Contradicted release guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X23 Unguarded diagnostic materialisation — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X24 Document value interpolated into markup unescaped — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X25 Inert configuration knob — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X26 Unsynchronised callback handoff — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X27 Collection changed while being enumerated — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X28 Index access outside its own emptiness guard — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X29 Per-element action decided by a fixed element — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X3 Exception handling — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X30 Support guard that admits what it rejects — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check reads C# syntax; no C# was loaded for this repository, so it has nothing to report. That is a limit of the analyzer, not a finding about your code.
X4 Structured logging — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X5 Nullable reference types — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X7 Silent fallback defaults — Advisory — this card reports evidence and never carries a score.
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.
<html> without a lang RUST_THIRD_PARTY_LICENSES.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang REDACTED:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang java/RUST_THIRD_PARTY_LICENSES.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
<html> without a lang python/RUST_THIRD_PARTY_LICENSES.html:1— The page declares no language, so assistive tech can't pick the right pronunciation. Add lang (e.g. lang="en").
AC3 · Page structure· Document without a <title> · ×4
Document without a <title> RUST_THIRD_PARTY_LICENSES.html:1— A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
Document without a <title> REDACTED:1— A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
Document without a <title> java/RUST_THIRD_PARTY_LICENSES.html:1— A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
Document without a <title> python/RUST_THIRD_PARTY_LICENSES.html:1— A page with no <title> gives no name in the tab, history or screen-reader page list. Add a descriptive <title> in <head>.
Boundary-crossing change coupling: __init__.py ↔ index.rs python/python/lance/indices/__init__.py— `python/python/lance/indices/__init__.py` (context python) and `rust/lance/src/index.rs` (context rust) sit in DIFFERENT parts of the tree yet change together 70% of the time (7 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `f317dd18` feat!: migrate bitmap to index segment based (#6869); `8ada2e9a` refactor!: remove index segment builder (#6997); `8962655c` feat: support segmented inverted index build and search (#6305) — run `git show` on any of them.
Boundary-crossing change coupling: __init__.py ↔ dataset.rs python/python/lance/indices/__init__.py— `python/python/lance/indices/__init__.py` (context python) and `rust/lance/src/dataset.rs` (context rust) sit in DIFFERENT parts of the tree yet change together 50% of the time (5 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) — the bounded-context boundary may be in the wrong place, or one context is leaking into the other. This is the behavioural boundary violation a static scan can't see. You can check this without leaving the row: of the 5 shared commits counted here, the most recent 3 are `f317dd18` feat!: migrate bitmap to index segment based (#6869); `57d2aad9` feat: support distributed bitmap index build (#6598); `1ef63109` refactor!: align distributed index build around segments (#6313) — run `git show` on any of them.
TodoComment java/lance-jni/src/task_tracker.rs:74— // TODO: Implement timeout-based cleanup for defense-in-depth — 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 java/lance-jni/src/lib.rs:174— // todo: add tracing — 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 java/lance-jni/src/ffi.rs:470— // TODO(lu): put get java object into here cuz can only get java Object — 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 java/src/test/java/org/lance/VectorSearchTest.java:51— // TODO: fix in https://github.com/lancedb/lance/issues/2956
TodoComment java/src/test/java/org/lance/index/ScalarIndexTest.java:712— // TODO: Verify zone_size parameter was applied — 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 java/src/test/java/org/lance/index/ScalarIndexTest.java:1858— // TODO: Verify rows_per_zone parameter was applied — 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 java/src/test/java/org/lance/namespace/RestNamespaceTest.java:342— // TODO: underlying dir namespace doesn't support rename yet... — 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 python/python/lance/fragment.py:272— # TODO: only we eliminate the path method, we can remove this — 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 python/python/lance/dataset.py:2615— # TODO: consolidate all to use scanner — 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 python/python/lance/dataset.py:3157— # TODO: python datetime supports only microsecond precision. When a — 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 python/python/lance/dataset.py:8311— # TODO add support for passing in LanceDataset and LanceScanner here — 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 REDACTED:40— # TODO: allow string_view once available? — 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 REDACTED:51— # TODO: allow string_view once available? — 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 REDACTED:45— # TODO: allow binary_view once available? — 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 REDACTED:80— # TODO: use pa.BinaryView once available? — 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 REDACTED:409— # TODO: add VariableShapeImageTensorType once pa.VariableShapeTensorArray is available — 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 REDACTED:517— # TODO: Deprecate this method once the upstream work (apache/arrow#33103)
TodoComment python/python/lance/_arrow/bf16.py:108— # TODO: encode endianness — 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 python/python/lance/_arrow/bf16.py:113— # TODO: decode endianness — 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 python/python/lance/torch/distance.py:78— # TODO: support bf16/f16 — 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 python/python/lance/torch/distance.py:123— # TODO: change this to L2 distance (which is a breaking change?) — 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 python/python/tests/test_vector_index.py:225— # TODO: _distance shouldn't be returned by default either — 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 python/python/tests/test_vector_index.py:2178— # TODO: _distance shouldn't be returned by default — 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 python/python/tests/test_scalar_index.py:3200— # TODO: I changed this into `json_get_int` for strong typed filter, should be — 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 python/python/tests/test_namespace_rest.py:394— # TODO: underlying dir namespace doesn't support rename yet... — 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.
FileTooLong: logical/primitive.rs rust/lance-encoding/src/encodings/logical/primitive.rs— FileTooLong — 5241 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 4741 over it, 10.48× 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: dataset/scanner.rs rust/lance/src/dataset/scanner.rs— FileTooLong — 4935 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 84% of them inside a single declaration: Scanner (2 blocks, 1104-8078). The bar is 500 significant lines; this is 4435 over it, 9.87× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: src/dataset.rs python/src/dataset.rs— FileTooLong — 4142 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 61% of them inside a single declaration: Dataset (4 blocks, 830-4806). The bar is 500 significant lines; this is 3642 over it, 8.28× 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: exec/fts.rs rust/lance/src/io/exec/fts.rs— FileTooLong — 4074 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 32 free functions. The bar is 500 significant lines; this is 3574 over it, 8.15× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: inverted/wand.rs rust/lance-index/src/scalar/inverted/wand.rs— FileTooLong — 3871 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 3371 over it, 7.74× 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/dir.rs rust/lance-namespace-impls/src/dir.rs— FileTooLong — 3856 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 84% of them inside a single declaration: DirectoryNamespace (5 blocks, 884-5931). The bar is 500 significant lines; this is 3356 over it, 7.71× 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: vector/ivf.rs rust/lance/src/index/vector/ivf.rs— FileTooLong — 3701 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 81 free functions. The bar is 500 significant lines; this is 3201 over it, 7.40× 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: primitive/sparse.rs rust/lance-encoding/src/encodings/logical/primitive/sparse.rs— FileTooLong — 3442 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 2942 over it, 6.88× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: lance/dataset.py python/python/lance/dataset.py— FileTooLong — 3377 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 2877 over it, 6.75× 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/blocking_dataset.rs java/lance-jni/src/blocking_dataset.rs— FileTooLong — 3302 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 169 free functions. The bar is 500 significant lines; this is 2802 over it, 6.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: dataset/blob.rs rust/lance/src/dataset/blob.rs— FileTooLong — 3176 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 60 free functions. The bar is 500 significant lines; this is 2676 over it, 6.35× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: index/fts.rs rust/lance/src/dataset/mem_wal/index/fts.rs— FileTooLong — 3156 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 50 free functions. The bar is 500 significant lines; this is 2656 over it, 6.31× 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: inverted/compound.rs rust/lance-index/src/scalar/inverted/compound.rs— FileTooLong — 2933 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 33 free functions. The bar is 500 significant lines; this is 2433 over it, 5.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/namespace.rs java/lance-jni/src/namespace.rs— FileTooLong — 2798 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 132 free functions. The bar is 500 significant lines; this is 2298 over it, 5.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/index.rs rust/lance/src/index.rs— FileTooLong — 2689 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 2189 over it, 5.38× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: dir/manifest.rs rust/lance-namespace-impls/src/dir/manifest.rs— FileTooLong — 2550 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 80% of them inside a single declaration: ManifestNamespace (4 blocks, 755-3843). The bar is 500 significant lines; this is 2050 over it, 5.10× 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: dataset/fragment.rs rust/lance/src/dataset/fragment.rs— FileTooLong — 2545 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 2045 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: scalar/btree.rs rust/lance-index/src/scalar/btree.rs— FileTooLong — 2428 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 1928 over it, 4.86× 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/dataset.rs rust/lance/src/dataset.rs— FileTooLong — 2359 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 79% of them inside a single declaration: Dataset (7 blocks, 219-4266). The bar is 500 significant lines; this is 1859 over it, 4.72× 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: exec/filtered_read.rs rust/lance/src/io/exec/filtered_read.rs— FileTooLong — 2297 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 1797 over it, 4.59× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: dataset/optimize.rs rust/lance/src/dataset/optimize.rs— FileTooLong — 2226 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 33 free functions. The bar is 500 significant lines; this is 1726 over it, 4.45× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: mem_wal/write.rs rust/lance/src/dataset/mem_wal/write.rs— FileTooLong — 2198 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 1698 over it, 4.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: vector/builder.rs rust/lance/src/index/vector/builder.rs— FileTooLong — 2185 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 80% of them inside a single declaration: IvfIndexBuilder (2 blocks, 275-2800). The bar is 500 significant lines; this is 1685 over it, 4.37× 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: write/merge_insert.rs rust/lance/src/dataset/write/merge_insert.rs— FileTooLong — 2122 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 1622 over it, 4.24× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: ivf/v2.rs rust/lance/src/index/vector/ivf/v2.rs— FileTooLong — 2119 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: IVFIndex (5 blocks, 1038-2943). The bar is 500 significant lines; this is 1619 over it, 4.24× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
Duplicated block (6 lines × 2) java/lance-jni/src/namespace.rs:3509— java/lance-jni/src/namespace.rs:3509-3514 | java/lance-jni/src/namespace.rs:3638-3643 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/utils.rs:230— java/lance-jni/src/utils.rs:230-236 | java/lance-jni/src/utils.rs:244-249 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) java/lance-jni/src/utils.rs:241— java/lance-jni/src/utils.rs:241-246 | java/lance-jni/src/utils.rs:254-262 — both copies are in the same file, so extract the block into 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) python/src/utils.rs:86— python/src/utils.rs:86-91 | python/src/utils.rs:117-122 — both copies are in the same file, so extract the block into 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) rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:356— rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:356-361 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:394-399 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/fragment.rs:1365— rust/lance/src/dataset/fragment.rs:1365-1370 | rust/lance/src/dataset/fragment.rs:1411-1416 — both copies are in the same file, so extract the block into 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) rust/lance-core/src/levenshtein.rs:18— rust/lance-core/src/levenshtein.rs:18-23 | rust/lance/src/dataset/mem_wal/index/fts.rs:570-575 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 2) rust/lance/src/dataset/mem_wal/scanner/collector.rs:198— rust/lance/src/dataset/mem_wal/scanner/collector.rs:198-203 | rust/lance/src/dataset/mem_wal/scanner/collector.rs:226-231 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1266— rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1266-1271 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:614-619 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/fts_search.rs` and `rust/lance/src/dataset/mem_wal/scanner/vector_search.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1351— rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1351-1356 | rust/lance/src/dataset/mem_wal/scanner/projection.rs:179-184 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) rust/lance/src/dataset/scanner.rs:1353— rust/lance/src/dataset/scanner.rs:1353-1361 | rust/lance/src/dataset/scanner.rs:1363-1368 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:1404— rust/lance/src/io/exec/fts.rs:1404-1409 | rust/lance/src/io/exec/fts.rs:4281-4286 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/decoder.rs:1695— rust/lance-encoding/src/decoder.rs:1695-1700 | rust/lance-encoding/src/decoder.rs:2141-2146 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/encodings/logical/primitive.rs:6137— rust/lance-encoding/src/encodings/logical/primitive.rs:6137-6142 | rust/lance-encoding/src/encodings/logical/primitive.rs:6147-6152 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/encodings/logical/primitive.rs:7030— rust/lance-encoding/src/encodings/logical/primitive.rs:7030-7035 | rust/lance-encoding/src/encodings/logical/primitive.rs:7042-7047 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/statistics.rs:286— rust/lance-encoding/src/statistics.rs:286-291 | rust/lance-encoding/src/statistics.rs:296-301 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) rust/lance-file/src/reader.rs:1457— rust/lance-file/src/reader.rs:1457-1462 | rust/lance-file/src/reader.rs:1861-1866 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/version.rs:208— rust/lance-file/src/version.rs:208-213 | rust/lance-file/src/version.rs:234-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:660— rust/lance-file/src/versions/v2_0/writer.rs:660-665 | rust/lance-file/src/writer/structural.rs:294-299 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 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) rust/lance-index/src/scalar/fmindex.rs:384— rust/lance-index/src/scalar/fmindex.rs:384-389 | rust/lance-index/src/scalar/fmindex.rs:890-895 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/cross_column.rs:222— rust/lance-index/src/scalar/inverted/cross_column.rs:222-227 | rust/lance-index/src/scalar/inverted/wand.rs:2138-2143 — 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) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:309— rust/lance-index/src/scalar/inverted/index/inverted_index.rs:309-314 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:378-383 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/index/partition.rs:332— rust/lance-index/src/scalar/inverted/index/partition.rs:332-337 | rust/lance-index/src/scalar/inverted/index/partition.rs:443-448 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:4169— rust/lance-index/src/scalar/inverted/wand.rs:4169-4174 | rust/lance-index/src/scalar/inverted/wand.rs:4204-4209 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/json.rs:568— rust/lance-index/src/scalar/json.rs:568-573 | rust/lance-index/src/scalar/json.rs:704-709 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
MethodTooLong: Transaction.build_manifest_prepared rust/lance-table/src/transaction/manifest_build.rs:585— MethodTooLong — build_manifest_prepared runs 772 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 672 over it, 7.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Operation.eq rust/lance-table/src/transaction/conflicts.rs:19— MethodTooLong — eq runs 571 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 471 over it, 5.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CreateIndexBuilder.execute_uncommitted_impl rust/lance/src/index/create.rs:161— MethodTooLong — execute_uncommitted_impl runs 372 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 272 over it, 3.72× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MergeInsertJob.update_fragments rust/lance/src/dataset/write/merge_insert.rs:1580— MethodTooLong — update_fragments 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: OrderableScalarValue.cmp rust/lance-index/src/scalar/btree.rs:139— MethodTooLong — cmp runs 350 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 250 over it, 3.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Dataset.scanner python/src/dataset.rs:1232— MethodTooLong — scanner runs 305 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 205 over it, 3.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.
MethodTooLong: Transaction.try_from rust/lance-table/src/transaction/proto.rs:86— MethodTooLong — try_from runs 270 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 170 over it, 2.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: CompoundQueryExec.execute rust/lance/src/io/exec/fts.rs:1420— MethodTooLong — execute runs 253 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 153 over it, 2.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Wand.complete_maxscore_single_essential rust/lance-index/src/scalar/inverted/wand_maxscore.rs:424— MethodTooLong — complete_maxscore_single_essential runs 251 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 151 over it, 2.51× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TransactionRebase.check_create_index_txn rust/lance/src/io/commit/conflict_resolver.rs:828— MethodTooLong — check_create_index_txn 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: Dataset.open_vector_index_from_metadata rust/lance/src/index.rs:3376— MethodTooLong — open_vector_index_from_metadata runs 239 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 139 over it, 2.39× 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: PrimitiveStructuralEncoder.encode_dense_page rust/lance-encoding/src/encodings/logical/primitive.rs:7170— MethodTooLong — encode_dense_page runs 232 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 132 over it, 2.32× 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: MergeInsertJob.execute_uncommitted_impl rust/lance/src/dataset/write/merge_insert.rs:2726— MethodTooLong — execute_uncommitted_impl 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: DecodeSparseStructuralTask.validate_value_buffers rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:3453— MethodTooLong — validate_value_buffers 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: IvfIndexBuilder.merge_partitions rust/lance/src/index/vector/builder.rs:1597— MethodTooLong — merge_partitions runs 207 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 107 over it, 2.07× 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: Scanner.vector_search rust/lance/src/dataset/scanner.rs:6102— MethodTooLong — vector_search 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: IVFIndex.search_partitions rust/lance/src/index/vector/ivf/v2.rs:2318— MethodTooLong — search_partitions runs 204 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 104 over it, 2.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: PyLance.into_pyobject python/src/transaction.rs:659— MethodTooLong — into_pyobject runs 203 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 103 over it, 2.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Dataset.create_index python/src/dataset.rs:2601— MethodTooLong — create_index runs 198 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 98 over it, 1.98× 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: Transaction.from rust/lance-table/src/transaction/proto.rs:493— MethodTooLong — from runs 196 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 96 over it, 1.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: IvfIndexBuilder.build_partitions rust/lance/src/index/vector/builder.rs:999— MethodTooLong — build_partitions runs 192 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 92 over it, 1.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LanceStream.try_new_v2 rust/lance/src/io/exec/scan.rs:179— MethodTooLong — try_new_v2 runs 191 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 91 over it, 1.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Planner.parse_sql_expr rust/lance-datafusion/src/planner.rs:683— MethodTooLong — parse_sql_expr runs 190 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 90 over it, 1.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: CleanupTask.delete_unreferenced_files rust/lance/src/dataset/cleanup.rs:697— MethodTooLong — delete_unreferenced_files runs 187 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 87 over it, 1.87× 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: PackedStructVariablePerValueDecompressor.decompress rust/lance-encoding/src/encodings/physical/packed.rs:607— MethodTooLong — decompress runs 184 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 84 over it, 1.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
lance::dataset::optimize::binary_copy::rewrite_files_binary_copy (cognitive 108) rust/lance/src/dataset/optimize/binary_copy.rs:124— lance::dataset::optimize::binary_copy::rewrite_files_binary_copy has cognitive complexity 108 (threshold 15). Drivers by points: if/else 18 (61 pts), loops 11 (45 pts), boolean chains 2 (nesting depth added 77). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::index::append::merge_indices_with_unindexed_frags (cognitive 103) rust/lance/src/index/append.rs:836— lance::index::append::merge_indices_with_unindexed_frags has cognitive complexity 103 (threshold 15). Drivers by points: if/else 35 (73 pts), boolean chains 14, loops 5 (11 pts), match/switch 2 (5 pts) (nesting depth added 47). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::index::frag_reuse::build_frag_reuse_rewrite_entry (cognitive 81) rust/lance/src/index/frag_reuse.rs:1155— lance::index::frag_reuse::build_frag_reuse_rewrite_entry has cognitive complexity 81 (threshold 15). Drivers by points: if/else 28 (58 pts), loops 10 (14 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 36). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::dataset::write::do_write_fragments_impl (cognitive 65) rust/lance/src/dataset/write.rs:919— lance::dataset::write::do_write_fragments_impl has cognitive complexity 65 (threshold 15). Drivers by points: if/else 20 (51 pts), loops 4 (10 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 38). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::dataset::optimize::commit_compaction (cognitive 61) rust/lance/src/dataset/optimize.rs:3156— lance::dataset::optimize::commit_compaction has cognitive complexity 61 (threshold 15). Drivers by points: if/else 29 (44 pts), boolean chains 6, loops 3 (6 pts), match/switch 2 (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.
lance::io::commit::commit_transaction (cognitive 48) rust/lance/src/io/commit.rs:1576— lance::io::commit::commit_transaction has cognitive complexity 48 (threshold 15). Drivers by points: if/else 14 (28 pts), match/switch 5 (13 pts), loops 2 (4 pts), boolean chains 3 (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.
lance::dataset::take::do_take_rows (cognitive 43) rust/lance/src/dataset/take.rs:131— lance::dataset::take::do_take_rows has cognitive complexity 43 (threshold 15). Drivers by points: if/else 20 (37 pts), loops 2 (5 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.
lance::index::scalar::index_matches_criteria (cognitive 42) rust/lance/src/index/scalar.rs:749— lance::index::scalar::index_matches_criteria has cognitive complexity 42 (threshold 15). Drivers by points: if/else 19 (38 pts), boolean chains 4 (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.
lance::dataset::optimize::rewrite_files (cognitive 42) rust/lance/src/dataset/optimize.rs:2443— lance::dataset::optimize::rewrite_files has cognitive complexity 42 (threshold 15). Drivers by points: if/else 20 (28 pts), match/switch 3 (6 pts), boolean chains 5, loops 1 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::io::commit::do_commit_new_dataset (cognitive 41) rust/lance/src/io/commit.rs:410— lance::io::commit::do_commit_new_dataset has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 2 (7 pts), match/switch 3 (5 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::dataset::optimize::remapping::remap_index (cognitive 39) rust/lance/src/dataset/optimize/remapping.rs:204— lance::dataset::optimize::remapping::remap_index has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 4 (11 pts), match/switch 3, boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::dataset::versions::check_manifest_storage_contract (cognitive 38) rust/lance/src/dataset/versions/mod.rs:383— lance::dataset::versions::check_manifest_storage_contract has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (18 pts), boolean chains 9, match/switch 3 (8 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::dataset::schema_evolution::alter_columns (cognitive 37) rust/lance/src/dataset/schema_evolution.rs:836— lance::dataset::schema_evolution::alter_columns has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (28 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::io::exec::count_pushdown::try_rewrite (cognitive 37) rust/lance/src/io/exec/count_pushdown.rs:107— lance::io::exec::count_pushdown::try_rewrite has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (29 pts), match/switch 4, boolean chains 3, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::index::frag_reuse::validate_folded_deletions (cognitive 37) rust/lance/src/index/frag_reuse.rs:682— lance::index::frag_reuse::validate_folded_deletions has cognitive complexity 37 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 6 (11 pts), match/switch 5 (11 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.
lance::index::vector::ivf::train_weighted_hierarchical_f32_kmeans (cognitive 36) rust/lance/src/index/vector/ivf.rs:4376— lance::index::vector::ivf::train_weighted_hierarchical_f32_kmeans has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (24 pts), loops 7 (10 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.
lance::dataset::write::validate_and_resolve_target_bases_with_primary (cognitive 35) rust/lance/src/dataset/write.rs:1426— lance::dataset::write::validate_and_resolve_target_bases_with_primary has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (28 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::dataset::mem_wal::index::fts::score_terms (cognitive 34) rust/lance/src/dataset/mem_wal/index/fts.rs:3082— lance::dataset::mem_wal::index::fts::score_terms has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::blob::validate_prepared_blob_value_array (cognitive 32) rust/lance/src/blob.rs:379— lance::blob::validate_prepared_blob_value_array has cognitive complexity 32 (threshold 15). Drivers by points: if/else 12 (26 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::dataset::rowids::validate::validate_stable_row_ids (cognitive 31) rust/lance/src/dataset/rowids/validate.rs:27— lance::dataset::rowids::validate::validate_stable_row_ids has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 4 (6 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::index::frag_reuse_reader::load_indices (cognitive 31) rust/lance/src/index/frag_reuse_reader.rs:36— lance::index::frag_reuse_reader::load_indices has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance::index::vector::ivf::initialize_weighted_centroids (cognitive 30) rust/lance/src/index/vector/ivf.rs:4039— lance::index::vector::ivf::initialize_weighted_centroids has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 5 (9 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.
lance::dataset::mem_wal::index::fts::phrase_search_tail (cognitive 30) rust/lance/src/dataset/mem_wal/index/fts.rs:3168— lance::dataset::mem_wal::index::fts::phrase_search_tail has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 4 (7 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.
lance::index::vector::ivf::io::write_pq_partitions (cognitive 29) rust/lance/src/index/vector/ivf/io.rs:206— lance::index::vector::ivf::io::write_pq_partitions has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (6 pts), match/switch 1 (3 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.
lance::dataset::schema_evolution::add_columns_from_stream (cognitive 28) rust/lance/src/dataset/schema_evolution.rs:735— lance::dataset::schema_evolution::add_columns_from_stream has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (9 pts), match/switch 2 (4 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.
Hotspot: python/python/lance/dataset.py python/python/lance/dataset.py:3924— python/python/lance/dataset.py changed 71 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 78 in LanceDataset._create_index_impl at line 3924. 26 of those changes were fix/bug commits, and the other 45 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- python/python/lance/dataset.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: rust/lance-index/src/scalar/inverted/wand.rs rust/lance-index/src/scalar/inverted/wand.rs:4083— rust/lance-index/src/scalar/inverted/wand.rs changed 25 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 139 in Wand::and_bulk_search at line 4083. 4 of those changes were fix/bug commits, and the other 21 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-index/src/scalar/inverted/wand.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: rust/lance-table/src/transaction/manifest_build.rs rust/lance-table/src/transaction/manifest_build.rs:585— rust/lance-table/src/transaction/manifest_build.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 151 in Transaction::build_manifest_prepared at line 585. 5 of those changes were fix/bug commits, and the other 12 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-table/src/transaction/manifest_build.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: python/src/dataset.rs python/src/dataset.rs:1232— python/src/dataset.rs changed 38 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 66 in Dataset::scanner at line 1232. 6 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- python/src/dataset.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: rust/lance/src/dataset/scanner.rs rust/lance/src/dataset/scanner.rs:6102— rust/lance/src/dataset/scanner.rs changed 67 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in Scanner::vector_search at line 6102. 27 of those changes were fix/bug commits, and the other 40 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/dataset/scanner.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: rust/lance/src/dataset/optimize.rs rust/lance/src/dataset/optimize.rs:3156— rust/lance/src/dataset/optimize.rs changed 48 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in lance::dataset::optimize::commit_compaction at line 3156. 18 of those changes were fix/bug commits, and the other 30 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/dataset/optimize.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: rust/lance/src/dataset.rs rust/lance/src/dataset.rs:2262— rust/lance/src/dataset.rs changed 66 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in Dataset::create_data_file at line 2262. 23 of those changes were fix/bug commits, and the other 43 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/dataset.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: rust/lance/src/index/vector/ivf/v2.rs rust/lance/src/index/vector/ivf/v2.rs:2318— rust/lance/src/index/vector/ivf/v2.rs changed 39 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in IVFIndex::search_partitions at line 2318. 11 of those changes were fix/bug commits, and the other 28 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/index/vector/ivf/v2.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: rust/lance/src/index.rs rust/lance/src/index.rs:2095— rust/lance/src/index.rs changed 46 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in Dataset::merge_existing_index_segments at line 2095. 19 of those changes were fix/bug commits, and the other 27 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/index.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: rust/lance/src/dataset/write/merge_insert.rs rust/lance/src/dataset/write/merge_insert.rs:1580— rust/lance/src/dataset/write/merge_insert.rs changed 33 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 34 in MergeInsertJob::update_fragments at line 1580. 16 of those changes were fix/bug commits, and the other 17 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/dataset/write/merge_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: rust/lance/src/io/commit/conflict_resolver.rs rust/lance/src/io/commit/conflict_resolver.rs:828— rust/lance/src/io/commit/conflict_resolver.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in TransactionRebase::check_create_index_txn at line 828. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/io/commit/conflict_resolver.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: rust/lance-index/src/scalar/zonemap.rs rust/lance-index/src/scalar/zonemap.rs:241— rust/lance-index/src/scalar/zonemap.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in ZoneMapIndex::evaluate_zone_against_query at line 241. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-index/src/scalar/zonemap.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: rust/lance/src/dataset/fragment.rs rust/lance/src/dataset/fragment.rs:1765— rust/lance/src/dataset/fragment.rs changed 42 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in FileFragment::validate at line 1765. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/dataset/fragment.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: rust/lance-encoding/src/encodings/logical/primitive.rs rust/lance-encoding/src/encodings/logical/primitive.rs:7170— rust/lance-encoding/src/encodings/logical/primitive.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in PrimitiveStructuralEncoder::encode_dense_page at line 7170. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-encoding/src/encodings/logical/primitive.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: rust/lance-index/src/vector/distributed/index_merger.rs rust/lance-index/src/vector/distributed/index_merger.rs:862— rust/lance-index/src/vector/distributed/index_merger.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 124 in lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner at line 862. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-index/src/vector/distributed/index_merger.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: rust/lance/src/io/exec/fts.rs rust/lance/src/io/exec/fts.rs:1420— rust/lance/src/io/exec/fts.rs changed 36 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in CompoundQueryExec::execute at line 1420. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/io/exec/fts.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: rust/lance/src/index/append.rs rust/lance/src/index/append.rs:836— rust/lance/src/index/append.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 50 in lance::index::append::merge_indices_with_unindexed_frags at line 836. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/index/append.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: rust/lance/src/index/create.rs rust/lance/src/index/create.rs:161— rust/lance/src/index/create.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in CreateIndexBuilder::execute_uncommitted_impl at line 161. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/index/create.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: rust/lance/src/io/commit.rs rust/lance/src/io/commit.rs:1576— rust/lance/src/io/commit.rs changed 34 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in lance::io::commit::commit_transaction at line 1576. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/io/commit.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: rust/lance/src/dataset/write.rs rust/lance/src/dataset/write.rs:919— rust/lance/src/dataset/write.rs changed 31 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in lance::dataset::write::do_write_fragments_impl at line 919. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/dataset/write.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: rust/lance/src/dataset/blob.rs rust/lance/src/dataset/blob.rs:1122— rust/lance/src/dataset/blob.rs changed 29 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in BlobPreprocessor::logical_to_prepared_blob_array at line 1122. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/dataset/blob.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: rust/lance-namespace-impls/src/dir.rs rust/lance-namespace-impls/src/dir.rs:2062— rust/lance-namespace-impls/src/dir.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in DirectoryNamespace::describe_table_impl at line 2062. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-namespace-impls/src/dir.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: rust/lance-datafusion/src/expr.rs rust/lance-datafusion/src/expr.rs:108— rust/lance-datafusion/src/expr.rs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 211 in lance_datafusion::expr::safe_coerce_scalar at line 108. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-datafusion/src/expr.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: rust/lance/src/dataset/cleanup.rs rust/lance/src/dataset/cleanup.rs:697— rust/lance/src/dataset/cleanup.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in CleanupTask::delete_unreferenced_files at line 697. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/dataset/cleanup.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: rust/lance/src/dataset/versions/mod.rs rust/lance/src/dataset/versions/mod.rs:383— rust/lance/src/dataset/versions/mod.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 28 in lance::dataset::versions::check_manifest_storage_contract at line 383. 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-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/dataset/versions/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.
Duplicated block (8 lines × 2) java/lance-jni/src/blocking_dataset.rs:2541— java/lance-jni/src/blocking_dataset.rs:2541-2548 | java/lance-jni/src/blocking_dataset.rs:2593-2600 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/file_reader.rs:114— java/lance-jni/src/file_reader.rs:114-121 | java/lance-jni/src/file_writer.rs:97-104 — 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) java/lance-jni/src/mem_wal.rs:172— java/lance-jni/src/mem_wal.rs:172-179 | java/lance-jni/src/mem_wal.rs:195-202 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) java/lance-jni/src/otel.rs:110— java/lance-jni/src/otel.rs:110-117 | python/src/otel.rs:158-165 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 115 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) java/lance-jni/src/otel.rs:386— java/lance-jni/src/otel.rs:386-393 | python/src/otel.rs:339-346 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 115 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) java/lance-jni/src/vector_trainer.rs:116— java/lance-jni/src/vector_trainer.rs:116-123 | java/lance-jni/src/vector_trainer.rs:179-186 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) python/src/fragment.rs:168— python/src/fragment.rs:168-175 | python/src/fragment.rs:196-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:226— rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:226-233 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:239-246 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/compression/fsst/src/fsst.rs:1216— rust/compression/fsst/src/fsst.rs:1216-1223 | rust/compression/fsst/src/fsst.rs:1355-1362 — both copies are in the same file, so extract the block into 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) rust/lance/src/bin/fm_contains_bench.rs:166— rust/lance/src/bin/fm_contains_bench.rs:166-173 | rust/lance/src/bin/fm_index_tool.rs:55-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 (8 lines × 2) rust/lance/src/dataset/mem_wal/index/btree.rs:446— rust/lance/src/dataset/mem_wal/index/btree.rs:446-453 | rust/lance/src/dataset/mem_wal/index/btree.rs:642-649 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/index/flat_search.rs:931— rust/lance-index/src/scalar/inverted/index/flat_search.rs:931-938 | rust/lance/src/dataset/mem_wal/index/fts.rs:621-628 — 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) rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:980— rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:980-987 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:819-826 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs` and `rust/lance/src/dataset/mem_wal/scanner/builder.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) rust/lance/src/dataset/write/merge_insert/exec/delete.rs:73— rust/lance/src/dataset/write/merge_insert/exec/delete.rs:73-80 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:264-271 — before extracting anything, compare `rust/lance/src/dataset/write/merge_insert/exec/delete.rs` and `rust/lance/src/dataset/write/merge_insert/exec/write.rs` as WHOLE FILES: this scan already matched 7 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 × 2) rust/lance/src/dataset/write/merge_insert/exec/delete.rs:240— rust/lance/src/dataset/write/merge_insert/exec/delete.rs:240-247 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:870-877 — before extracting anything, compare `rust/lance/src/dataset/write/merge_insert/exec/delete.rs` and `rust/lance/src/dataset/write/merge_insert/exec/write.rs` as WHOLE FILES: this scan already matched 7 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 × 2) rust/lance/src/index/frag_reuse.rs:731— rust/lance/src/index/frag_reuse.rs:731-738 | rust/lance/src/index/frag_reuse_reader/cache.rs:171-178 — 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) rust/lance/src/index/scalar.rs:396— rust/lance/src/index/scalar.rs:396-403 | rust/lance/src/index/scalar.rs:469-476 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/ivf.rs:1073— rust/lance/src/index/vector/ivf.rs:1073-1080 | rust/lance/src/index/vector/ivf.rs:1164-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 (8 lines × 2) rust/lance/src/io/exec/fts.rs:313— rust/lance/src/io/exec/fts.rs:313-320 | rust/lance/src/io/exec/fts.rs:380-387 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:821— rust/lance/src/io/exec/fts.rs:821-828 | rust/lance/src/io/exec/fts.rs:1890-1897 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:2174— rust/lance/src/io/exec/fts.rs:2174-2181 | rust/lance/src/io/exec/fts.rs:2197-2204 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:2259— rust/lance/src/io/exec/fts.rs:2259-2266 | rust/lance/src/io/exec/fts.rs:2285-2292 — both copies are in the same file, so extract the block into 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) rust/lance-table/src/transaction/manifest_build.rs:1140— rust/lance-table/src/transaction/manifest_build.rs:1140-1147 | rust/lance/src/io/exec/fts.rs:2441-2448 — 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) rust/lance/src/io/exec/fts.rs:3264— rust/lance/src/io/exec/fts.rs:3264-3271 | rust/lance/src/io/exec/fts.rs:5129-5136 — both copies are in the same file, so extract the block into 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) rust/lance-core/src/datatypes/schema.rs:239— rust/lance-core/src/datatypes/schema.rs:239-246 | rust/lance-core/src/datatypes/schema.rs:565-572 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
ClassTooLong: Scanner rust/lance/src/dataset/scanner.rs:1104— ClassTooLong — 4139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 161 methods, 2 blocks, lines 1104-8078. The bar is 400 significant lines; this is 3739 over it, 10.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: DirectoryNamespace rust/lance-namespace-impls/src/dir.rs:884— ClassTooLong — 3250 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 64 methods, 5 blocks, lines 884-5931. The bar is 400 significant lines; this is 2850 over it, 8.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Dataset python/src/dataset.rs:830— ClassTooLong — 2513 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 125 methods, 4 blocks, lines 830-4806. The bar is 400 significant lines; this is 2113 over it, 6.28× 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: ManifestNamespace rust/lance-namespace-impls/src/dir/manifest.rs:755— ClassTooLong — 2040 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 66 methods, 4 blocks, lines 755-3843. The bar is 400 significant lines; this is 1640 over it, 5.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.
ClassTooLong: Dataset rust/lance/src/dataset.rs:219— ClassTooLong — 1872 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 153 methods, 7 blocks, lines 219-4266. The bar is 400 significant lines; this is 1472 over it, 4.68× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: IvfIndexBuilder rust/lance/src/index/vector/builder.rs:275— ClassTooLong — 1750 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 42 methods, 2 blocks, lines 275-2800. The bar is 400 significant lines; this is 1350 over it, 4.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TransactionRebase rust/lance/src/io/commit/conflict_resolver.rs:35— ClassTooLong — 1685 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 2 blocks, lines 35-2782. The bar is 400 significant lines; this is 1285 over it, 4.21× 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: SparseStructuralScheduler rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:1157— ClassTooLong — 1497 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 49 methods, 3 blocks, lines 1157-3162. The bar is 400 significant lines; this is 1097 over it, 3.74× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PrimitiveStructuralEncoder rust/lance-encoding/src/encodings/logical/primitive.rs:5530— ClassTooLong — 1454 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, 3 blocks, lines 5530-8019. The bar is 400 significant lines; this is 1054 over it, 3.64× 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: IVFIndex rust/lance/src/index/vector/ivf/v2.rs:1038— ClassTooLong — 1379 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, 5 blocks, lines 1038-2943. The bar is 400 significant lines; this is 979 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: FileFragment rust/lance/src/dataset/fragment.rs:96— ClassTooLong — 1306 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 96-3036. The bar is 400 significant lines; this is 906 over it, 3.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MergeInsertJob rust/lance/src/dataset/write/merge_insert.rs:664— ClassTooLong — 1231 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 2 blocks, lines 664-3225. The bar is 400 significant lines; this is 831 over it, 3.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FtsMemIndex rust/lance/src/dataset/mem_wal/index/fts.rs:1190— ClassTooLong — 1003 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, 3 blocks, lines 1190-2848. The bar is 400 significant lines; this is 603 over it, 2.51× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: JavaLanceNamespace java/lance-jni/src/namespace.rs:159— ClassTooLong — 981 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 5 blocks, lines 159-1520. The bar is 400 significant lines; this is 581 over it, 2.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: RestNamespace rust/lance-namespace-impls/src/rest.rs:525— ClassTooLong — 868 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 5 blocks, lines 525-1657. The bar is 400 significant lines; this is 468 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.
ClassTooLong: FileReader rust/lance-file/src/reader.rs:452— ClassTooLong — 831 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 49 methods, 3 blocks, lines 452-2156. The bar is 400 significant lines; this is 431 over it, 2.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FilteredReadStream rust/lance/src/io/exec/filtered_read.rs:440— ClassTooLong — 775 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 3 blocks, lines 440-1725. The bar is 400 significant lines; this is 375 over it, 1.94× 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: Field rust/lance-core/src/datatypes/field.rs:137— ClassTooLong — 738 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 47 methods, 5 blocks, lines 137-1325. The bar is 400 significant lines; this is 338 over it, 1.85× 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: RabitDistCalculator rust/lance-index/src/vector/bq/storage.rs:874— ClassTooLong — 718 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 16 methods, 3 blocks, lines 874-2050. The bar is 400 significant lines; this is 318 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ObjectStore rust/lance-io/src/object_store.rs:203— ClassTooLong — 711 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 49 methods, 6 blocks, lines 203-1876. The bar is 400 significant lines; this is 311 over it, 1.78× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: FilteredReadExec rust/lance/src/io/exec/filtered_read.rs:2039— ClassTooLong — 710 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 15 methods, 4 blocks, lines 2039-3597. The bar is 400 significant lines; this is 310 over it, 1.78× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: InvertedIndex rust/lance-index/src/scalar/inverted/index/inverted_index.rs:19— ClassTooLong — 692 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 55 methods, 8 blocks, lines 19-1010. The bar is 400 significant lines; this is 292 over it, 1.73× 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: CleanupTask rust/lance/src/dataset/cleanup.rs:296— ClassTooLong — 687 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 12 methods, 2 blocks, lines 296-1409. The bar is 400 significant lines; this is 287 over it, 1.72× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BTreeIndex rust/lance-index/src/scalar/btree.rs:1618— ClassTooLong — 686 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 18 methods, 5 blocks, lines 1618-2790. The bar is 400 significant lines; this is 286 over it, 1.72× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MemTableFlusher rust/lance/src/dataset/mem_wal/memtable/flush.rs:69— ClassTooLong — 679 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 20 methods, 2 blocks, lines 69-1191. The bar is 400 significant lines; this is 279 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
FunctionTooLong: lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner rust/lance-index/src/vector/distributed/index_merger.rs:862— FunctionTooLong — lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner runs 619 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 519 over it, 6.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: lance::index::append::merge_indices_with_unindexed_frags rust/lance/src/index/append.rs:836— FunctionTooLong — lance::index::append::merge_indices_with_unindexed_frags runs 505 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 405 over it, 5.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: lance_datafusion::expr::safe_coerce_scalar rust/lance-datafusion/src/expr.rs:108— FunctionTooLong — lance_datafusion::expr::safe_coerce_scalar 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.
FunctionTooLong: lance_jni::transaction::convert_to_rust_operation java/lance-jni/src/transaction.rs:1682— FunctionTooLong — lance_jni::transaction::convert_to_rust_operation runs 345 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 245 over it, 3.45× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: lance_jni::transaction::convert_to_java_operation_inner java/lance-jni/src/transaction.rs:877— FunctionTooLong — lance_jni::transaction::convert_to_java_operation_inner runs 287 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 187 over it, 2.87× 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: lance::index::vector::build_distributed_vector_index rust/lance/src/index/vector.rs:793— FunctionTooLong — lance::index::vector::build_distributed_vector_index runs 276 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 176 over it, 2.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: lance::dataset::optimize::commit_compaction rust/lance/src/dataset/optimize.rs:3156— FunctionTooLong — lance::dataset::optimize::commit_compaction runs 256 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 156 over it, 2.56× 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: lance::dataset::optimize::rewrite_files rust/lance/src/dataset/optimize.rs:2443— FunctionTooLong — lance::dataset::optimize::rewrite_files runs 251 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 151 over it, 2.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: lance_index::scalar::inverted::cross_column::cross_column_compound_search rust/lance-index/src/scalar/inverted/cross_column.rs:1344— FunctionTooLong — lance_index::scalar::inverted::cross_column::cross_column_compound_search runs 244 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 144 over it, 2.44× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: lance::index::frag_reuse::build_frag_reuse_rewrite_entry rust/lance/src/index/frag_reuse.rs:1155— FunctionTooLong — lance::index::frag_reuse::build_frag_reuse_rewrite_entry runs 243 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 143 over it, 2.43× 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: lance::index::vector::build_vector_index_impl rust/lance/src/index/vector.rs:1201— FunctionTooLong — lance::index::vector::build_vector_index_impl runs 234 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 134 over it, 2.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: lance::index::vector::ivf::optimize_vector_indices_v2 rust/lance/src/index/vector/ivf.rs:772— FunctionTooLong — lance::index::vector::ivf::optimize_vector_indices_v2 runs 219 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 119 over it, 2.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: lance::dataset::schema_evolution::alter_columns rust/lance/src/dataset/schema_evolution.rs:836— FunctionTooLong — lance::dataset::schema_evolution::alter_columns runs 212 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 112 over it, 2.12× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: lance::io::commit::commit_transaction rust/lance/src/io/commit.rs:1576— FunctionTooLong — lance::io::commit::commit_transaction 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.
FunctionTooLong: lance::dataset::optimize::binary_copy::rewrite_files_binary_copy rust/lance/src/dataset/optimize/binary_copy.rs:124— FunctionTooLong — lance::dataset::optimize::binary_copy::rewrite_files_binary_copy runs 204 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 104 over it, 2.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.
FunctionTooLong: lance::index::vector::build_vector_index_incremental rust/lance/src/index/vector.rs:1489— FunctionTooLong — lance::index::vector::build_vector_index_incremental runs 204 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 104 over it, 2.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.
FunctionTooLong: lance::io::commit::do_commit_new_dataset rust/lance/src/io/commit.rs:410— FunctionTooLong — lance::io::commit::do_commit_new_dataset runs 197 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: lance::dataset::take::do_take_rows rust/lance/src/dataset/take.rs:131— FunctionTooLong — lance::dataset::take::do_take_rows runs 193 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: lance_index::scalar::inverted::index::flat_search::tokenize_and_count rust/lance-index/src/scalar/inverted/index/flat_search.rs:223— FunctionTooLong — lance_index::scalar::inverted::index::flat_search::tokenize_and_count runs 189 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 89 over it, 1.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: lance::index::vector::ivf::train_streaming_coreset_ivf_model rust/lance/src/index/vector/ivf.rs:4555— FunctionTooLong — lance::index::vector::ivf::train_streaming_coreset_ivf_model runs 181 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 81 over it, 1.81× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: lance::index::vector::ivf::io::write_hnsw_quantization_index_partitions rust/lance/src/index/vector/ivf/io.rs:308— FunctionTooLong — lance::index::vector::ivf::io::write_hnsw_quantization_index_partitions runs 168 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: lance_jni::utils::get_vector_index_params java/lance-jni/src/utils.rs:340— FunctionTooLong — lance_jni::utils::get_vector_index_params runs 156 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 56 over it, 1.56× 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: lance_jni::blocking_scanner::build_scanner_with_options java/lance-jni/src/blocking_scanner.rs:289— FunctionTooLong — lance_jni::blocking_scanner::build_scanner_with_options runs 155 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: lance_jni::blocking_dataset::inner_get_zonemap_stats java/lance-jni/src/blocking_dataset.rs:4127— FunctionTooLong — lance_jni::blocking_dataset::inner_get_zonemap_stats runs 149 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: lance::index::frag_reuse::validate_folded_deletions rust/lance/src/index/frag_reuse.rs:682— FunctionTooLong — lance::index::frag_reuse::validate_folded_deletions runs 145 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 45 over it, 1.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.
Duplicated block (7 lines × 2) java/lance-jni/src/namespace.rs:3487— java/lance-jni/src/namespace.rs:3487-3493 | java/lance-jni/src/namespace.rs:3616-3622 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/namespace.rs:3524— java/lance-jni/src/namespace.rs:3524-3530 | java/lance-jni/src/namespace.rs:3653-3659 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/namespace.rs:3570— java/lance-jni/src/namespace.rs:3570-3576 | java/lance-jni/src/namespace.rs:3699-3705 — both copies are in the same file, so extract the block into 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) python/src/dataset/optimize.rs:510— python/src/dataset/optimize.rs:510-516 | python/src/dataset/optimize.rs:544-550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) python/src/dataset.rs:1668— python/src/dataset.rs:1668-1674 | python/src/dataset.rs:1695-1701 — both copies are in the same file, so extract the block into 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) python/src/dataset.rs:3176— python/src/dataset.rs:3176-3182 | python/src/dataset.rs:3242-3248 — both copies are in the same file, so extract the block into 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) python/src/dataset.rs:3393— python/src/dataset.rs:3393-3399 | python/src/dataset.rs:3429-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 (7 lines × 2) python/src/dataset.rs:3612— python/src/dataset.rs:3612-3618 | python/src/dataset.rs:3640-3646 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) python/src/mem_wal.rs:512— python/src/mem_wal.rs:512-518 | python/src/mem_wal.rs:533-539 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:496— rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:496-503 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:581-587 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/write/merge_insert.rs:2552— rust/lance/src/dataset/write/merge_insert.rs:2552-2558 | rust/lance/src/dataset/write/merge_insert.rs:2573-2579 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/scalar/btree.rs:161— rust/lance/src/index/scalar/btree.rs:161-167 | rust/lance/src/index/scalar/ngram.rs:144-150 — 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) rust/lance-encoding/src/array_encoding/logical/list.rs:1312— rust/lance-encoding/src/array_encoding/logical/list.rs:1312-1318 | rust/lance-encoding/src/array_encoding/logical/list.rs:1321-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 (7 lines × 2) rust/lance-file/src/versions/v1/encoding/binary.rs:74— rust/lance-file/src/versions/v1/encoding/binary.rs:74-80 | rust/lance-file/src/versions/v1/writer/mod.rs:566-572 — 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) rust/lance-file/src/versions/v2_0/writer.rs:904— rust/lance-file/src/versions/v2_0/writer.rs:904-910 | rust/lance-file/src/writer/structural.rs:877-884 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 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) rust/lance-index/src/scalar/bloomfilter.rs:628— rust/lance-index/src/scalar/bloomfilter.rs:628-634 | rust/lance-index/src/scalar/zonemap.rs:1009-1015 — before extracting anything, compare `rust/lance-index/src/scalar/bloomfilter.rs` and `rust/lance-index/src/scalar/zonemap.rs` as WHOLE FILES: this scan already matched 5 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 (7 lines × 2) rust/lance-index/src/scalar/btree.rs:1145— rust/lance-index/src/scalar/btree.rs:1145-1151 | rust/lance-index/src/scalar/btree.rs:1165-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 (7 lines × 2) rust/lance-index/src/scalar/fmindex.rs:815— rust/lance-index/src/scalar/fmindex.rs:815-821 | rust/lance-index/src/scalar/fmindex.rs:835-841 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/index/flat_search.rs:62— rust/lance-index/src/scalar/inverted/index/flat_search.rs:62-68 | rust/lance-index/src/scalar/inverted/index/flat_search.rs:88-94 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted.rs:268— rust/lance-index/src/scalar/inverted.rs:268-274 | rust/lance-index/src/scalar/inverted.rs:346-352 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/ngram/ngram_regex.rs:396— rust/lance-index/src/scalar/ngram/ngram_regex.rs:396-404 | rust/lance-index/src/scalar/ngram/ngram_regex.rs:406-412 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/ngram.rs:1617— rust/lance-index/src/scalar/ngram.rs:1617-1625 | rust/lance-index/src/scalar/ngram.rs:1734-1740 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/rtree/sort/hilbert_sort.rs:218— rust/lance-index/src/scalar/rtree/sort/hilbert_sort.rs:218-224 | rust/lance-index/src/scalar/rtree/sort/hilbert_sort.rs:227-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) rust/lance-index/src/scalar/rtree.rs:328— rust/lance-index/src/scalar/rtree.rs:328-334 | rust/lance-index/src/scalar/rtree.rs:352-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) rust/lance-index/src/vector/bq/dist_table_quant.rs:73— rust/lance-index/src/vector/bq/dist_table_quant.rs:73-82 | rust/lance-index/src/vector/bq/dist_table_quant.rs:110-116 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/mem_wal.rs:767— java/lance-jni/src/mem_wal.rs:767-776 | java/lance-jni/src/mem_wal.rs:890-899 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/otel.rs:307— java/lance-jni/src/otel.rs:307-316 | java/lance-jni/src/utils.rs:603-612 — 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) python/src/dataset.rs:5523— python/src/dataset.rs:5523-5532 | python/src/dataset.rs:5545-5554 — both copies are in the same file, so extract the block into 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) python/src/fts.rs:112— python/src/fts.rs:112-121 | python/src/fts.rs:139-148 — both copies are in the same file, so extract the block into 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) python/src/mem_wal.rs:259— python/src/mem_wal.rs:259-268 | python/src/mem_wal.rs:284-293 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) python/src/mem_wal.rs:721— python/src/mem_wal.rs:721-730 | python/src/mem_wal.rs:794-803 — both copies are in the same file, so extract the block into 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) rust/arrow-scalar/src/serde.rs:210— rust/arrow-scalar/src/serde.rs:210-219 | rust/arrow-scalar/src/serde.rs:223-232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:410— rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:410-419 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:471-480 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:494— rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:494-503 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:555-564 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:590— rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:590-599 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:651-660 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:608— rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:608-617 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:669-678 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance/src/datafusion/dataframe.rs:151— rust/lance/src/datafusion/dataframe.rs:151-160 | REDACTED:86-95 — 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) rust/lance-core/src/levenshtein.rs:37— rust/lance-core/src/levenshtein.rs:37-46 | rust/lance/src/dataset/mem_wal/index/fts.rs:588-597 — 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) rust/lance/src/dataset/mem_wal/index/hnsw.rs:256— rust/lance/src/dataset/mem_wal/index/hnsw.rs:256-265 | rust/lance/src/dataset/mem_wal/index/hnsw.rs:303-313 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:313— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:313-322 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:182-191 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 180 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance/src/dataset/mem_wal/scanner/builder.rs:883— rust/lance/src/dataset/mem_wal/scanner/builder.rs:883-892 | rust/lance/src/dataset/mem_wal/scanner/exec/pk_block_filter.rs:219-228 — 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) rust/lance-table/src/system_index/frag_reuse.rs:495— rust/lance-table/src/system_index/frag_reuse.rs:495-504 | rust/lance/src/dataset/optimize/remapping.rs:253-262 — 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) rust/lance/src/dataset/scanner.rs:5695— rust/lance/src/dataset/scanner.rs:5695-5704 | rust/lance/src/dataset/scanner.rs:7405-7414 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset.rs:3462— rust/lance/src/dataset.rs:3462-3471 | rust/lance/src/dataset.rs:3505-3514 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/pq.rs:111— rust/lance/src/index/vector/pq.rs:111-120 | rust/lance/src/index/vector/pq.rs:122-131 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/ivf/partition_serde.rs:294— rust/lance/src/index/vector/ivf/partition_serde.rs:294-303 | rust/lance/src/index/vector/ivf/partition_serde.rs:338-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 (10 lines × 2) rust/lance-arrow/src/json.rs:506— rust/lance-arrow/src/json.rs:506-515 | rust/lance-arrow/src/json.rs:524-533 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) rust/lance-datafusion/src/planner.rs:818— rust/lance-datafusion/src/planner.rs:818-827 | rust/lance-datafusion/src/planner.rs:831-840 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/array_encoding/logical/struct.rs:305— rust/lance-encoding/src/array_encoding/logical/struct.rs:305-314 | rust/lance-encoding/src/encodings/logical/struct.rs:222-231 — 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) rust/lance-encoding/src/array_encoding/strategy.rs:340— rust/lance-encoding/src/array_encoding/strategy.rs:340-349 | rust/lance-encoding/src/array_encoding/strategy.rs:352-361 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/blocking_blob.rs:61— java/lance-jni/src/blocking_blob.rs:61-65 | java/lance-jni/src/blocking_blob.rs:116-120 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) java/lance-jni/src/blocking_dataset.rs:2291— java/lance-jni/src/blocking_dataset.rs:2291-2295 | java/lance-jni/src/blocking_dataset.rs:3278-3283 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/blocking_dataset.rs:3028— java/lance-jni/src/blocking_dataset.rs:3028-3032 | java/lance-jni/src/blocking_dataset.rs:3202-3206 — both copies are in the same file, so extract the block into 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) python/src/dataset.rs:487— python/src/dataset.rs:487-492 | python/src/dataset.rs:538-542 — both copies are in the same file, so extract the block into 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) python/src/dataset.rs:1677— python/src/dataset.rs:1677-1681 | python/src/dataset.rs:1704-1709 — both copies are in the same file, so extract the block into 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) python/src/debug.rs:18— python/src/debug.rs:18-22 | python/src/debug.rs:28-32 — both copies are in the same file, so extract the block into 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) python/src/namespace.rs:313— python/src/namespace.rs:313-317 | python/src/namespace.rs:1013-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 (5 lines × 2) python/src/namespace.rs:449— python/src/namespace.rs:449-453 | python/src/namespace.rs:1149-1153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:351— rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:351-355 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:389-393 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) rust/lance/src/dataset/blob.rs:4499— rust/lance/src/dataset/blob.rs:4499-4503 | rust/lance/src/dataset/blob.rs:4520-4524 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/scanner/builder.rs:862— rust/lance/src/dataset/mem_wal/scanner/builder.rs:862-866 | rust/lance/src/dataset/mem_wal/scanner/exec/pk_block_filter.rs:197-201 — 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) rust/lance/src/dataset/scanner.rs:4162— rust/lance/src/dataset/scanner.rs:4162-4167 | rust/lance/src/dataset/scanner.rs:5645-5649 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/write/merge_insert/exec/delete.rs:284— rust/lance/src/dataset/write/merge_insert/exec/delete.rs:284-288 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:976-980 — before extracting anything, compare `rust/lance/src/dataset/write/merge_insert/exec/delete.rs` and `rust/lance/src/dataset/write/merge_insert/exec/write.rs` as WHOLE FILES: this scan already matched 7 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 (5 lines × 2) rust/lance/src/dataset.rs:808— rust/lance/src/dataset.rs:808-812 | rust/lance/src/dataset.rs:839-843 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/ivf.rs:3197— rust/lance/src/index/vector/ivf.rs:3197-3204 | rust/lance/src/index/vector/ivf.rs:4826-4830 — both copies are in the same file, so extract the block into 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) rust/lance-datafusion/src/expr.rs:412— rust/lance-datafusion/src/expr.rs:412-416 | rust/lance-datafusion/src/expr.rs:425-429 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) rust/lance-datafusion/src/expr.rs:496— rust/lance-datafusion/src/expr.rs:496-500 | rust/lance-datafusion/src/expr.rs:509-513 — both copies are in the same file, so extract the block into 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) rust/lance-datagen/src/generator.rs:2753— rust/lance-datagen/src/generator.rs:2753-2757 | rust/lance-datagen/src/generator.rs:2781-2785 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) rust/lance-encoding/src/encodings/logical/primitive.rs:7000— rust/lance-encoding/src/encodings/logical/primitive.rs:7000-7004 | rust/lance-encoding/src/encodings/logical/primitive.rs:7010-7014 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/fmindex.rs:1096— rust/lance-index/src/scalar/fmindex.rs:1096-1100 | rust/lance-index/src/scalar/fmindex.rs:2128-2132 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/wand.rs:4294— rust/lance-index/src/scalar/inverted/wand.rs:4294-4298 | rust/lance-index/src/scalar/inverted/wand.rs:4322-4326 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/ngram.rs:1461— rust/lance-index/src/scalar/ngram.rs:1461-1465 | rust/lance-index/src/scalar/ngram.rs:1468-1472 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/vector/bq/builder.rs:584— rust/lance-index/src/vector/bq/builder.rs:584-588 | rust/lance-index/src/vector/bq/builder.rs:670-674 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/vector/bq/dist_table_quant.rs:398— rust/lance-index/src/vector/bq/dist_table_quant.rs:398-402 | rust/lance-index/src/vector/bq/dist_table_quant.rs:433-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) rust/lance-index/src/vector/graph.rs:600— rust/lance-index/src/vector/graph.rs:600-604 | rust/lance-index/src/vector/graph.rs:628-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.
TooManyMethods: Dataset java/src/main/java/org/lance/Dataset.java:83— TooManyMethods — 203 methods. The bar is 30 methods; this is 173 over it, 6.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Scanner rust/lance/src/dataset/scanner.rs:1104— TooManyMethods — 161 methods. The bar is 30 methods; this is 131 over it, 5.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Dataset rust/lance/src/dataset.rs:219— TooManyMethods — 153 methods, declared across 5 files: src/dataset.rs (145), dataset/files.rs (3), dataset/write.rs (3), index/frag_reuse.rs (1), +1 more file(s). The bar is 30 methods; this is 123 over it, 5.10× 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: Dataset python/src/dataset.rs:830— TooManyMethods — 125 methods. The bar is 30 methods; this is 95 over it, 4.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: DirectoryNamespace java/src/main/java/org/lance/namespace/DirectoryNamespace.java:238— TooManyMethods — 112 methods. The bar is 30 methods; this is 82 over it, 3.73× 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: RestNamespace java/src/main/java/org/lance/namespace/RestNamespace.java:154— TooManyMethods — 111 methods. The bar is 30 methods; this is 81 over it, 3.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: LanceDataset python/python/lance/dataset.py:857— TooManyMethods — 96 methods. The bar is 30 methods; this is 66 over it, 3.20× 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: ManifestNamespace rust/lance-namespace-impls/src/dir/manifest.rs:755— TooManyMethods — 66 methods. The bar is 30 methods; this is 36 over it, 2.20× 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: DirectoryNamespace rust/lance-namespace-impls/src/dir.rs:884— TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DirectoryNamespace python/python/lance/namespace.py:269— 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: RestNamespace python/python/lance/namespace.py:921— 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: PyDirectoryNamespace python/src/namespace.rs:120— 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: PyRestNamespace python/src/namespace.rs:823— 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: FileFragment rust/lance/src/dataset/fragment.rs:96— 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: InvertedIndex rust/lance-index/src/scalar/inverted/index/inverted_index.rs:19— TooManyMethods — 55 methods, declared across 2 files: index/search.rs (29), index/inverted_index.rs (26). The bar is 30 methods; this is 25 over it, 1.83× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Wand rust/lance-index/src/scalar/inverted/wand.rs:2396— TooManyMethods — 54 methods, declared across 2 files: inverted/wand.rs (52), inverted/wand_maxscore.rs (2). The bar is 30 methods; this is 24 over it, 1.80× 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: FtsMemIndex rust/lance/src/dataset/mem_wal/index/fts.rs:1190— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MemTableScanner rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:507— TooManyMethods — 50 methods. The bar is 30 methods; this is 20 over it, 1.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SparseStructuralScheduler rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:1157— TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: FileReader rust/lance-file/src/reader.rs:452— TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PostingListReader rust/lance-index/src/scalar/inverted/index/posting_reader.rs:83— TooManyMethods — 49 methods, declared across 2 files: index/posting_reader.rs (30), index/posting_prewarm.rs (19). The bar is 30 methods; this is 19 over it, 1.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ObjectStore rust/lance-io/src/object_store.rs:203— TooManyMethods — 49 methods, declared across 2 files: src/object_store.rs (47), object_store/read_dir.rs (2). The bar is 30 methods; this is 19 over it, 1.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MemTable rust/lance/src/dataset/mem_wal/memtable.rs:60— TooManyMethods — 49 methods. The bar is 30 methods; this is 19 over it, 1.63× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Field rust/lance-core/src/datatypes/field.rs:137— TooManyMethods — 47 methods. The bar is 30 methods; this is 17 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Error rust/lance-core/src/error.rs:159— TooManyMethods — 44 methods. The bar is 30 methods; this is 14 over it, 1.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (9 lines × 2) java/lance-jni/src/namespace.rs:3464— java/lance-jni/src/namespace.rs:3464-3472 | java/lance-jni/src/namespace.rs:3593-3601 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/otel.rs:161— java/lance-jni/src/otel.rs:161-169 | python/src/otel.rs:214-222 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) python/src/dataset.rs:524— python/src/dataset.rs:524-532 | python/src/dataset.rs:550-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 (9 lines × 2) python/src/dataset.rs:2215— python/src/dataset.rs:2215-2223 | python/src/dataset.rs:2247-2255 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/fragment.rs:3644— rust/lance/src/dataset/fragment.rs:3644-3652 | rust/lance/src/dataset/fragment.rs:3846-3854 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/scanner/planner.rs:337— rust/lance/src/dataset/mem_wal/scanner/planner.rs:337-348 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:469-477 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/planner.rs` and `rust/lance/src/dataset/mem_wal/scanner/vector_search.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) rust/lance/src/dataset/write/commit.rs:397— rust/lance/src/dataset/write/commit.rs:397-405 | rust/lance/src/dataset/write/insert.rs:420-428 — 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) rust/lance/src/dataset/write.rs:2406— rust/lance/src/dataset/write.rs:2406-2414 | rust/lance/src/dataset/write.rs:2424-2432 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) rust/lance/src/index/scalar/inverted.rs:199— rust/lance/src/index/scalar/inverted.rs:199-207 | rust/lance/src/index/scalar/inverted.rs:210-218 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/vector/hnsw/index.rs:285— rust/lance-index/src/vector/hnsw/index.rs:285-293 | rust/lance/src/index/vector/ivf/v2.rs:2857-2865 — 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) rust/lance/src/index.rs:166— rust/lance/src/index.rs:166-174 | rust/lance/src/index/scalar/ngram.rs:95-103 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9 lines × 2) rust/lance/src/io/exec/fts.rs:2188— rust/lance/src/io/exec/fts.rs:2188-2196 | rust/lance/src/io/exec/fts.rs:2274-2282 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/scalar/bitmap.rs:49— rust/lance/src/index/scalar/bitmap.rs:49-57 | rust/lance/src/index/scalar/label_list.rs:120-128 — before extracting anything, compare `rust/lance/src/index/scalar/bitmap.rs` and `rust/lance/src/index/scalar/label_list.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance-datafusion/src/udf/json.rs:450— rust/lance-datafusion/src/udf/json.rs:450-458 | rust/lance-datafusion/src/udf/json.rs:733-741 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/array_encoding/logical/struct.rs:209— rust/lance-encoding/src/array_encoding/logical/struct.rs:209-217 | rust/lance-encoding/src/encodings/logical/struct.rs:146-154 — 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) rust/lance-encoding/src/encodings/physical/packed.rs:825— rust/lance-encoding/src/encodings/physical/packed.rs:825-833 | rust/lance-encoding/src/encodings/physical/packed.rs:843-851 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/versions/v2_0/writer.rs:133— rust/lance-file/src/versions/v2_0/writer.rs:133-141 | rust/lance-file/src/writer/structural.rs:116-124 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:879— rust/lance-file/src/versions/v2_0/writer.rs:879-887 | rust/lance-file/src/writer/structural.rs:855-863 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) rust/lance-file/src/versions/v1/mod.rs:108— rust/lance-file/src/versions/v1/mod.rs:108-116 | rust/lance-file/src/versions/v2_0/mod.rs:74-82 — `rust/lance-file/src/versions/v1/mod.rs` and `rust/lance-file/src/versions/v2_0/mod.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 4 separate duplicated blocks between them, totalling at least 34 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 (9 lines × 2) rust/lance-index/src/scalar/fmindex.rs:854— rust/lance-index/src/scalar/fmindex.rs:854-862 | rust/lance-index/src/scalar/fmindex.rs:877-885 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/index/doc_set.rs:723— rust/lance-index/src/scalar/inverted/index/doc_set.rs:723-731 | rust/lance-index/src/scalar/inverted/index/doc_set.rs:736-744 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:254— rust/lance-index/src/scalar/inverted/index/inverted_index.rs:254-262 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:323-331 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/wand.rs:1708— rust/lance-index/src/scalar/inverted/wand.rs:1708-1716 | rust/lance-index/src/scalar/inverted/wand_maxscore.rs:253-261 — 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) rust/lance-index/src/scalar/inverted/wand.rs:3997— rust/lance-index/src/scalar/inverted/wand.rs:3997-4005 | rust/lance-index/src/scalar/inverted/wand.rs:4035-4043 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/wand.rs:4212— rust/lance-index/src/scalar/inverted/wand.rs:4212-4220 | rust/lance-index/src/scalar/inverted/wand.rs:4260-4268 — both copies are in the same file, so extract the block into 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) python/src/dataset.rs:2539— python/src/dataset.rs:2539-2549 | python/src/dataset.rs:4713-4723 — both copies are in the same file, so extract the block into 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) python/src/mem_wal.rs:520— python/src/mem_wal.rs:520-530 | python/src/mem_wal.rs:677-687 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/fragment/write.rs:151— rust/lance/src/dataset/fragment/write.rs:151-161 | rust/lance/src/dataset/fragment/write.rs:254-264 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/hnsw/graph.rs:460— rust/lance/src/dataset/mem_wal/hnsw/graph.rs:460-470 | rust/lance/src/dataset/mem_wal/hnsw/graph.rs:497-507 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/scanner/builder.rs:339— rust/lance/src/dataset/mem_wal/scanner/builder.rs:339-349 | rust/lance/src/dataset/mem_wal/scanner/collector.rs:146-156 — 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) rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:333— rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:333-343 | rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:471-481 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) rust/lance/src/dataset/scanner.rs:4623— rust/lance/src/dataset/scanner.rs:4623-4633 | rust/lance/src/dataset/scanner.rs:4637-4647 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/write/merge_insert/exec/delete.rs:357— rust/lance/src/dataset/write/merge_insert/exec/delete.rs:357-367 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:1138-1148 — before extracting anything, compare `rust/lance/src/dataset/write/merge_insert/exec/delete.rs` and `rust/lance/src/dataset/write/merge_insert/exec/write.rs` as WHOLE FILES: this scan already matched 7 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 (11 lines × 2) rust/lance/src/dataset/write.rs:2215— rust/lance/src/dataset/write.rs:2215-2225 | rust/lance/src/dataset/write.rs:2259-2269 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/hamming.rs:482— rust/lance/src/index/vector/hamming.rs:482-492 | rust/lance/src/index/vector/hamming.rs:504-514 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/ivf.rs:809— rust/lance/src/index/vector/ivf.rs:809-819 | rust/lance/src/index/vector/ivf.rs:850-860 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/ivf.rs:837— rust/lance/src/index/vector/ivf.rs:837-847 | rust/lance/src/index/vector/ivf.rs:962-972 — both copies are in the same file, so extract the block into 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) rust/lance/src/index.rs:1945— rust/lance/src/index.rs:1945-1955 | rust/lance/src/index.rs:1981-1991 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/pushdown_scan.rs:242— rust/lance/src/io/exec/pushdown_scan.rs:242-252 | rust/lance/src/io/exec/scan.rs:643-653 — 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) rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:439— rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:439-449 | rust/lance-encoding/src/encodings/logical/fixed_size_list.rs:494-504 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:57— rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:57-67 | rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:351-363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) rust/lance-encoding/src/encodings/physical/binary.rs:220— rust/lance-encoding/src/encodings/physical/binary.rs:220-230 | rust/lance-encoding/src/encodings/physical/binary.rs:233-243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) rust/lance-encoding/src/repdef.rs:2184— rust/lance-encoding/src/repdef.rs:2184-2194 | rust/lance-encoding/src/repdef.rs:2205-2215 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/reader.rs:1224— rust/lance-file/src/reader.rs:1224-1234 | rust/lance-file/src/reader.rs:1309-1319 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/versions/v2_0/writer.rs:111— rust/lance-file/src/versions/v2_0/writer.rs:111-121 | rust/lance-file/src/writer/structural.rs:94-104 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:468— rust/lance-file/src/versions/v2_0/writer.rs:468-479 | rust/lance-file/src/writer/structural.rs:618-628 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:487— rust/lance-file/src/versions/v2_0/writer.rs:487-497 | rust/lance-file/src/writer/structural.rs:634-644 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) rust/lance-index/src/scalar/bloomfilter.rs:577— rust/lance-index/src/scalar/bloomfilter.rs:577-587 | rust/lance-index/src/scalar/zonemap.rs:813-823 — before extracting anything, compare `rust/lance-index/src/scalar/bloomfilter.rs` and `rust/lance-index/src/scalar/zonemap.rs` as WHOLE FILES: this scan already matched 5 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 (11 lines × 2) rust/lance-index/src/scalar/inverted/index/flat_search.rs:253— rust/lance-index/src/scalar/inverted/index/flat_search.rs:253-263 | rust/lance-index/src/scalar/inverted/index/flat_search.rs:564-574 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/index/token_set.rs:54— rust/lance-index/src/scalar/inverted/index/token_set.rs:54-64 | rust/lance-index/src/scalar/inverted/index/token_set.rs:311-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.
lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner (cognitive 298) rust/lance-index/src/vector/distributed/index_merger.rs:862— lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner has cognitive complexity 298 (threshold 15). Drivers by points: if/else 97 (247 pts), match/switch 8 (21 pts), loops 8 (16 pts), boolean chains 14 (nesting depth added 171). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_index::vector::graph::beam_search_acorn (cognitive 92) rust/lance-index/src/vector/graph.rs:563— lance_index::vector::graph::beam_search_acorn has cognitive complexity 92 (threshold 15). Drivers by points: if/else 22 (71 pts), loops 6 (15 pts), boolean chains 6 (nesting depth added 58). 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.
lance_index::scalar::expression::extract_like_leading_prefix (cognitive 36) rust/lance-index/src/scalar/expression.rs:534— lance_index::scalar::expression::extract_like_leading_prefix has cognitive complexity 36 (threshold 15). Drivers by points: if/else 18 (26 pts), boolean chains 9, 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.
lance_index::vector::bq::ex_dot::unpack_group (cognitive 36) rust/lance-index/src/vector/bq/ex_dot.rs:215— lance_index::vector::bq::ex_dot::unpack_group has cognitive complexity 36 (threshold 15). Drivers by points: loops 13 (33 pts), if/else 1 (2 pts), match/switch 1 (nesting depth added 21). 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.
lance_index::vector::distributed::index_merger::fixed_size_list_almost_equal (cognitive 36) rust/lance-index/src/vector/distributed/index_merger.rs:107— lance_index::vector::distributed::index_merger::fixed_size_list_almost_equal has cognitive complexity 36 (threshold 15). Drivers by points: if/else 10 (25 pts), loops 3 (6 pts), boolean chains 4, match/switch 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.
lance_index::scalar::inverted::index::flat_search::tokenize_and_count (cognitive 34) rust/lance-index/src/scalar/inverted/index/flat_search.rs:223— lance_index::scalar::inverted::index::flat_search::tokenize_and_count has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 7 (10 pts), match/switch 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.
lance_index::scalar::inverted::cross_column::collect_local_generator_candidates (cognitive 31) rust/lance-index/src/scalar/inverted/cross_column.rs:939— lance_index::scalar::inverted::cross_column::collect_local_generator_candidates has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (25 pts), loops 3 (6 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.
lance_index::vector::distributed::index_merger::read_shard_window_partitions (cognitive 30) rust/lance-index/src/vector/distributed/index_merger.rs:723— lance_index::vector::distributed::index_merger::read_shard_window_partitions has cognitive complexity 30 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 5 (8 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.
lance_index::scalar::fmindex::write_partitioned_fmindex_stream_with_config (cognitive 29) rust/lance-index/src/scalar/fmindex.rs:1734— lance_index::scalar::fmindex::write_partitioned_fmindex_stream_with_config has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 6 (8 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.
lance_index::vector::bq::transform::compute_raw_query_factors (cognitive 29) rust/lance-index/src/vector/bq/transform.rs:139— lance_index::vector::bq::transform::compute_raw_query_factors has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 2 (3 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.
lance_index::scalar::inverted::combined::search::combined_fields_search (cognitive 28) rust/lance-index/src/scalar/inverted/combined/search.rs:64— lance_index::scalar::inverted::combined::search::combined_fields_search has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 6 (13 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.
lance_index::scalar::inverted::wand::exclusive_partial_score_limit (cognitive 28) rust/lance-index/src/scalar/inverted/wand.rs:1833— lance_index::scalar::inverted::wand::exclusive_partial_score_limit has cognitive complexity 28 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 3 (5 pts), boolean chains 3 (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.
lance_index::scalar::inverted::cross_column::score_generator_candidates (cognitive 28) rust/lance-index/src/scalar/inverted/cross_column.rs:1051— lance_index::scalar::inverted::cross_column::score_generator_candidates has cognitive complexity 28 (threshold 15). Drivers by points: if/else 5 (19 pts), loops 3 (6 pts), boolean chains 3 (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.
lance_index::vector::pairwise::collect_pairs (cognitive 26) rust/lance-index/src/vector/pairwise.rs:247— lance_index::vector::pairwise::collect_pairs has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 5 (9 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.
lance_index::vector::bq::dist_table_quant::min_max_fold (cognitive 26) rust/lance-index/src/vector/bq/dist_table_quant.rs:207— lance_index::vector::bq::dist_table_quant::min_max_fold has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 5 (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.
lance_index::scalar::inverted::cross_column::score_cross_column_sources (cognitive 26) rust/lance-index/src/scalar/inverted/cross_column.rs:1167— lance_index::scalar::inverted::cross_column::score_cross_column_sources has cognitive complexity 26 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 6 (8 pts), match/switch 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.
lance_index::scalar::inverted::index::flat_search::tokenize_and_count_list (cognitive 23) rust/lance-index/src/scalar/inverted/index/flat_search.rs:468— lance_index::scalar::inverted::index::flat_search::tokenize_and_count_list has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (9 pts), match/switch 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_index::scalar::inverted::wand::exact_phrase_scan (cognitive 22) rust/lance-index/src/scalar/inverted/wand.rs:5717— lance_index::scalar::inverted::wand::exact_phrase_scan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_index::scalar::inverted::index::flat_search::flat_bm25_score (cognitive 21) rust/lance-index/src/scalar/inverted/index/flat_search.rs:807— lance_index::scalar::inverted::index::flat_search::flat_bm25_score has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 4 (9 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.
lance_index::scalar::inverted::encoding::seek_packed_doc_positions (cognitive 21) rust/lance-index/src/scalar/inverted/encoding.rs:791— lance_index::scalar::inverted::encoding::seek_packed_doc_positions has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 5 (9 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
lance_index::vector::bq::ex_dot::pack_block (cognitive 21) rust/lance-index/src/vector/bq/ex_dot.rs:129— lance_index::vector::bq::ex_dot::pack_block has cognitive complexity 21 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 2 (4 pts), match/switch 1 (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.
lance_index::scalar::bitmap::merge_index_maps (cognitive 21) rust/lance-index/src/scalar/bitmap.rs:1839— lance_index::scalar::bitmap::merge_index_maps has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_index::scalar::inverted::final_query_tokens (cognitive 21) rust/lance-index/src/scalar/inverted.rs:112— lance_index::scalar::inverted::final_query_tokens has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 5 (9 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.
lance_index::scalar::inverted::index::flat_search::tokenize_and_blend_multi (cognitive 20) rust/lance-index/src/scalar/inverted/index/flat_search.rs:550— lance_index::scalar::inverted::index::flat_search::tokenize_and_blend_multi has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 5 (8 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.
lance_index::scalar::inverted::combined::stats::build_combined_bm25_scorer (cognitive 20) rust/lance-index/src/scalar/inverted/combined/stats.rs:163— lance_index::scalar::inverted::combined::stats::build_combined_bm25_scorer has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 5 (7 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.
Duplicated block (12 lines × 2) rust/lance-file/src/concat.rs:443— rust/lance-file/src/concat.rs:443-454 | rust/lance/src/dataset/blob.rs:245-256 — 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) rust/lance/src/dataset/blob.rs:4268— rust/lance/src/dataset/blob.rs:4268-4279 | rust/lance/src/dataset/optimize.rs:1905-1916 — 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) rust/lance/src/dataset/mem_wal/index/fts.rs:3321— rust/lance/src/dataset/mem_wal/index/fts.rs:3321-3332 | rust/lance/src/dataset/mem_wal/index/fts.rs:4697-4708 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/memtable/batch_store.rs:339— rust/lance/src/dataset/mem_wal/memtable/batch_store.rs:339-350 | rust/lance/src/dataset/mem_wal/memtable/batch_store.rs:404-415 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/ivf.rs:1174— rust/lance/src/index/vector/ivf.rs:1174-1185 | rust/lance/src/index/vector/ivf.rs:2369-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 (12 lines × 2) rust/lance/src/io/commit/conflict_resolver.rs:1559— rust/lance/src/io/commit/conflict_resolver.rs:1559-1570 | rust/lance/src/io/commit/conflict_resolver.rs:2044-2055 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/ivf/partition_serde.rs:280— rust/lance/src/index/vector/ivf/partition_serde.rs:280-291 | rust/lance/src/index/vector/ivf/partition_serde.rs:324-335 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/ivf/builder.rs:62— rust/lance/src/index/vector/ivf/builder.rs:62-73 | rust/lance/src/index/vector/ivf/builder.rs:265-276 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/encodings/logical/primitive/blob.rs:194— rust/lance-encoding/src/encodings/logical/primitive/blob.rs:194-205 | rust/lance-encoding/src/encodings/logical/primitive/blob.rs:534-545 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) rust/lance-file/src/reader/structural.rs:231— rust/lance-file/src/reader/structural.rs:231-242 | rust/lance-file/src/versions/v2_0/reader.rs:189-200 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:79— rust/lance-file/src/versions/v2_0/writer.rs:79-90 | rust/lance-file/src/writer/structural.rs:62-73 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:97— rust/lance-file/src/versions/v2_0/writer.rs:97-108 | rust/lance-file/src/writer/structural.rs:80-91 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:912— rust/lance-file/src/versions/v2_0/writer.rs:912-923 | rust/lance-file/src/writer/structural.rs:886-897 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) rust/lance-file/src/versions/v2_2/reader.rs:91— rust/lance-file/src/versions/v2_2/reader.rs:91-102 | rust/lance-file/src/versions/v2_3/reader.rs:74-85 — `rust/lance-file/src/versions/v2_2/reader.rs` and `rust/lance-file/src/versions/v2_3/reader.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 8 separate duplicated blocks between them, totalling at least 105 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 × 2) rust/lance-index/src/scalar/inverted/index/token_set.rs:109— rust/lance-index/src/scalar/inverted/index/token_set.rs:109-120 | rust/lance-index/src/scalar/inverted/index/token_set.rs:143-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 (12 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:1352— rust/lance-index/src/scalar/inverted/wand.rs:1352-1363 | rust/lance-index/src/scalar/inverted/wand.rs:1398-1409 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/lance_format.rs:341— rust/lance-index/src/scalar/lance_format.rs:341-352 | rust/lance-index/src/scalar/lance_format.rs:465-476 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/vector/bq/storage.rs:707— rust/lance-index/src/vector/bq/storage.rs:707-718 | rust/lance-index/src/vector/bq/storage.rs:746-757 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/vector/flat/index.rs:153— rust/lance-index/src/vector/flat/index.rs:153-164 | rust/lance-index/src/vector/flat/index.rs:298-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) rust/lance-index/src/vector/hnsw/builder.rs:655— rust/lance-index/src/vector/hnsw/builder.rs:655-666 | rust/lance-index/src/vector/hnsw/builder.rs:669-680 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/index/search.rs:886— rust/lance-index/src/scalar/inverted/index/search.rs:886-897 | rust/lance-index/src/scalar/inverted/index/search.rs:1176-1187 — both copies are in the same file, so extract the block into 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) rust/lance-io/src/object_store/providers/azure.rs:190— rust/lance-io/src/object_store/providers/azure.rs:190-201 | rust/lance-io/src/object_store/providers/gcp.rs:278-289 — before extracting anything, compare `rust/lance-io/src/object_store/providers/azure.rs` and `rust/lance-io/src/object_store/providers/gcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance-io/src/object_store.rs:1298— rust/lance-io/src/object_store.rs:1298-1309 | rust/lance-io/src/object_store.rs:1428-1439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) rust/lance-linalg/src/kernels.rs:333— rust/lance-linalg/src/kernels.rs:333-344 | rust/lance-linalg/src/kernels.rs:347-358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) rust/lance-linalg/src/simd/f32.rs:304— rust/lance-linalg/src/simd/f32.rs:304-315 | rust/lance-linalg/src/simd/f32.rs:793-804 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/otel.rs:88— java/lance-jni/src/otel.rs:88-101 | python/src/otel.rs:135-148 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 115 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) python/src/dataset.rs:1287— python/src/dataset.rs:1287-1300 | python/src/fragment.rs:243-256 — before extracting anything, compare `python/src/dataset.rs` and `python/src/fragment.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 (14 lines × 2) python/src/dataset.rs:5574— python/src/dataset.rs:5574-5587 | python/src/dataset.rs:5599-5612 — both copies are in the same file, so extract the block into 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) rust/compression/fsst/src/fsst.rs:84— rust/compression/fsst/src/fsst.rs:84-97 | rust/compression/fsst/src/fsst.rs:102-115 — both copies are in the same file, so extract the block into 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) rust/lance/src/bin/fm_contains_bench.rs:218— rust/lance/src/bin/fm_contains_bench.rs:218-231 | rust/lance/src/bin/fm_index_tool.rs:70-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14 lines × 2) rust/lance/src/dataset/mem_wal/hnsw/graph.rs:854— rust/lance/src/dataset/mem_wal/hnsw/graph.rs:854-867 | rust/lance/src/dataset/mem_wal/hnsw/graph.rs:943-956 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/index/btree.rs:355— rust/lance/src/dataset/mem_wal/index/btree.rs:355-368 | rust/lance/src/dataset/mem_wal/index/btree.rs:551-564 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/scanner/collector.rs:292— rust/lance/src/dataset/mem_wal/scanner/collector.rs:292-305 | rust/lance/src/dataset/mem_wal/scanner/collector.rs:333-346 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/wal.rs:1240— rust/lance/src/dataset/mem_wal/wal.rs:1240-1253 | rust/lance/src/dataset/mem_wal/wal.rs:1330-1343 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/wal.rs:1663— rust/lance/src/dataset/mem_wal/wal.rs:1663-1676 | rust/lance/src/dataset/mem_wal/wal.rs:1691-1704 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/scanner.rs:5353— rust/lance/src/dataset/scanner.rs:5353-5366 | rust/lance/src/dataset/scanner.rs:5519-5532 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/write/merge_insert/exec/write.rs:825— rust/lance/src/dataset/write/merge_insert/exec/write.rs:825-838 | rust/lance/src/dataset/write/merge_insert/logical_plan.rs:142-155 — 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) rust/lance/src/io/exec/fts.rs:5323— rust/lance/src/io/exec/fts.rs:5323-5336 | rust/lance/src/io/exec/fts.rs:5590-5603 — both copies are in the same file, so extract the block into 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) rust/lance-core/src/utils/row_addr_remap.rs:508— rust/lance-core/src/utils/row_addr_remap.rs:508-521 | rust/lance-core/src/utils/row_addr_remap.rs:529-542 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/encodings/logical/primitive/chunk_index.rs:262— rust/lance-encoding/src/encodings/logical/primitive/chunk_index.rs:262-275 | rust/lance-encoding/src/encodings/logical/primitive/chunk_index.rs:307-320 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:335— rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:335-348 | rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:4167-4180 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/encodings/physical/packed.rs:729— rust/lance-encoding/src/encodings/physical/packed.rs:729-742 | rust/lance-encoding/src/encodings/physical/packed.rs:768-781 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/concat.rs:463— rust/lance-file/src/concat.rs:463-476 | rust/lance-file/src/concat.rs:481-494 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) rust/lance-file/src/reader.rs:1121— rust/lance-file/src/reader.rs:1121-1134 | rust/lance-file/src/reader.rs:1561-1574 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/index/partition.rs:845— rust/lance-index/src/scalar/inverted/index/partition.rs:845-858 | rust/lance-index/src/scalar/inverted/index/partition.rs:883-896 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/index/partition.rs:1160— rust/lance-index/src/scalar/inverted/index/partition.rs:1160-1173 | rust/lance-index/src/scalar/inverted/index/partition.rs:1224-1237 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/wand_maxscore.rs:585— rust/lance-index/src/scalar/inverted/wand_maxscore.rs:585-598 | rust/lance-index/src/scalar/inverted/wand_maxscore.rs:632-645 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1577— rust/lance-index/src/vector/distributed/index_merger.rs:1577-1590 | rust/lance-index/src/vector/distributed/index_merger.rs:1607-1620 — both copies are in the same file, so extract the block into 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) rust/lance-io/src/object_store/throttle.rs:835— rust/lance-io/src/object_store/throttle.rs:835-848 | rust/lance-io/src/object_store/throttle.rs:855-868 — both copies are in the same file, so extract the block into 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) rust/lance-linalg/src/distance/cosine_u8.rs:120— rust/lance-linalg/src/distance/cosine_u8.rs:120-133 | rust/lance-linalg/src/distance/cosine_u8.rs:171-184 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/namespace.rs:1914— java/lance-jni/src/namespace.rs:1914-1926 | java/lance-jni/src/namespace.rs:2865-2877 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/namespace.rs:3547— java/lance-jni/src/namespace.rs:3547-3559 | java/lance-jni/src/namespace.rs:3676-3688 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1153— rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1153-1165 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:543-555 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/fts_search.rs` and `rust/lance/src/dataset/mem_wal/scanner/vector_search.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance/src/dataset/scanner.rs:5431— rust/lance/src/dataset/scanner.rs:5431-5443 | rust/lance/src/dataset/scanner.rs:5590-5602 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/write/merge_insert/exec/delete.rs:138— rust/lance/src/dataset/write/merge_insert/exec/delete.rs:138-150 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:538-550 — before extracting anything, compare `rust/lance/src/dataset/write/merge_insert/exec/delete.rs` and `rust/lance/src/dataset/write/merge_insert/exec/write.rs` as WHOLE FILES: this scan already matched 7 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 (13 lines × 2) rust/lance/src/dataset/write/merge_insert.rs:2851— rust/lance/src/dataset/write/merge_insert.rs:2851-2863 | rust/lance/src/dataset/write/merge_insert.rs:3003-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 (13 lines × 2) rust/lance-index/src/vector.rs:308— rust/lance-index/src/vector.rs:308-320 | rust/lance/src/index/vector/ivf/v2.rs:2329-2341 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13 lines × 2) rust/lance/src/index/vector/ivf.rs:3802— rust/lance/src/index/vector/ivf.rs:3802-3814 | rust/lance/src/index/vector/ivf.rs:3858-3872 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/ivf.rs:4214— rust/lance/src/index/vector/ivf.rs:4214-4226 | rust/lance/src/index/vector/ivf.rs:4244-4256 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector.rs:1231— rust/lance/src/index/vector.rs:1231-1243 | rust/lance/src/index/vector.rs:1249-1261 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) rust/lance/src/index/vector.rs:1386— rust/lance/src/index/vector.rs:1386-1398 | rust/lance/src/index/vector.rs:1404-1416 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector.rs:1436— rust/lance/src/index/vector.rs:1436-1448 | rust/lance/src/index/vector.rs:1466-1478 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:1723— rust/lance/src/io/exec/fts.rs:1723-1735 | rust/lance/src/io/exec/fts.rs:2111-2123 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:4419— rust/lance/src/io/exec/fts.rs:4419-4431 | rust/lance/src/io/exec/fts.rs:4795-4807 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/array_encoding/logical/list.rs:1127— rust/lance-encoding/src/array_encoding/logical/list.rs:1127-1139 | rust/lance-encoding/src/array_encoding/logical/list.rs:1157-1169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) rust/lance-encoding/src/encodings/logical/primitive.rs:6210— rust/lance-encoding/src/encodings/logical/primitive.rs:6210-6222 | rust/lance-encoding/src/encodings/logical/primitive.rs:6299-6311 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/reader.rs:1268— rust/lance-file/src/reader.rs:1268-1280 | rust/lance-file/src/reader.rs:1347-1359 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/reader.rs:1428— rust/lance-file/src/reader.rs:1428-1440 | rust/lance-file/src/reader.rs:1827-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 (13 lines × 2) rust/lance-index/src/scalar/inverted/compound.rs:181— rust/lance-index/src/scalar/inverted/compound.rs:181-193 | rust/lance-index/src/scalar/inverted/wand.rs:6352-6364 — 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) rust/lance-index/src/vector/distributed/index_merger.rs:304— rust/lance-index/src/vector/distributed/index_merger.rs:304-316 | rust/lance-index/src/vector/distributed/index_merger.rs:345-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 (13 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1329— rust/lance-index/src/vector/distributed/index_merger.rs:1329-1341 | rust/lance-index/src/vector/distributed/index_merger.rs:1362-1374 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/vector/pq/distance.rs:34— rust/lance-index/src/vector/pq/distance.rs:34-46 | rust/lance-index/src/vector/pq/distance.rs:98-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) rust/lance-linalg/src/simd/dist_table.rs:806— rust/lance-linalg/src/simd/dist_table.rs:806-818 | rust/lance-linalg/src/simd/dist_table.rs:994-1006 — both copies are in the same file, so extract the block into 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) rust/lance-linalg/src/simd/f32.rs:225— rust/lance-linalg/src/simd/f32.rs:225-237 | rust/lance-linalg/src/simd/f64.rs:118-130 — before extracting anything, compare `rust/lance-linalg/src/simd/f32.rs` and `rust/lance-linalg/src/simd/f64.rs` as WHOLE FILES: this scan already matched 7 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 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2804— rust/lance-namespace-impls/src/dir/manifest.rs:2804-2816 | rust/lance-namespace-impls/src/dir/manifest.rs:2926-2938 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
lance::index::append::merge_indices_with_unindexed_frags (cyclomatic 50) rust/lance/src/index/append.rs:836— lance::index::append::merge_indices_with_unindexed_frags has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
lance::index::frag_reuse::build_frag_reuse_rewrite_entry (cyclomatic 43) rust/lance/src/index/frag_reuse.rs:1155— lance::index::frag_reuse::build_frag_reuse_rewrite_entry has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
lance::dataset::optimize::commit_compaction (cyclomatic 34) rust/lance/src/dataset/optimize.rs:3156— lance::dataset::optimize::commit_compaction 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.
lance::io::exec::count_pushdown::try_rewrite (cyclomatic 30) rust/lance/src/io/exec/count_pushdown.rs:107— lance::io::exec::count_pushdown::try_rewrite 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.
lance::dataset::versions::check_manifest_storage_contract (cyclomatic 28) rust/lance/src/dataset/versions/mod.rs:383— lance::dataset::versions::check_manifest_storage_contract 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.
lance::dataset::optimize::binary_copy::rewrite_files_binary_copy (cyclomatic 27) rust/lance/src/dataset/optimize/binary_copy.rs:124— lance::dataset::optimize::binary_copy::rewrite_files_binary_copy 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.
lance::dataset::optimize::rewrite_files (cyclomatic 25) rust/lance/src/dataset/optimize.rs:2443— lance::dataset::optimize::rewrite_files 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.
lance::dataset::write::do_write_fragments_impl (cyclomatic 24) rust/lance/src/dataset/write.rs:919— lance::dataset::write::do_write_fragments_impl 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.
lance::dataset::schema_evolution::alter_columns (cyclomatic 23) rust/lance/src/dataset/schema_evolution.rs:836— lance::dataset::schema_evolution::alter_columns 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.
lance::io::commit::commit_transaction (cyclomatic 23) rust/lance/src/io/commit.rs:1576— lance::io::commit::commit_transaction 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.
lance::index::scalar::index_matches_criteria (cyclomatic 22) rust/lance/src/index/scalar.rs:749— lance::index::scalar::index_matches_criteria 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.
lance::index::vector::build_distributed_vector_index (cyclomatic 22) rust/lance/src/index/vector.rs:793— lance::index::vector::build_distributed_vector_index 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.
lance::index::vector::ivf::train_weighted_hierarchical_f32_kmeans (cyclomatic 21) rust/lance/src/index/vector/ivf.rs:4376— lance::index::vector::ivf::train_weighted_hierarchical_f32_kmeans 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.
lance::index::vector::build_vector_index_impl (cyclomatic 21) rust/lance/src/index/vector.rs:1201— lance::index::vector::build_vector_index_impl 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.
lance::dataset::take::do_take_rows (cyclomatic 20) rust/lance/src/dataset/take.rs:131— lance::dataset::take::do_take_rows 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.
lance::index::frag_reuse::validate_folded_deletions (cyclomatic 20) rust/lance/src/index/frag_reuse.rs:682— lance::index::frag_reuse::validate_folded_deletions 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.
lance::dataset::optimize::remapping::remap_index (cyclomatic 20) rust/lance/src/dataset/optimize/remapping.rs:204— lance::dataset::optimize::remapping::remap_index 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.
lance::index::vector::dedup::plan (cyclomatic 19) rust/lance/src/index/vector/dedup.rs:256— lance::index::vector::dedup::plan 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.
lance::io::commit::do_commit_new_dataset (cyclomatic 19) rust/lance/src/io/commit.rs:410— lance::io::commit::do_commit_new_dataset 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.
lance::dataset::write::validate_and_resolve_target_bases_with_primary (cyclomatic 19) rust/lance/src/dataset/write.rs:1426— lance::dataset::write::validate_and_resolve_target_bases_with_primary 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.
lance::dataset::blob::collect_external_blob_uris (cyclomatic 19) rust/lance/src/dataset/blob.rs:209— lance::dataset::blob::collect_external_blob_uris 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.
lance::blob::validate_prepared_blob_value_array (cyclomatic 18) rust/lance/src/blob.rs:379— lance::blob::validate_prepared_blob_value_array 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.
lance::index::vector::details::apply_runtime_hints (cyclomatic 17) rust/lance/src/index/vector/details.rs:182— lance::index::vector::details::apply_runtime_hints 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.
lance::index::vector::details::convert_v3_metadata_to_details (cyclomatic 17) rust/lance/src/index/vector/details.rs:571— lance::index::vector::details::convert_v3_metadata_to_details 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.
lance::dataset::mem_wal::scanner::exec::pk::compute_pk_hash (cyclomatic 17) rust/lance/src/dataset/mem_wal/scanner/exec/pk.rs:91— lance::dataset::mem_wal::scanner::exec::pk::compute_pk_hash 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.
Duplicated block (16 lines × 2) rust/lance/src/datafusion/dataframe.rs:164— rust/lance/src/datafusion/dataframe.rs:164-179 | REDACTED:103-118 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16 lines × 2) rust/lance/src/dataset/builder.rs:325— rust/lance/src/dataset/builder.rs:325-340 | rust/lance/src/dataset/builder.rs:355-370 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/index/fts.rs:2175— rust/lance/src/dataset/mem_wal/index/fts.rs:2175-2190 | rust/lance/src/dataset/mem_wal/index/fts.rs:2245-2260 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/scalar/inverted.rs:479— rust/lance/src/index/scalar/inverted.rs:479-494 | rust/lance/src/index/scalar/inverted.rs:500-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) rust/lance/src/index/vector/utils.rs:731— rust/lance/src/index/vector/utils.rs:731-746 | rust/lance/src/index/vector/utils.rs:916-931 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector.rs:877— rust/lance/src/index/vector.rs:877-892 | rust/lance/src/index/vector.rs:898-913 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) rust/lance/src/index/vector.rs:1002— rust/lance/src/index/vector.rs:1002-1017 | rust/lance/src/index/vector.rs:1020-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 (16 lines × 2) rust/lance/src/io/exec/fts.rs:2962— rust/lance/src/io/exec/fts.rs:2962-2977 | rust/lance/src/io/exec/fts.rs:5138-5153 — both copies are in the same file, so extract the block into 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) rust/lance-arrow/src/json.rs:635— rust/lance-arrow/src/json.rs:635-650 | rust/lance-arrow/src/json.rs:665-680 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/compression.rs:1338— rust/lance-encoding/src/compression.rs:1338-1353 | rust/lance-encoding/src/compression.rs:1366-1381 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) rust/lance-encoding/src/encodings/logical/primitive.rs:1881— rust/lance-encoding/src/encodings/logical/primitive.rs:1881-1896 | rust/lance-encoding/src/encodings/logical/primitive/constant.rs:324-339 — 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) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:831— rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:831-846 | rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:873-888 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/encodings/logical/struct.rs:512— rust/lance-encoding/src/encodings/logical/struct.rs:512-527 | rust/lance-encoding/src/encodings/logical/struct.rs:591-606 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/versions/v1/writer/mod.rs:522— rust/lance-file/src/versions/v1/writer/mod.rs:522-537 | rust/lance-file/src/versions/v1/writer/mod.rs:571-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 (16 lines × 2) rust/lance-index/src/scalar/bitmap.rs:436— rust/lance-index/src/scalar/bitmap.rs:436-451 | rust/lance-index/src/scalar/bitmap.rs:481-496 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) rust/lance-index/src/scalar/expression.rs:1232— rust/lance-index/src/scalar/expression.rs:1232-1247 | rust/lance-index/src/scalar/expression.rs:1249-1264 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/index/partition.rs:1071— rust/lance-index/src/scalar/inverted/index/partition.rs:1071-1086 | rust/lance-index/src/scalar/inverted/index/partition.rs:1199-1214 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/vector/bq/storage.rs:1081— rust/lance-index/src/vector/bq/storage.rs:1081-1096 | rust/lance-index/src/vector/bq/storage.rs:1149-1164 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) rust/lance-index/src/vector/flat/storage.rs:172— rust/lance-index/src/vector/flat/storage.rs:172-187 | rust/lance-index/src/vector/flat/storage.rs:348-363 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) rust/lance-io/src/scheduler.rs:200— rust/lance-io/src/scheduler.rs:200-215 | rust/lance-io/src/scheduler/lite.rs:336-351 — 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) rust/lance-io/src/uring/current_thread.rs:414— rust/lance-io/src/uring/current_thread.rs:414-429 | rust/lance-io/src/uring/reader.rs:304-319 — before extracting anything, compare `rust/lance-io/src/uring/current_thread.rs` and `rust/lance-io/src/uring/reader.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance-linalg/src/simd/dist_table.rs:891— rust/lance-linalg/src/simd/dist_table.rs:891-906 | rust/lance-linalg/src/simd/dist_table.rs:1098-1113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) rust/lance-linalg/src/simd/f32.rs:702— rust/lance-linalg/src/simd/f32.rs:702-717 | rust/lance-linalg/src/simd/f64.rs:547-562 — before extracting anything, compare `rust/lance-linalg/src/simd/f32.rs` and `rust/lance-linalg/src/simd/f64.rs` as WHOLE FILES: this scan already matched 7 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 (16 lines × 2) rust/lance-table/src/rowids/index.rs:632— rust/lance-table/src/rowids/index.rs:632-647 | rust/lance-table/src/rowids/index.rs:692-707 — both copies are in the same file, so extract the block into 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) rust/lance-datafusion/src/chunker.rs:331— rust/lance-datafusion/src/chunker.rs:331-346 | rust/lance-datafusion/src/chunker.rs:427-442 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/mem_wal.rs:907— java/lance-jni/src/mem_wal.rs:907-921 | python/src/mem_wal.rs:816-830 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (15 lines × 2) rust/lance/src/dataset/blob.rs:272— rust/lance/src/dataset/blob.rs:272-286 | rust/lance/src/dataset/blob.rs:291-305 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/fragment.rs:2539— rust/lance/src/dataset/fragment.rs:2539-2553 | rust/lance/src/dataset/write/merge_insert.rs:2070-2084 — 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 (15 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:109— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:109-123 | rust/lance/src/io/exec/pushdown_scan.rs:137-151 — 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 (15 lines × 2) rust/lance/src/dataset/mem_wal/scanner/planner.rs:429— rust/lance/src/dataset/mem_wal/scanner/planner.rs:429-443 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:592-606 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/planner.rs` and `rust/lance/src/dataset/mem_wal/scanner/vector_search.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) rust/lance/src/index/vector/ivf/v2.rs:1232— rust/lance/src/index/vector/ivf/v2.rs:1232-1246 | rust/lance/src/index/vector/ivf/v2.rs:1258-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 (15 lines × 2) rust/lance/src/io/commit/conflict_resolver.rs:1195— rust/lance/src/io/commit/conflict_resolver.rs:1195-1209 | rust/lance/src/io/commit/conflict_resolver.rs:1708-1722 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/filtered_read.rs:3252— rust/lance/src/io/exec/filtered_read.rs:3252-3266 | rust/lance/src/io/exec/filtered_read.rs:3279-3293 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:4142— rust/lance/src/io/exec/fts.rs:4142-4156 | rust/lance/src/io/exec/fts.rs:4198-4212 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/encodings/physical/rle.rs:764— rust/lance-encoding/src/encodings/physical/rle.rs:764-778 | rust/lance-encoding/src/encodings/physical/rle.rs:845-859 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/reader.rs:2355— rust/lance-file/src/reader.rs:2355-2369 | rust/lance-file/src/reader.rs:2403-2417 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/vector/bq/storage.rs:2101— rust/lance-index/src/vector/bq/storage.rs:2101-2115 | rust/lance-index/src/vector/storage.rs:200-214 — before extracting anything, compare `rust/lance-index/src/vector/bq/storage.rs` and `rust/lance-index/src/vector/storage.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) rust/lance-io/src/object_store.rs:870— rust/lance-io/src/object_store.rs:870-884 | rust/lance-io/src/object_store.rs:935-949 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) rust/lance-io/src/uring/current_thread.rs:395— rust/lance-io/src/uring/current_thread.rs:395-409 | rust/lance-io/src/uring/reader.rs:285-299 — before extracting anything, compare `rust/lance-io/src/uring/current_thread.rs` and `rust/lance-io/src/uring/reader.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance-linalg/src/distance/cosine_u8.rs:93— rust/lance-linalg/src/distance/cosine_u8.rs:93-107 | rust/lance-linalg/src/distance/dot_u8.rs:57-71 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15 lines × 2) java/lance-jni/src/mem_wal.rs:1145— java/lance-jni/src/mem_wal.rs:1145-1159 | python/src/mem_wal.rs:1058-1072 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (15 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2169— rust/lance-namespace-impls/src/dir/manifest.rs:2169-2183 | rust/lance-namespace-impls/src/dir/manifest.rs:2425-2439 — both copies are in the same file, so extract the block into 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) java/src/main/java/org/lance/Dataset.java:161— java/src/main/java/org/lance/Dataset.java:161-175 | java/src/main/java/org/lance/Dataset.java:303-317 — both copies are in the same file, so extract the block into 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) python/python/lance/dataset.py:5663— python/python/lance/dataset.py:5663-5677 | python/python/lance/fragment.py:1434-1448 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `python/python/lance/dataset.py:5663` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Repeated repair: rust/lance-io/src/object_store.rs rust/lance-io/src/object_store.rs:1245— rust/lance-io/src/object_store.rs changed 17 times in last 90 days and 10 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is ObjectStore::copy_via_stream at line 1245), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(fs): fix dataset files permission on local filesystem (#8839)”; “fix(index): stream bulk index file copies (#8770)”; “fix(io): normalize OpenDAL listed paths (#8654)”; “fix(io): preserve Windows UNC share roots (#8378)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-io/src/object_store.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance-linalg/src/distance/l2.rs rust/lance-linalg/src/distance/l2.rs:360— rust/lance-linalg/src/distance/l2.rs changed 12 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is lance_linalg::distance::l2::l2_batch_f32_runtime_dispatch at line 360), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(linalg): gate L2 SimdSupport import on x86_64 (#9279)”; “fix(linalg): preserve half-kernel fallback on AVX-512 hosts (#8877)”; “fix(linalg): reject a null Int8 query instead of panicking (#8884)”; “fix(linalg): widen u8 distance accumulators (#8888)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-linalg/src/distance/l2.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance-index/src/scalar/inverted/query.rs rust/lance-index/src/scalar/inverted/query.rs:1183— rust/lance-index/src/scalar/inverted/query.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is lance_index::scalar::inverted::query::fill_fts_query_column at line 1183), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(fts): validate JSON index queries and targets (#8813)”; “fix(fts): canonicalize fuzzy expansion across segments (#8758)”; “fix(fts): include must-not clauses in query planning (#8443)”; “fix(fts): re-evaluate overlay-stale rows without segment scans (#7975)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-index/src/scalar/inverted/query.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance-core/src/error.rs rust/lance-core/src/error.rs:984— rust/lance-core/src/error.rs changed 10 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is Error::from at line 984), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: preserve typed DataFusion errors through Shared and ReplayExec (#8677)”; “fix(sql): classify malformed SQL queries as invalid input (#8974)”; “fix: recognize own commit on conflict and avoid deleting committed artifacts (#7722)”; “fix: make FTS metadata loading retry-safe (#7838)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-core/src/error.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance-linalg/src/distance/cosine.rs rust/lance-linalg/src/distance/cosine.rs:814— rust/lance-linalg/src/distance/cosine.rs changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is CosineBatchIter::next at line 814), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(linalg): preserve half-kernel fallback on AVX-512 hosts (#8877)”; “fix(linalg): reject a null Int8 query instead of panicking (#8884)”; “fix(linalg): distinguish arrow batch type errors (#8911)”; “fix(linalg): drop casts that make clippy::use_self fail off the CI baseline (#8424)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-linalg/src/distance/cosine.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance-linalg/src/distance/dot.rs rust/lance-linalg/src/distance/dot.rs:329— rust/lance-linalg/src/distance/dot.rs changed 9 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is lance_linalg::distance::dot::dot_batch_f32_runtime_dispatch at line 329), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(linalg): preserve half-kernel fallback on AVX-512 hosts (#8877)”; “fix(linalg): reject a null Int8 query instead of panicking (#8884)”; “fix(linalg): widen u8 distance accumulators (#8888)”; “fix(linalg): validate distance input lengths (#8594)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-linalg/src/distance/dot.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance-io/src/object_writer.rs rust/lance-io/src/object_writer.rs:351— rust/lance-io/src/object_writer.rs changed 7 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 12 (its worst body is ObjectWriter::poll_tasks at line 351), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(index): stream bulk index file copies (#8770)”; “fix(io): stop serializing multipart uploads behind batch encoding (#8706)”; “fix(io): add upload context to object store write failures (#8682)”; “fix(storage): preserve multipart part identity across retries (#8174)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-io/src/object_writer.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance-linalg/src/simd/dist_table.rs rust/lance-linalg/src/simd/dist_table.rs:124— rust/lance-linalg/src/simd/dist_table.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 7 (its worst body is lance_linalg::simd::dist_table::sum_4bit_dist_table_uninit at line 124), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(index): preserve 4-bit PQ scores in bulk search (#9537)”; “fix(index): reject RabitQ indices whose dimension is not a multiple of 8 (#8869)”; “fix(index): widen the RaBitQ FastScan accumulator above 1024 dims (#8842)”; “fix(index): initialize BQ distance buffers (#8598)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-linalg/src/simd/dist_table.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance-table/src/io/commit/external_manifest.rs rust/lance-table/src/io/commit/external_manifest.rs:804— rust/lance-table/src/io/commit/external_manifest.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is ExternalManifestCommitHandler::resolve_version_location at line 804), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(commit): make object storage authoritative for external manifests (#8499)”; “fix: recognize own commit on conflict and avoid deleting committed artifacts (#7722)”; “fix: persist finalized external manifest metadata (#7964)”; “fix(commit): verify finalized external manifests (#7578)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-table/src/io/commit/external_manifest.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance/src/dataset/mem_wal/scanner/block_list.rs rust/lance/src/dataset/mem_wal/scanner/block_list.rs:158— rust/lance/src/dataset/mem_wal/scanner/block_list.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is lance::dataset::mem_wal::scanner::block_list::compute_source_block_lists at line 158), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(mem_wal): dedup repeated row positions when training the flushed PK sidecar (#9595)”; “fix(index): replace scalar cache entries on store rotation (#7962)”; “fix(mem_wal): read-your-writes via split index-apply and dual visibility cursors (#7888)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/dataset/mem_wal/scanner/block_list.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance-index/src/vector/pq.rs rust/lance-index/src/vector/pq.rs:160— rust/lance-index/src/vector/pq.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is ProductQuantizer::transform_impl at line 160), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(index): preserve 4-bit PQ scores in bulk search (#9537)”; “fix(index): reject a supplied PQ codebook that does not match the column (#8999)”; “fix(index): search legacy truncated PQ indexes (#8396)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-index/src/vector/pq.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance/src/dataset/refs.rs rust/lance/src/dataset/refs.rs:992— rust/lance/src/dataset/refs.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is lance::dataset::refs::check_valid_branch at line 992), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(tag): make tag creation atomic (#8459)”; “fix(dataset): prevent deleting branches referenced by tags (#8365)”; “fix: map `object_store::Error::NotFound` to `Error::NotFound` instead of `Error::IO` (#6569)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/dataset/refs.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance/src/dataset/mem_wal/memtable/batch_store.rs rust/lance/src/dataset/mem_wal/memtable/batch_store.rs:375— rust/lance/src/dataset/mem_wal/memtable/batch_store.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is BatchStore::append_batches at line 375), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix: serialize BatchStore writers (#8595)”; “fix(mem_wal): read-your-writes via split index-apply and dual visibility cursors (#7888)”; “fix(mem_wal): use slice-aware size estimate for memtable flush threshold (#7563)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance/src/dataset/mem_wal/memtable/batch_store.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance-linalg/src/simd/i32.rs rust/lance-linalg/src/simd/i32.rs:229— rust/lance-linalg/src/simd/i32.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is i32x8::find at line 229), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(linalg): build on architectures without SIMD kernels (#9446)”; “fix(linalg): use a lane-wise intrinsic for i32x8 multiplication on x86 (#8579)”; “fix(linalg): validate slice lengths before SIMD loads (#8593)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-linalg/src/simd/i32.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance-core/src/utils/tokio.rs rust/lance-core/src/utils/tokio.rs:95— rust/lance-core/src/utils/tokio.rs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 5 (its worst body is lance_core::utils::tokio::global_cpu_runtime at line 95), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(hnsw): make a persisted HNSW cover its rows and reject invalid ones (#8834)”; “fix(core): validate CPU/IO env vars with a diagnosable error (#7856)”; “fix(lance-core): avoid aliasing &mut Runtime in global_cpu_runtime (#7682)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-core/src/utils/tokio.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: rust/lance-index/src/scalar/inverted/index/posting_prewarm.rs rust/lance-index/src/scalar/inverted/index/posting_prewarm.rs:625— rust/lance-index/src/scalar/inverted/index/posting_prewarm.rs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 10 (its worst body is PostingListReader::posting_read_chunk_ranges at line 625), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “fix(fts): preserve prewarmed state across request store wrappers (#9075)”; “fix(fts): align v1 merge reads with writer batches (#8922)”; “fix(fts): chunk posting reads during segment merge (#8668)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 21:37:56 +08:00' --until='2026-09-29 21:37:56 +08:00' --full-history --no-merges -- rust/lance-index/src/scalar/inverted/index/posting_prewarm.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.
Scanner::vector_search (cognitive 85) rust/lance/src/dataset/scanner.rs:6102— Scanner::vector_search has cognitive complexity 85 (threshold 15). Drivers by points: if/else 37 (72 pts), match/switch 3 (9 pts), boolean chains 4 (nesting depth added 41). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner::plan_compound_scorer (cognitive 37) rust/lance/src/dataset/scanner.rs:4837— Scanner::plan_compound_scorer has cognitive complexity 37 (threshold 15). Drivers by points: if/else 20 (28 pts), boolean chains 8, 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.
Scanner::create_plan_impl (cognitive 32) rust/lance/src/dataset/scanner.rs:3271— Scanner::create_plan_impl has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 5, loops 2 (3 pts), match/switch 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.
Scanner::plan_phrase_query (cognitive 31) rust/lance/src/dataset/scanner.rs:5316— Scanner::plan_phrase_query has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 3 (5 pts), boolean chains 4 (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.
Scanner::nearest (cognitive 30) rust/lance/src/dataset/scanner.rs:1990— Scanner::nearest has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 1 (3 pts), match/switch 2, 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.
Scanner::plan_match_query (cognitive 29) rust/lance/src/dataset/scanner.rs:5480— Scanner::plan_match_query has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 3 (5 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner::calculate_final_projection (cognitive 26) rust/lance/src/dataset/scanner.rs:2540— Scanner::calculate_final_projection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (22 pts), boolean chains 4 (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.
Scanner::create_filter_plan (cognitive 26) rust/lance/src/dataset/scanner.rs:3030— Scanner::create_filter_plan has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (20 pts), boolean chains 3, loops 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scanner::legacy_filtered_read (cognitive 26) rust/lance/src/dataset/scanner.rs:3510— Scanner::legacy_filtered_read has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4 (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.
Scanner::fts_rerank (cognitive 26) rust/lance/src/dataset/scanner.rs:7382— Scanner::fts_rerank has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Scanner::plan_combined_fields_query (cognitive 23) rust/lance/src/dataset/scanner.rs:5784— Scanner::plan_combined_fields_query has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (13 pts), loops 2 (4 pts), match/switch 2 (4 pts), boolean chains 2 (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.
Scanner::new_filtered_read (cognitive 20) rust/lance/src/dataset/scanner.rs:3644— Scanner::new_filtered_read has cognitive complexity 20 (threshold 15). Drivers by points: if/else 15 (17 pts), match/switch 2, 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.
Scanner::fts_document_granularity (cognitive 19) rust/lance/src/dataset/scanner.rs:4497— Scanner::fts_document_granularity has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (6 pts), boolean chains 2, match/switch 1 (nesting depth added 7). Most of this is not in the body itself: 0 of the 19 points are its own statements and the rest belongs to 2 function items inside it that branch (visit, add_leaf). 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.
Scanner::scalar_indexed_scan (cognitive 19) rust/lance/src/dataset/scanner.rs:7025— Scanner::scalar_indexed_scan has cognitive complexity 19 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 2, match/switch 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
Scanner::plan_fts (cognitive 18) rust/lance/src/dataset/scanner.rs:5079— Scanner::plan_fts has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (6 pts), boolean chains 3, 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.
Scanner::fragments_covered_by_fts_query_helper (cognitive 16) rust/lance/src/dataset/scanner.rs:4389— Scanner::fragments_covered_by_fts_query_helper has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 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.
Dataset::scanner (cognitive 114) python/src/dataset.rs:1232— Dataset::scanner has cognitive complexity 114 (threshold 15). Drivers by points: if/else 62 (98 pts), match/switch 6 (15 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Dataset::filter_addr_or_ids (cognitive 69) rust/lance/src/dataset.rs:2901— Dataset::filter_addr_or_ids has cognitive complexity 69 (threshold 15). Drivers by points: if/else 19 (52 pts), loops 5 (16 pts), boolean chains 1 (nesting depth added 44). 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.
Dataset::create_index (cognitive 58) python/src/dataset.rs:2601— Dataset::create_index has cognitive complexity 58 (threshold 15). Drivers by points: if/else 30 (49 pts), match/switch 3 (4 pts), loops 1 (3 pts), boolean chains 2 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Dataset::collect_paths (cognitive 37) rust/lance/src/dataset.rs:3457— Dataset::collect_paths has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (27 pts), loops 5 (10 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.
Dataset::new (cognitive 31) python/src/dataset.rs:930— Dataset::new has cognitive complexity 31 (threshold 15). Drivers by points: if/else 22 (28 pts), loops 1 (2 pts), match/switch 1 (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.
Dataset::merge_existing_index_segments (cognitive 30) rust/lance/src/index.rs:2095— Dataset::merge_existing_index_segments has cognitive complexity 30 (threshold 15). Drivers by points: if/else 22 (24 pts), boolean chains 3, loops 2 (3 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.
Dataset::create_data_file (cognitive 29) rust/lance/src/dataset.rs:2262— Dataset::create_data_file has cognitive complexity 29 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 3 (5 pts), boolean chains 4 (nesting depth added 8). Of this number, 20 points are the body's own statements and 9 belong to 3 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Dataset::commit_existing_index_segments (cognitive 27) rust/lance/src/index.rs:2260— Dataset::commit_existing_index_segments has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (21 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
Dataset::tracked_files_with_options (cognitive 23) rust/lance/src/dataset/files.rs:295— Dataset::tracked_files_with_options has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (7 pts), loops 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.
Dataset::load_scalar_index (cognitive 21) rust/lance/src/index.rs:2492— Dataset::load_scalar_index has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Dataset::scalar_index_info (cognitive 21) rust/lance/src/index.rs:3830— Dataset::scalar_index_info has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 3, loops 2, match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Dataset::open_vector_index_from_metadata (cognitive 20) rust/lance/src/index.rs:3376— Dataset::open_vector_index_from_metadata has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 7, boolean chains 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.
Dataset::optimize_indices (cognitive 18) rust/lance/src/index.rs:2558— Dataset::optimize_indices has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 3, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Dataset::write_into_namespace_impl (cognitive 17) rust/lance/src/dataset.rs:1004— Dataset::write_into_namespace_impl has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 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.
lance_table::transaction::row_version::resolve_update_version_metadata (cognitive 43) rust/lance-table/src/transaction/row_version.rs:91— lance_table::transaction::row_version::resolve_update_version_metadata has cognitive complexity 43 (threshold 15). Drivers by points: if/else 12 (28 pts), loops 4 (8 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_table::utils::stream::apply_row_id_and_deletes_with_system_columns (cognitive 34) rust/lance-table/src/utils/stream.rs:466— lance_table::utils::stream::apply_row_id_and_deletes_with_system_columns has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23 (27 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
lance_table::rowids::version::refresh_row_latest_update_meta_for_partial_frag_rewrite_cols (cognitive 31) rust/lance-table/src/rowids/version.rs:721— lance_table::rowids::version::refresh_row_latest_update_meta_for_partial_frag_rewrite_cols has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (24 pts), loops 2 (5 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.
lance_table::system_index::frag_reuse::ledger::order_lineage (cognitive 28) rust/lance-table/src/system_index/frag_reuse/ledger.rs:452— lance_table::system_index::frag_reuse::ledger::order_lineage has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 7 (11 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.
lance_table::transaction::validate::merge_schema_valid (cognitive 23) rust/lance-table/src/transaction/validate.rs:269— lance_table::transaction::validate::merge_schema_valid has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4, match/switch 1 (3 pts), boolean chains 2 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_table::system_index::frag_reuse::remap_fragment_bitmap (cognitive 21) rust/lance-table/src/system_index/frag_reuse.rs:490— lance_table::system_index::frag_reuse::remap_fragment_bitmap has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (11 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.
lance_table::utils::stream::wrap_with_row_id_and_delete_impl (cognitive 21) rust/lance-table/src/utils/stream.rs:669— lance_table::utils::stream::wrap_with_row_id_and_delete_impl has cognitive complexity 21 (threshold 15). Drivers by points: if/else 13 (16 pts), boolean chains 5 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
lance_table::rowids::rechunk_sequences (cognitive 21) rust/lance-table/src/rowids.rs:959— lance_table::rowids::rechunk_sequences has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_table::io::commit::current_manifest_local (cognitive 19) rust/lance-table/src/io/commit.rs:662— lance_table::io::commit::current_manifest_local has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_table::rowids::index::prep_index_chunks (cognitive 19) rust/lance-table/src/rowids/index.rs:616— lance_table::rowids::index::prep_index_chunks has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 1 (4 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.
lance_table::system_index::frag_reuse::gate::classify (cognitive 17) rust/lance-table/src/system_index/frag_reuse/gate.rs:46— lance_table::system_index::frag_reuse::gate::classify has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 6, 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.
lance_table::rowids::version::rechunk_version_sequences (cognitive 16) rust/lance-table/src/rowids/version.rs:562— lance_table::rowids::version::rechunk_version_sequences has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_table::format::key_existence::extract_key_value (cognitive 16) rust/lance-table/src/format/key_existence.rs:311— lance_table::format::key_existence::extract_key_value has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 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.
lance_table::rowids::select_row_ids (cognitive 16) rust/lance-table/src/rowids.rs:1055— lance_table::rowids::select_row_ids has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 1 (2 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.
Change coupling: fixed_size_list.rs ↔ value.rs rust/lance-encoding/src/array_encoding/physical/fixed_size_list.rs— `rust/lance-encoding/src/array_encoding/physical/fixed_size_list.rs` and `rust/lance-encoding/src/encodings/physical/value.rs` change together 92% of the time (12 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `310950db` feat: add a packed struct encoding to lance (#2593) (at that commit the file was still `rust/lance-encoding/src/encodings/physical/fixed_size_list.rs`); `4a114b2e` feat: enhance binary array encoding, make it the default (#2521) (at that commit the file was still `rust/lance-encoding/src/encodings/physical/fixed_size_list.rs`); `95f98a90` refactor: combined capacity updates and decoding for all physical dec… (at that commit the file was still `rust/lance-encoding/src/encodings/physical/fixed_size_list.rs`) — run `git show` on any of them.
Change coupling: transform.rs ↔ ivf.rs rust/lance-index/src/vector/pq/transform.rs— `rust/lance-index/src/vector/pq/transform.rs` and `rust/lance/src/index/vector/ivf.rs` change together 75% of the time (9 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `201a94d9` fix: respect precomputed partitions and shuffle buffers for v3 index …; `15420d54` perf: improve v3 indexing perf (#3525); `8c695718` refactor: remove generic PQ impl and trait (#2529) — run `git show` on any of them.
Change coupling: binary.rs ↔ dictionary.rs rust/lance-file/src/versions/v1/encoding/binary.rs— `rust/lance-file/src/versions/v1/encoding/binary.rs` and `rust/lance-file/src/versions/v1/encoding/dictionary.rs` change together 73% of the time (16 of the 22 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `c878af43` perf: create local writer for efficient local writes (#5939) (at that commit the files were still `rust/lance-io/src/encodings/binary.rs` and `rust/lance-io/src/encodings/dictionary.rs`); `50e00d65` perf: use an asynchronous open function even for local files (#1721) (at that commit the files were still `rust/lance-core/src/encodings/binary.rs` and `rust/lance-core/src/encodings/dictionary.rs`); `9a6e5683` test: fix flaky tests involving tokio::fs::File (#1430) (at that commit the files were still `rust/lance-core/src/encodings/binary.rs` and `rust/lance-core/src/encodings/dictionary.rs`) — run `git show` on any of them.
Change coupling: pq.rs ↔ index_extension.rs rust/lance/src/index/vector/pq.rs— `rust/lance/src/index/vector/pq.rs` and `rust/lance/src/session/index_extension.rs` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `417b9a83` fix: panic if only one partition and split is triggered (#5241); `a767eda4` feat!: add minimum probes and maximum probes to IVF search (#3903); `59b414b5` feat: support to read IVF partitions (#3462) — run `git show` on any of them.
Change coupling: __init__.py ↔ indices.rs python/python/lance/indices/__init__.py— `python/python/lance/indices/__init__.py` and `python/src/indices.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `8ada2e9a` refactor!: remove index segment builder (#6997); `8962655c` feat: support segmented inverted index build and search (#6305); `1ef63109` refactor!: align distributed index build around segments (#6313) — run `git show` on any of them.
Change coupling: quantizer.rs ↔ subindex.rs rust/lance-index/src/vector/quantizer.rs— `rust/lance-index/src/vector/quantizer.rs` and `rust/lance-index/src/vector/v3/subindex.rs` change together 60% of the time (6 of the 10 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `774d1bd9` feat: introduce `CacheCodec` for serializing index cache entries (#6223); `72ae3554` feat: support remapping for IVF_FLAT, IVF_PQ and IVF_SQ (#2708); `d830c380` refactor: impl the sub index trait for HNSW and clean code (#2462) — run `git show` on any of them.
Change coupling: cosine.rs ↔ l2.rs rust/lance-linalg/src/distance/cosine.rs— `rust/lance-linalg/src/distance/cosine.rs` and `rust/lance-linalg/src/distance/l2.rs` change together 59% of the time (19 of the 32 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 19 shared commits counted here, the most recent 3 are `8c392b28` fix(linalg): reject a null Int8 query instead of panicking (#8884); `ab268baa` fix: fall back to AVX2 f16 kernels on AVX-512 CPUs (#7428); `fe875b70` fix: compile AVX-512 dist table for target CPU (#7121) — run `git show` on any of them.
Change coupling: blocking_dataset.rs ↔ WriteDatasetBuilder.java java/lance-jni/src/blocking_dataset.rs— `java/lance-jni/src/blocking_dataset.rs` and `java/src/main/java/org/lance/WriteDatasetBuilder.java` change together 58% of the time (7 of the 12 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 7 shared commits counted here, the most recent 3 are `d143ca29` feat!: expose file writer page options in dataset APIs (#9192); `fd076b19` feat: expose base scoped store bindings to java (#6548); `96725732` feat: add configurable blob v2 pack file size (#6508) — run `git show` on any of them.
Change coupling: binary.rs ↔ page_table.rs rust/lance-file/src/versions/v1/encoding/binary.rs— `rust/lance-file/src/versions/v1/encoding/binary.rs` and `rust/lance-file/src/versions/v1/page_table.rs` change together 56% of the time (10 of the 18 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `c878af43` perf: create local writer for efficient local writes (#5939) (at that commit the files were still `rust/lance-io/src/encodings/binary.rs` and `rust/lance-file/src/previous/page_table.rs`); `50e00d65` perf: use an asynchronous open function even for local files (#1721) (at that commit the files were still `rust/lance-core/src/encodings/binary.rs` and `rust/lance-core/src/format/page_table.rs`); `57f9269a` refactor: move reader trait to lance-core (#1393) (at that commit the files were still `rust/lance/src/encodings/binary.rs` and `rust/lance/src/format/page_table.rs`) — run `git show` on any of them.
Change coupling: datagen.rs ↔ dataset.rs rust/lance-testing/src/datagen.rs— `rust/lance-testing/src/datagen.rs` and `rust/lance/src/dataset.rs` change together 55% of the time (6 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 6 shared commits counted here, the most recent 3 are `53382381` feat: int8 support for distance functions (#3605); `63227f4e` feat: stable row id support in queries (#2452); `9c9ac515` feat: once a table has been created with v1 or v2 format then it shou… — run `git show` on any of them.
Change coupling: dot.rs ↔ norm_l2.rs rust/lance-linalg/src/distance/dot.rs— `rust/lance-linalg/src/distance/dot.rs` and `rust/lance-linalg/src/distance/norm_l2.rs` change together 54% of the time (15 of the 28 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 15 shared commits counted here, the most recent 3 are `ab268baa` fix: fall back to AVX2 f16 kernels on AVX-512 CPUs (#7428); `fe875b70` fix: compile AVX-512 dist table for target CPU (#7121); `d0124edf` perf: add SIMD kernels for bf16 distance functions (#6510) — run `git show` on any of them.
Change coupling: residual.rs ↔ ivf.rs rust/lance-index/src/vector/residual.rs— `rust/lance-index/src/vector/residual.rs` and `rust/lance/src/index/vector/ivf.rs` change together 53% of the time (9 of the 17 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `201a94d9` fix: respect precomputed partitions and shuffle buffers for v3 index …; `53382381` feat: int8 support for distance functions (#3605); `4444c60b` feat!: support hamming distance & binary vector (#3198) — run `git show` on any of them.
Change coupling: manifest.rs ↔ rest_adapter.rs rust/lance-namespace-impls/src/dir/manifest.rs— `rust/lance-namespace-impls/src/dir/manifest.rs` and `rust/lance-namespace-impls/src/rest_adapter.rs` change together 53% of the time (10 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 10 shared commits counted here, the most recent 3 are `e100ce5e` refactor(namespace): remove table_version_storage_enabled and __manif…; `000de656` feat: update lance-namespace to 0.7.2 and align namespace declared ta…; `5b9f8690` fix(namespace): align error handling with namespace spec (#6575) — run `git show` on any of them.
Scanner::vector_search (cyclomatic 34) rust/lance/src/dataset/scanner.rs:6102— Scanner::vector_search 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.
Scanner::plan_compound_scorer (cyclomatic 30) rust/lance/src/dataset/scanner.rs:4837— Scanner::plan_compound_scorer 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.
Scanner::create_plan_impl (cyclomatic 28) rust/lance/src/dataset/scanner.rs:3271— Scanner::create_plan_impl 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.
Scanner::plan_phrase_query (cyclomatic 19) rust/lance/src/dataset/scanner.rs:5316— Scanner::plan_phrase_query 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.
Scanner::new_filtered_read (cyclomatic 18) rust/lance/src/dataset/scanner.rs:3644— Scanner::new_filtered_read 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.
Scanner::plan_match_query (cyclomatic 18) rust/lance/src/dataset/scanner.rs:5480— Scanner::plan_match_query 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.
Scanner::plan_combined_fields_query (cyclomatic 18) rust/lance/src/dataset/scanner.rs:5784— Scanner::plan_combined_fields_query 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.
Scanner::calculate_final_projection (cyclomatic 17) rust/lance/src/dataset/scanner.rs:2540— Scanner::calculate_final_projection 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.
Scanner::fts_document_granularity (cyclomatic 17) rust/lance/src/dataset/scanner.rs:4497— Scanner::fts_document_granularity has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 1 of the 17 points is its own statement and the rest belongs to 2 function items inside it that branch (visit, add_leaf). 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.
Scanner::nearest (cyclomatic 16) rust/lance/src/dataset/scanner.rs:1990— Scanner::nearest 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.
Scanner::plan_fts (cyclomatic 16) rust/lance/src/dataset/scanner.rs:5079— Scanner::plan_fts 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.
Scanner::scalar_indexed_scan (cyclomatic 16) rust/lance/src/dataset/scanner.rs:7025— Scanner::scalar_indexed_scan 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×12
Members sharing a duplicated core (4 members, 50+ identical tokens) java/lance-jni/src/mem_wal.rs:764— java/lance-jni/src/mem_wal.rs:764-792 | java/lance-jni/src/mem_wal.rs:884-930 | python/src/mem_wal.rs:720-743 | python/src/mem_wal.rs:793-837 — 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) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1084— rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1084-1282 | rust/lance/src/dataset/mem_wal/scanner/planner.rs:336-477 | rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:673-797 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:468-630 — 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) rust/lance/src/dataset/refs.rs:218— rust/lance/src/dataset/refs.rs:218-232 | rust/lance/src/dataset/refs.rs:253-266 | rust/lance/src/dataset/refs.rs:268-295 | rust/lance/src/dataset/refs.rs:301-322 — 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) rust/lance-file/src/versions/v2_0/reader.rs:137— rust/lance-file/src/versions/v2_0/reader.rs:137-148 | rust/lance-file/src/versions/v2_1/reader.rs:180-191 | rust/lance-file/src/versions/v2_2/reader.rs:182-193 | rust/lance-file/src/versions/v2_3/reader.rs:220-231 — 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) rust/lance-file/src/versions/v2_0/reader.rs:350— rust/lance-file/src/versions/v2_0/reader.rs:350-378 | rust/lance-file/src/versions/v2_1/reader.rs:215-241 | rust/lance-file/src/versions/v2_2/reader.rs:217-243 | rust/lance-file/src/versions/v2_3/reader.rs:255-281 — 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) rust/lance-index/src/vector/bq/storage.rs:2059— rust/lance-index/src/vector/bq/storage.rs:2059-2079 | rust/lance-index/src/vector/bq/storage.rs:2089-2115 | rust/lance-index/src/vector/storage.rs:186-214 | rust/lance-index/src/vector/storage.rs:226-247 — 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) rust/lance-linalg/src/distance/cosine.rs:1008— rust/lance-linalg/src/distance/cosine.rs:1008-1045 | rust/lance-linalg/src/distance/dot.rs:731-764 | rust/lance-linalg/src/distance/l2.rs:797-835 | rust/lance-linalg/src/distance/norm_l2.rs:357-383 — 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) rust/lance-linalg/src/distance/cosine.rs:1189— rust/lance-linalg/src/distance/cosine.rs:1189-1210 | rust/lance-linalg/src/distance/cosine.rs:1214-1231 | rust/lance-linalg/src/distance/dot.rs:662-680 | rust/lance-linalg/src/distance/l2.rs:716-738 — 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) rust/lance-linalg/src/simd/f32.rs:259— rust/lance-linalg/src/simd/f32.rs:259-276 | rust/lance-linalg/src/simd/f32.rs:278-295 | rust/lance-linalg/src/simd/f64.rs:152-169 | rust/lance-linalg/src/simd/f64.rs:171-188 — 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) rust/lance-linalg/src/simd/f32.rs:743— rust/lance-linalg/src/simd/f32.rs:743-762 | rust/lance-linalg/src/simd/f32.rs:765-784 | rust/lance-linalg/src/simd/f64.rs:588-608 | rust/lance-linalg/src/simd/f64.rs:611-631 — 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) rust/lance-namespace-impls/src/credentials/azure.rs:392— rust/lance-namespace-impls/src/credentials/azure.rs:392-433 | rust/lance-namespace-impls/src/credentials/azure.rs:435-491 | rust/lance-namespace-impls/src/credentials/azure.rs:497-550 | rust/lance-namespace-impls/src/credentials/gcp.rs:1097-1133 — 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) python/python/lance/dataset.py:4360— python/python/lance/dataset.py:4360-4596 | python/python/lance/dataset.py:4633-4741 | python/python/lance/dataset.py:5611-5677 | python/python/lance/fragment.py:1250-1448 — 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 (5 lines × 3) rust/lance/src/io/exec/fts.rs:2985— rust/lance/src/io/exec/fts.rs:2985-2989 | rust/lance/src/io/exec/fts.rs:3482-3486 | rust/lance/src/io/exec/fts.rs:5161-5165 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-datafusion/src/udf/json.rs:288— rust/lance-datafusion/src/udf/json.rs:288-292 | rust/lance-datafusion/src/udf/json.rs:517-521 | rust/lance-datafusion/src/udf/json.rs:570-574 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-encoding/src/encodings/logical/list.rs:54— rust/lance-encoding/src/encodings/logical/list.rs:54-59 | rust/lance-encoding/src/encodings/logical/list.rs:66-70 | rust/lance-encoding/src/encodings/logical/map.rs:57-61 — 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) rust/lance-file/src/versions/v2_1/writer.rs:82— rust/lance-file/src/versions/v2_1/writer.rs:82-86 | rust/lance-file/src/versions/v2_2/writer.rs:82-86 | rust/lance-file/src/versions/v2_3/writer.rs:82-86 — `rust/lance-file/src/versions/v2_1/writer.rs` and `rust/lance-file/src/versions/v2_2/writer.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 4 separate duplicated blocks between them, totalling at least 62 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) rust/lance-index/src/scalar/btree.rs:220— rust/lance-index/src/scalar/btree.rs:220-224 | rust/lance-index/src/scalar/btree.rs:234-238 | rust/lance-index/src/scalar/btree.rs:248-252 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-index/src/scalar/json.rs:722— rust/lance-index/src/scalar/json.rs:722-726 | rust/lance-index/src/scalar/json.rs:743-747 | rust/lance-index/src/scalar/json.rs:764-768 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-linalg/src/distance/cosine.rs:964— rust/lance-linalg/src/distance/cosine.rs:964-968 | rust/lance-linalg/src/distance/cosine.rs:994-998 | rust/lance-linalg/src/distance/cosine.rs:1036-1040 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-linalg/src/distance/cosine_u8.rs:144— rust/lance-linalg/src/distance/cosine_u8.rs:144-148 | rust/lance-linalg/src/distance/dot_u8.rs:103-107 | rust/lance-linalg/src/distance/l2_u8.rs:102-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (5 lines × 3) rust/lance-linalg/src/simd/dist_table.rs:210— rust/lance-linalg/src/simd/dist_table.rs:210-214 | rust/lance-linalg/src/simd/dist_table.rs:438-442 | rust/lance-linalg/src/simd/dist_table.rs:476-480 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 3) rust/lance-namespace-impls/src/credentials/aws.rs:299— rust/lance-namespace-impls/src/credentials/aws.rs:299-303 | rust/lance-namespace-impls/src/credentials/azure.rs:237-241 | rust/lance-namespace-impls/src/credentials/gcp.rs:757-761 — before extracting anything, compare `rust/lance-namespace-impls/src/credentials/aws.rs` and `rust/lance-namespace-impls/src/credentials/gcp.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) rust/lance-datafusion/src/expr.rs:126— rust/lance-datafusion/src/expr.rs:126-130 | rust/lance-datafusion/src/expr.rs:152-156 | rust/lance-datafusion/src/expr.rs:180-184 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-linalg/src/simd/dist_table.rs:199— rust/lance-linalg/src/simd/dist_table.rs:199-203 | rust/lance-linalg/src/simd/dist_table.rs:425-429 | rust/lance-linalg/src/simd/dist_table.rs:465-469 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner (cyclomatic 124) rust/lance-index/src/vector/distributed/index_merger.rs:862— lance_index::vector::distributed::index_merger::merge_partial_vector_auxiliary_files_inner has cyclomatic complexity 124 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
lance_index::vector::graph::beam_search_acorn (cyclomatic 35) rust/lance-index/src/vector/graph.rs:563— lance_index::vector::graph::beam_search_acorn 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.
lance_index::scalar::inverted::index::flat_search::tokenize_and_count (cyclomatic 24) rust/lance-index/src/scalar/inverted/index/flat_search.rs:223— lance_index::scalar::inverted::index::flat_search::tokenize_and_count 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.
lance_index::scalar::expression::extract_like_leading_prefix (cyclomatic 24) rust/lance-index/src/scalar/expression.rs:534— lance_index::scalar::expression::extract_like_leading_prefix 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.
lance_index::vector::bq::ex_dot::unpack_group (cyclomatic 22) rust/lance-index/src/vector/bq/ex_dot.rs:215— lance_index::vector::bq::ex_dot::unpack_group has cyclomatic complexity 22 (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.
lance_index::vector::distributed::index_merger::fixed_size_list_almost_equal (cyclomatic 21) rust/lance-index/src/vector/distributed/index_merger.rs:107— lance_index::vector::distributed::index_merger::fixed_size_list_almost_equal 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.
lance_index::scalar::fmindex::write_partitioned_fmindex_stream_with_config (cyclomatic 18) rust/lance-index/src/scalar/fmindex.rs:1734— lance_index::scalar::fmindex::write_partitioned_fmindex_stream_with_config has cyclomatic complexity 18 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
lance_index::scalar::inverted::cross_column::score_cross_column_sources (cyclomatic 18) rust/lance-index/src/scalar/inverted/cross_column.rs:1167— lance_index::scalar::inverted::cross_column::score_cross_column_sources 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.
lance_index::scalar::inverted::wand::exclusive_partial_score_limit (cyclomatic 17) rust/lance-index/src/scalar/inverted/wand.rs:1833— lance_index::scalar::inverted::wand::exclusive_partial_score_limit 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.
lance_index::vector::distributed::index_merger::read_shard_window_partitions (cyclomatic 17) rust/lance-index/src/vector/distributed/index_merger.rs:723— lance_index::vector::distributed::index_merger::read_shard_window_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.
lance_index::vector::bq::ex_dot::pack_block (cyclomatic 16) rust/lance-index/src/vector/bq/ex_dot.rs:129— lance_index::vector::bq::ex_dot::pack_block has cyclomatic complexity 16 (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.
Wand::maxscore_search (cognitive 513) rust/lance-index/src/scalar/inverted/wand.rs:2936— Wand::maxscore_search has cognitive complexity 513 (threshold 15). Drivers by points: if/else 80 (392 pts), loops 20 (76 pts), match/switch 14 (23 pts), boolean chains 22 (nesting depth added 377). 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.
Wand::and_bulk_search (cognitive 193) rust/lance-index/src/scalar/inverted/wand.rs:4083— Wand::and_bulk_search has cognitive complexity 193 (threshold 15). Drivers by points: if/else 86 (220 pts), loops 33 (65 pts), match/switch 8 (24 pts), boolean chains 9 (nesting depth added 182). To reduce it, split the body into named stages: move each independent 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 (Wand::and_bulk_search::merge_window_docs_pairwise) 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.
Wand::complete_maxscore_single_essential (cognitive 103) rust/lance-index/src/scalar/inverted/wand_maxscore.rs:424— Wand::complete_maxscore_single_essential has cognitive complexity 103 (threshold 15). Drivers by points: if/else 28 (70 pts), loops 10 (23 pts), boolean chains 10 (nesting depth added 55). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Wand::next_and_candidate (cognitive 65) rust/lance-index/src/scalar/inverted/wand.rs:3922— Wand::next_and_candidate has cognitive complexity 65 (threshold 15). Drivers by points: if/else 20 (56 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 37). 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.
Wand::search (cognitive 63) rust/lance-index/src/scalar/inverted/wand.rs:2667— Wand::search has cognitive complexity 63 (threshold 15). Drivers by points: if/else 25 (54 pts), boolean chains 8, loops 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.
Wand::next (cognitive 41) rust/lance-index/src/scalar/inverted/wand.rs:3833— Wand::next has cognitive complexity 41 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 3 (5 pts), match/switch 1 (3 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.
Wand::prepare_score_first_and_window (cognitive 31) rust/lance-index/src/scalar/inverted/wand.rs:3716— Wand::prepare_score_first_and_window has cognitive complexity 31 (threshold 15). Drivers by points: if/else 16 (26 pts), boolean chains 3, 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.
Wand::score_single_essential_upto (cognitive 29) rust/lance-index/src/scalar/inverted/wand_maxscore.rs:301— Wand::score_single_essential_upto has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (27 pts), boolean chains 1, loops 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.
Wand::flat_search (cognitive 24) rust/lance-index/src/scalar/inverted/wand.rs:2831— Wand::flat_search has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 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.
Wand::and_bulk_search::merge_window_docs_pairwise (cognitive 20) rust/lance-index/src/scalar/inverted/wand.rs:4423— Wand::and_bulk_search::merge_window_docs_pairwise has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Wand::and_bulk_search) 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.
Wand::check_positions (cognitive 17) rust/lance-index/src/scalar/inverted/wand.rs:5602— Wand::check_positions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransactionRebase::check_rewrite_txn (cognitive 113) rust/lance/src/io/commit/conflict_resolver.rs:1234— TransactionRebase::check_rewrite_txn has cognitive complexity 113 (threshold 15). Drivers by points: if/else 24 (71 pts), loops 7 (31 pts), boolean chains 6, match/switch 2 (5 pts) (nesting depth added 74). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransactionRebase::check_create_index_txn (cognitive 106) rust/lance/src/io/commit/conflict_resolver.rs:828— TransactionRebase::check_create_index_txn has cognitive complexity 106 (threshold 15). Drivers by points: if/else 23 (70 pts), loops 5 (20 pts), boolean chains 14, match/switch 1 (2 pts) (nesting depth added 63). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TransactionRebase::check_update_txn (cognitive 105) rust/lance/src/io/commit/conflict_resolver.rs:573— TransactionRebase::check_update_txn has cognitive complexity 105 (threshold 15). Drivers by points: if/else 25 (82 pts), loops 5 (16 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 71). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransactionRebase::check_data_replacement_txn (cognitive 95) rust/lance/src/io/commit/conflict_resolver.rs:1604— TransactionRebase::check_data_replacement_txn has cognitive complexity 95 (threshold 15). Drivers by points: if/else 11 (45 pts), loops 12 (44 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransactionRebase::finish_delete_update (cognitive 39) rust/lance/src/io/commit/conflict_resolver.rs:2254— TransactionRebase::finish_delete_update has cognitive complexity 39 (threshold 15). Drivers by points: if/else 11 (25 pts), loops 3 (10 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TransactionRebase::finish_create_index (cognitive 38) rust/lance/src/io/commit/conflict_resolver.rs:2500— TransactionRebase::finish_create_index has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 4 (12 pts), boolean chains 2 (nesting depth added 23). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
TransactionRebase::check_delete_txn (cognitive 37) rust/lance/src/io/commit/conflict_resolver.rs:469— TransactionRebase::check_delete_txn has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (29 pts), loops 2 (6 pts), 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.
TransactionRebase::finish_rewrite (cognitive 35) rust/lance/src/io/commit/conflict_resolver.rs:2608— TransactionRebase::finish_rewrite has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 2 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 21). 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.
TransactionRebase::check_add_bases_txn (cognitive 20) rust/lance/src/io/commit/conflict_resolver.rs:2140— TransactionRebase::check_add_bases_txn has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (7 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.
TransactionRebase::check_data_overlay_txn (cognitive 19) rust/lance/src/io/commit/conflict_resolver.rs:1784— TransactionRebase::check_data_overlay_txn has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Duplicated block (17 lines × 2) java/lance-jni/src/schema.rs:257— java/lance-jni/src/schema.rs:257-273 | java/lance-jni/src/schema.rs:315-331 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/btree.rs:92— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/btree.rs:92-108 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:109-125 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/btree.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs` as WHOLE FILES: this scan already matched 4 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. If that is what happened, the fix is to keep one copy and have the 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) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:113— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:113-129 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:147-163 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) rust/lance/src/dataset/scanner.rs:7346— rust/lance/src/dataset/scanner.rs:7346-7362 | rust/lance/src/dataset/scanner.rs:7412-7428 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/ivf/v2.rs:460— rust/lance/src/index/vector/ivf/v2.rs:460-476 | rust/lance/src/index/vector/ivf/v2.rs:1796-1812 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:2679— rust/lance/src/io/exec/fts.rs:2679-2695 | rust/lance/src/io/exec/fts.rs:2743-2759 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:4897— rust/lance/src/io/exec/fts.rs:4897-4913 | rust/lance/src/io/exec/fts.rs:4953-4969 — both copies are in the same file, so extract the block into 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) rust/lance-core/src/datatypes/field.rs:1237— rust/lance-core/src/datatypes/field.rs:1237-1253 | rust/lance-encoding/src/encoder/structural.rs:233-249 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (17 lines × 2) rust/lance-index/src/vector/hnsw/builder.rs:890— rust/lance-index/src/vector/hnsw/builder.rs:890-906 | rust/lance-index/src/vector/hnsw/online.rs:351-367 — 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) rust/lance-namespace-impls/src/dir.rs:4858— rust/lance-namespace-impls/src/dir.rs:4858-4874 | rust/lance-namespace-impls/src/dir.rs:4901-4917 — both copies are in the same file, so extract the block into 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 × 3) rust/lance/src/io/commit/conflict_resolver.rs:488— rust/lance/src/io/commit/conflict_resolver.rs:488-493 | rust/lance/src/io/commit/conflict_resolver.rs:736-741 | rust/lance/src/io/commit/conflict_resolver.rs:1348-1353 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance/src/io/exec/fts.rs:4421— rust/lance/src/io/exec/fts.rs:4421-4427 | rust/lance/src/io/exec/fts.rs:4797-4803 | rust/lance/src/io/exec/rowids.rs:222-227 — 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 (6 lines × 3) rust/lance-index/src/scalar/rtree.rs:661— rust/lance-index/src/scalar/rtree.rs:661-666 | rust/lance-index/src/scalar/rtree.rs:821-826 | rust/lance-index/src/scalar/rtree.rs:1200-1205 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-io/src/lib.rs:232— rust/lance-io/src/lib.rs:232-237 | rust/lance-io/src/lib.rs:287-292 | rust/lance-table/src/rowids.rs:1098-1103 — 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 (6 lines × 3) rust/lance-linalg/src/distance/cosine_u8.rs:92— rust/lance-linalg/src/distance/cosine_u8.rs:92-97 | rust/lance-linalg/src/distance/dot_u8.rs:56-61 | rust/lance-linalg/src/distance/l2_u8.rs:62-67 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) rust/lance-file/src/reader/structural.rs:207— rust/lance-file/src/reader/structural.rs:207-212 | rust/lance-file/src/versions/v1/mod.rs:86-91 | rust/lance-file/src/versions/v2_0/mod.rs:52-57 — `rust/lance-file/src/versions/v1/mod.rs` and `rust/lance-file/src/versions/v2_0/mod.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 4 separate duplicated blocks between them, totalling at least 34 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) rust/lance-file/src/versions/v2_1/writer.rs:88— rust/lance-file/src/versions/v2_1/writer.rs:88-93 | rust/lance-file/src/versions/v2_2/writer.rs:88-93 | rust/lance-file/src/versions/v2_3/writer.rs:88-93 — `rust/lance-file/src/versions/v2_1/writer.rs` and `rust/lance-file/src/versions/v2_2/writer.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 4 separate duplicated blocks between them, totalling at least 62 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) rust/lance-index/src/scalar/inverted/compound.rs:2610— rust/lance-index/src/scalar/inverted/compound.rs:2610-2615 | rust/lance-index/src/scalar/inverted/compound.rs:2883-2888 | rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:586-591 — before extracting anything, compare `rust/lance-index/src/scalar/inverted/compound.rs` and `rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 3) rust/lance-file/src/versions/v1/writer/mod.rs:419— rust/lance-file/src/versions/v1/writer/mod.rs:419-424 | rust/lance-file/src/versions/v1/writer/mod.rs:436-441 | rust/lance-file/src/versions/v1/writer/mod.rs:455-460 — all 3 copies are in the same file, so extract the block into one function there and call 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) java/src/main/java/org/lance/Dataset.java:1492— java/src/main/java/org/lance/Dataset.java:1492-1497 | java/src/main/java/org/lance/Dataset.java:1988-1993 | java/src/main/java/org/lance/Dataset.java:2030-2035 — all 3 copies are in the same file, so extract the block into one function there and call 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 `java/src/main/java/org/lance/Dataset.java:1492` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1215— rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1215-1226 | rust/lance/src/dataset/mem_wal/scanner/planner.rs:428-439 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:591-602 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/fts_search.rs` and `rust/lance/src/dataset/mem_wal/scanner/planner.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance-datafusion/src/udf/json.rs:635— rust/lance-datafusion/src/udf/json.rs:635-646 | rust/lance-datafusion/src/udf/json.rs:691-702 | rust/lance-datafusion/src/udf/json.rs:747-758 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-file/src/versions/v2_1/mod.rs:79— rust/lance-file/src/versions/v2_1/mod.rs:79-90 | rust/lance-file/src/versions/v2_2/mod.rs:82-93 | rust/lance-file/src/versions/v2_3/mod.rs:90-101 — `rust/lance-file/src/versions/v2_2/mod.rs` and `rust/lance-file/src/versions/v2_3/mod.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 57 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) rust/lance-file/src/versions/v2_1/reader.rs:27— rust/lance-file/src/versions/v2_1/reader.rs:27-38 | rust/lance-file/src/versions/v2_2/reader.rs:27-38 | rust/lance-file/src/versions/v2_3/reader.rs:27-38 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.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 10 separate duplicated blocks between them, totalling at least 158 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) rust/lance-file/src/versions/v2_1/reader.rs:165— rust/lance-file/src/versions/v2_1/reader.rs:165-176 | rust/lance-file/src/versions/v2_2/reader.rs:167-178 | rust/lance-file/src/versions/v2_3/reader.rs:205-216 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.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 10 separate duplicated blocks between them, totalling at least 158 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) rust/lance-index/src/scalar/inverted/tokenizer.rs:347— rust/lance-index/src/scalar/inverted/tokenizer.rs:347-358 | rust/lance-index/src/scalar/inverted/tokenizer.rs:368-379 | rust/lance-index/src/scalar/inverted/tokenizer.rs:383-394 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-index/src/vector/distributed/index_merger.rs:267— rust/lance-index/src/vector/distributed/index_merger.rs:267-278 | rust/lance-index/src/vector/distributed/index_merger.rs:306-317 | rust/lance-index/src/vector/distributed/index_merger.rs:347-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 (12 lines × 3) rust/lance-file/src/reader/structural.rs:248— rust/lance-file/src/reader/structural.rs:248-259 | rust/lance-file/src/versions/v1/mod.rs:43-54 | rust/lance-file/src/versions/v2_0/reader.rs:205-216 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) java/src/main/java/org/lance/Dataset.java:870— java/src/main/java/org/lance/Dataset.java:870-881 | java/src/main/java/org/lance/Dataset.java:899-910 | java/src/main/java/org/lance/Dataset.java:949-960 — all 3 copies are in the same file, so extract the block into one function there and call 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 `java/src/main/java/org/lance/Dataset.java:870` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8–9 lines × 2) rust/lance/src/dataset/fragment.rs:1165— rust/lance/src/dataset/fragment.rs:1165-1173 | rust/lance/src/dataset/fragment.rs:1278-1285 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/hamming.rs:499— rust/lance/src/index/vector/hamming.rs:499-506 | rust/lance/src/index/vector/hamming.rs:615-623 — both copies are in the same file, so extract the block into 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) rust/lance-datafusion/src/udf/json.rs:284— rust/lance-datafusion/src/udf/json.rs:284-291 | rust/lance-datafusion/src/udf/json.rs:565-573 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) rust/lance-index/src/scalar/bitmap.rs:548— rust/lance-index/src/scalar/bitmap.rs:548-555 | rust/lance-index/src/scalar/bitmap.rs:593-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 (8–9 lines × 2) rust/lance-index/src/scalar/inverted/builder.rs:1589— rust/lance-index/src/scalar/inverted/builder.rs:1589-1596 | rust/lance-index/src/scalar/inverted/builder.rs:1653-1661 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/builder.rs:1757— rust/lance-index/src/scalar/inverted/builder.rs:1757-1765 | rust/lance-index/src/scalar/inverted/builder.rs:1770-1777 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/wand.rs:4301— rust/lance-index/src/scalar/inverted/wand.rs:4301-4309 | rust/lance-index/src/scalar/inverted/wand.rs:4331-4338 — both copies are in the same file, so extract the block into 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) rust/lance-linalg/src/simd/f32.rs:336— rust/lance-linalg/src/simd/f32.rs:336-344 | rust/lance-linalg/src/simd/f32.rs:825-832 — both copies are in the same file, so extract the block into 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) rust/lance-table/src/utils/stream.rs:275— rust/lance-table/src/utils/stream.rs:275-283 | rust/lance-table/src/utils/stream.rs:300-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.
Dataset::scanner (cyclomatic 66) python/src/dataset.rs:1232— Dataset::scanner 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.
Dataset::create_index (cyclomatic 49) python/src/dataset.rs:2601— Dataset::create_index 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.
Dataset::merge_existing_index_segments (cyclomatic 25) rust/lance/src/index.rs:2095— Dataset::merge_existing_index_segments has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Dataset::new (cyclomatic 23) python/src/dataset.rs:930— Dataset::new 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.
Dataset::commit_existing_index_segments (cyclomatic 22) rust/lance/src/index.rs:2260— Dataset::commit_existing_index_segments has cyclomatic complexity 22 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Dataset::open_vector_index_from_metadata (cyclomatic 22) rust/lance/src/index.rs:3376— Dataset::open_vector_index_from_metadata has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Dataset::create_data_file (cyclomatic 21) rust/lance/src/dataset.rs:2262— Dataset::create_data_file has cyclomatic complexity 21 (threshold 15). Of this number, 13 points are the body's own statements and 8 belong to 3 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Dataset::filter_addr_or_ids (cyclomatic 20) rust/lance/src/dataset.rs:2901— Dataset::filter_addr_or_ids 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.
Transaction::build_manifest_prepared (cognitive 286) rust/lance-table/src/transaction/manifest_build.rs:585— Transaction::build_manifest_prepared has cognitive complexity 286 (threshold 15). Drivers by points: if/else 82 (179 pts), loops 25 (66 pts), boolean chains 21, match/switch 10 (20 pts) (nesting depth added 148). 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.
Transaction::try_from (cognitive 39) rust/lance-table/src/transaction/proto.rs:86— Transaction::try_from has cognitive complexity 39 (threshold 15). Drivers by points: if/else 21 (32 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Transaction::withdraw_rewritten_coverage (cognitive 32) rust/lance-table/src/transaction/index_maintenance.rs:259— Transaction::withdraw_rewritten_coverage has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (6 pts), match/switch 1 (4 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Transaction::retain_relevant_indices (cognitive 31) rust/lance-table/src/transaction/index_maintenance.rs:517— Transaction::retain_relevant_indices has cognitive complexity 31 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (11 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Transaction::prune_overlay_stale_fields_from_indices (cognitive 27) rust/lance-table/src/transaction/index_maintenance.rs:474— Transaction::prune_overlay_stale_fields_from_indices has cognitive complexity 27 (threshold 15). Drivers by points: loops 6 (16 pts), if/else 3 (10 pts), boolean chains 1 (nesting depth added 17). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
Transaction::apply_mem_wal_index_coverage (cognitive 19) rust/lance-table/src/transaction/manifest_build.rs:252— Transaction::apply_mem_wal_index_coverage has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Transaction::assign_row_ids (cognitive 18) rust/lance-table/src/transaction/row_version.rs:332— Transaction::assign_row_ids has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 3 (10 pts), loops 2 (5 pts), if/else 2 (3 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Transaction::register_pure_rewrite_rows_update_frags_in_indices (cognitive 17) rust/lance-table/src/transaction/index_maintenance.rs:28— Transaction::register_pure_rewrite_rows_update_frags_in_indices has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_jni::transaction::convert_to_rust_operation (cognitive 39) java/lance-jni/src/transaction.rs:1682— lance_jni::transaction::convert_to_rust_operation has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 2 (6 pts), match/switch 2 (5 pts) (nesting depth added 21). 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.
lance_jni::blocking_scanner::build_scanner_with_options (cognitive 28) java/lance-jni/src/blocking_scanner.rs:289— lance_jni::blocking_scanner::build_scanner_with_options has cognitive complexity 28 (threshold 15). Drivers by points: if/else 21 (24 pts), loops 2 (3 pts), match/switch 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
lance_jni::index::determine_index_type (cognitive 26) java/lance-jni/src/index.rs:188— lance_jni::index::determine_index_type has cognitive complexity 26 (threshold 15). Drivers by points: if/else 20 (25 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
lance_jni::transaction::convert_to_java_operation_inner (cognitive 26) java/lance-jni/src/transaction.rs:877— lance_jni::transaction::convert_to_java_operation_inner has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 8 (15 pts), loops 2 (6 pts), if/else 3 (5 pts) (nesting depth added 13). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
lance_jni::file_reader::Java_org_lance_file_LanceFileReader_readAllNative (cognitive 22) java/lance-jni/src/file_reader.rs:215— lance_jni::file_reader::Java_org_lance_file_LanceFileReader_readAllNative has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_jni::transaction::inner_commit_to_uri (cognitive 18) java/lance-jni/src/transaction.rs:2224— lance_jni::transaction::inner_commit_to_uri has cognitive complexity 18 (threshold 15). Drivers by points: if/else 15, match/switch 2, 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.
lance_jni::transaction::inner_commit_to_dataset (cognitive 17) java/lance-jni/src/transaction.rs:1326— lance_jni::transaction::inner_commit_to_dataset has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (14 pts), match/switch 2 (3 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.
lance_jni::utils::get_vector_index_params (cognitive 16) java/lance-jni/src/utils.rs:340— lance_jni::utils::get_vector_index_params has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), 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.
PrimitiveStructuralEncoder::is_constant_values (cognitive 37) rust/lance-encoding/src/encodings/logical/primitive.rs:6196— PrimitiveStructuralEncoder::is_constant_values has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 4 (10 pts), boolean chains 1, match/switch 1 (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PrimitiveStructuralEncoder::encode_dense_page (cognitive 35) rust/lance-encoding/src/encodings/logical/primitive.rs:7170— PrimitiveStructuralEncoder::encode_dense_page has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (23 pts), match/switch 4 (8 pts), boolean chains 4 (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.
PrimitiveStructuralEncoder::serialize_miniblocks (cognitive 32) rust/lance-encoding/src/encodings/logical/primitive.rs:5751— PrimitiveStructuralEncoder::serialize_miniblocks has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 4 (9 pts), match/switch 2, 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.
PrimitiveStructuralEncoder::compress_levels (cognitive 31) rust/lance-encoding/src/encodings/logical/primitive.rs:5916— PrimitiveStructuralEncoder::compress_levels has cognitive complexity 31 (threshold 15). Drivers by points: if/else 15 (29 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.
PrimitiveStructuralEncoder::sample_unique_ratio (cognitive 31) rust/lance-encoding/src/encodings/logical/primitive.rs:6962— PrimitiveStructuralEncoder::sample_unique_ratio has cognitive complexity 31 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 5 (11 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrimitiveStructuralEncoder::serialize_full_zip_variable (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive.rs:6617— PrimitiveStructuralEncoder::serialize_full_zip_variable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (21 pts), loops 2 (4 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.
PrimitiveStructuralEncoder::serialize_full_zip_fixed (cognitive 20) rust/lance-encoding/src/encodings/logical/primitive.rs:6540— PrimitiveStructuralEncoder::serialize_full_zip_fixed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PrimitiveStructuralEncoder::should_dictionary_encode (cognitive 20) rust/lance-encoding/src/encodings/logical/primitive.rs:6837— PrimitiveStructuralEncoder::should_dictionary_encode has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, 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.
Duplicated block (25 lines × 2) java/lance-jni/src/blocking_dataset.rs:2420— java/lance-jni/src/blocking_dataset.rs:2420-2444 | java/lance-jni/src/blocking_dataset.rs:3440-3464 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:90— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:90-114 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:98-122 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 180 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (25 lines × 2) rust/lance-encoding/src/encodings/physical/fsst.rs:61— rust/lance-encoding/src/encodings/physical/fsst.rs:61-85 | rust/lance-encoding/src/encodings/physical/fsst.rs:94-118 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/reader/structural.rs:30— rust/lance-file/src/reader/structural.rs:30-54 | rust/lance-file/src/versions/v2_0/reader.rs:31-55 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25 lines × 2) rust/lance-index/src/scalar/bloomfilter.rs:519— rust/lance-index/src/scalar/bloomfilter.rs:519-543 | rust/lance-index/src/scalar/zonemap.rs:754-778 — before extracting anything, compare `rust/lance-index/src/scalar/bloomfilter.rs` and `rust/lance-index/src/scalar/zonemap.rs` as WHOLE FILES: this scan already matched 5 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 (25 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:3126— rust/lance-index/src/scalar/inverted/wand.rs:3126-3150 | rust/lance-index/src/scalar/inverted/wand.rs:3420-3444 — both copies are in the same file, so extract the block into 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) rust/lance-table/src/rowids.rs:98— rust/lance-table/src/rowids.rs:98-122 | rust/lance-table/src/rowids.rs:139-163 — both copies are in the same file, so extract the block into 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) rust/lance-namespace-impls/src/credentials/gcp.rs:702— rust/lance-namespace-impls/src/credentials/gcp.rs:702-728 | rust/lance-namespace-impls/src/credentials/gcp.rs:788-812 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) rust/compression/fsst/src/fsst.rs:963— rust/compression/fsst/src/fsst.rs:963-980 | rust/compression/fsst/src/fsst.rs:993-1010 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:654— rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:654-671 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:451-468 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs` and `rust/lance/src/dataset/mem_wal/scanner/builder.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) rust/lance/src/index/vector.rs:1595— rust/lance/src/index/vector.rs:1595-1612 | rust/lance/src/index/vector.rs:1635-1652 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) rust/lance-encoding/src/decoder.rs:1637— rust/lance-encoding/src/decoder.rs:1637-1654 | rust/lance-encoding/src/decoder.rs:1884-1901 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/versions/v2_1/reader.rs:75— rust/lance-file/src/versions/v2_1/reader.rs:75-92 | rust/lance-file/src/versions/v2_2/reader.rs:75-92 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.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 10 separate duplicated blocks between them, totalling at least 158 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 × 2) rust/lance-index/src/scalar/inverted/index/doc_set.rs:485— rust/lance-index/src/scalar/inverted/index/doc_set.rs:485-502 | rust/lance-index/src/scalar/inverted/index/doc_set.rs:523-540 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/wand.rs:4185— rust/lance-index/src/scalar/inverted/wand.rs:4185-4202 | rust/lance-index/src/scalar/inverted/wand.rs:4303-4320 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/wand_maxscore.rs:505— rust/lance-index/src/scalar/inverted/wand_maxscore.rs:505-522 | rust/lance-index/src/scalar/inverted/wand_maxscore.rs:607-624 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/file_writer.rs:202— java/lance-jni/src/file_writer.rs:202-210 | java/lance-jni/src/fragment.rs:172-181 — 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) rust/compression/fsst/src/fsst.rs:1030— rust/compression/fsst/src/fsst.rs:1030-1039 | rust/compression/fsst/src/fsst.rs:1042-1050 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset.rs:3773— rust/lance/src/dataset.rs:3773-3782 | rust/lance/src/dataset/fragment.rs:2342-2350 — before extracting anything, compare `rust/lance/src/dataset.rs` and `rust/lance/src/dataset/fragment.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9–10 lines × 2) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1362— rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1362-1370 | rust/lance/src/dataset/mem_wal/scanner/projection.rs:194-203 — 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) rust/lance/src/dataset/refs.rs:431— rust/lance/src/dataset/refs.rs:431-440 | rust/lance/src/dataset/refs.rs:533-541 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/encodings/logical/list.rs:55— rust/lance-encoding/src/encodings/logical/list.rs:55-64 | rust/lance-encoding/src/encodings/logical/list.rs:67-75 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/statistics.rs:253— rust/lance-encoding/src/statistics.rs:253-261 | rust/lance-encoding/src/statistics.rs:266-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) rust/lance-namespace-impls/src/credentials/gcp.rs:602— rust/lance-namespace-impls/src/credentials/gcp.rs:602-611 | rust/lance-namespace-impls/src/credentials/gcp.rs:729-737 — both copies are in the same file, so extract the block into 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 × 3) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:333— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:333-340 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/btree.rs:186-194 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:200-208 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/btree.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 (8 lines × 3) rust/lance/src/dataset/optimize.rs:2546— rust/lance/src/dataset/optimize.rs:2546-2553 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:940-947 | rust/lance/src/dataset/write/update.rs:399-406 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (8 lines × 3) rust/lance/src/io/exec/fts.rs:2679— rust/lance/src/io/exec/fts.rs:2679-2686 | rust/lance/src/io/exec/fts.rs:2743-2750 | rust/lance/src/io/exec/fts.rs:2787-2794 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-file/src/versions/v2_1/mod.rs:108— rust/lance-file/src/versions/v2_1/mod.rs:108-115 | rust/lance-file/src/versions/v2_2/mod.rs:104-111 | rust/lance-file/src/versions/v2_3/mod.rs:112-119 — `rust/lance-file/src/versions/v2_2/mod.rs` and `rust/lance-file/src/versions/v2_3/mod.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 57 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) rust/lance-index/src/scalar/inverted/index/partition.rs:1080— rust/lance-index/src/scalar/inverted/index/partition.rs:1080-1087 | rust/lance-index/src/scalar/inverted/index/partition.rs:1146-1153 | rust/lance-index/src/scalar/inverted/index/partition.rs:1208-1215 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-linalg/src/distance/l2.rs:728— rust/lance-linalg/src/distance/l2.rs:728-735 | rust/lance-linalg/src/distance/l2.rs:755-762 | rust/lance-linalg/src/distance/l2.rs:782-789 — all 3 copies are in the same file, so extract the block into one function there and call 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) python/src/dataset/optimize.rs:201— python/src/dataset/optimize.rs:201-208 | python/src/fragment.rs:693-700 | python/src/fragment.rs:745-752 — 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 (8 lines × 3) rust/lance/src/dataset.rs:1027— rust/lance/src/dataset.rs:1027-1034 | rust/lance/src/dataset.rs:1087-1094 | rust/lance/src/dataset/builder.rs:150-157 — 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.
Wand::and_bulk_search (cyclomatic 139) rust/lance-index/src/scalar/inverted/wand.rs:4083— Wand::and_bulk_search has cyclomatic complexity 139 (threshold 15). Of this number, 74 points are the body's own statements and 65 belong to 14 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Wand::maxscore_search (cyclomatic 128) rust/lance-index/src/scalar/inverted/wand.rs:2936— Wand::maxscore_search has cyclomatic complexity 128 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Wand::complete_maxscore_single_essential (cyclomatic 45) rust/lance-index/src/scalar/inverted/wand_maxscore.rs:424— Wand::complete_maxscore_single_essential has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Wand::search (cyclomatic 30) rust/lance-index/src/scalar/inverted/wand.rs:2667— Wand::search 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.
Wand::next_and_candidate (cyclomatic 28) rust/lance-index/src/scalar/inverted/wand.rs:3922— Wand::next_and_candidate 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.
Wand::prepare_score_first_and_window (cyclomatic 22) rust/lance-index/src/scalar/inverted/wand.rs:3716— Wand::prepare_score_first_and_window 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.
Wand::next (cyclomatic 20) rust/lance-index/src/scalar/inverted/wand.rs:3833— Wand::next 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.
lance_datafusion::expr::safe_coerce_scalar (cognitive 71) rust/lance-datafusion/src/expr.rs:108— lance_datafusion::expr::safe_coerce_scalar has cognitive complexity 71 (threshold 15). Drivers by points: match/switch 36 (55 pts), if/else 8 (16 pts) (nesting depth added 27). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
lance_datafusion::substrait::normalize_expr (cognitive 49) rust/lance-datafusion/src/substrait.rs:313— lance_datafusion::substrait::normalize_expr has cognitive complexity 49 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 8 (17 pts), match/switch 5 (12 pts) (nesting depth added 28). 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.
lance_datafusion::signed_zero::rewrite_node (cognitive 33) rust/lance-datafusion/src/signed_zero.rs:207— lance_datafusion::signed_zero::rewrite_node has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 4 (7 pts), boolean chains 2, loops 1 (2 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.
lance_datafusion::logical_expr::resolve_expr (cognitive 22) rust/lance-datafusion/src/logical_expr.rs:80— lance_datafusion::logical_expr::resolve_expr has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 3 (7 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
lance_datafusion::substrait::parse_groupings (cognitive 16) rust/lance-datafusion/src/substrait.rs:637— lance_datafusion::substrait::parse_groupings has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (10 pts), if/else 3 (6 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
lance_datafusion::exec::collect_execution_metrics (cognitive 16) rust/lance-datafusion/src/exec.rs:594— lance_datafusion::exec::collect_execution_metrics has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (7 pts), match/switch 2 (6 pts), if/else 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.
lance_datafusion::udf::json::check_array_contains (cognitive 16) rust/lance-datafusion/src/udf/json.rs:818— lance_datafusion::udf::json::check_array_contains has cognitive complexity 16 (threshold 15). Drivers by points: if/else 1 (5 pts), loops 2 (5 pts), match/switch 2 (5 pts), boolean chains 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.
DirectoryNamespace::describe_table_impl (cognitive 64) rust/lance-namespace-impls/src/dir.rs:2062— DirectoryNamespace::describe_table_impl has cognitive complexity 64 (threshold 15). Drivers by points: if/else 36 (55 pts), boolean chains 6, match/switch 2 (3 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DirectoryNamespace::alter_transaction (cognitive 49) rust/lance-namespace-impls/src/dir.rs:4523— DirectoryNamespace::alter_transaction has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (33 pts), match/switch 3 (9 pts), boolean chains 6, 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.
DirectoryNamespace::query_table (cognitive 46) rust/lance-namespace-impls/src/dir.rs:5366— DirectoryNamespace::query_table has cognitive complexity 46 (threshold 15). Drivers by points: if/else 23 (34 pts), boolean chains 8, match/switch 1 (4 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DirectoryNamespace::apply_query_params_to_scanner (cognitive 24) rust/lance-namespace-impls/src/dir.rs:3162— DirectoryNamespace::apply_query_params_to_scanner has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (23 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
DirectoryNamespace::list_tables (cognitive 23) rust/lance-namespace-impls/src/dir.rs:3420— DirectoryNamespace::list_tables has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 4, 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.
DirectoryNamespace::list_versions_under (cognitive 21) rust/lance-namespace-impls/src/dir.rs:1961— DirectoryNamespace::list_versions_under has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 2 (4 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DirectoryNamespace::build_index_params (cognitive 18) rust/lance-namespace-impls/src/dir.rs:2410— DirectoryNamespace::build_index_params has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (17 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.
lance_encoding::encodings::logical::primitive::dict::dictionary_encode (cognitive 51) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:278— lance_encoding::encodings::logical::primitive::dict::dictionary_encode has cognitive complexity 51 (threshold 15). Drivers by points: if/else 6 (28 pts), match/switch 6 (15 pts), loops 2 (6 pts), boolean chains 2 (nesting depth added 35). 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.
lance_encoding::encodings::logical::primitive::sparse::writer::plan (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive/sparse/writer.rs:168— lance_encoding::encodings::logical::primitive::sparse::writer::plan has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (4 pts), match/switch 2 (3 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_encoding::repdef::build_control_word_iterator (cognitive 22) rust/lance-encoding/src/repdef.rs:2412— lance_encoding::repdef::build_control_word_iterator has cognitive complexity 22 (threshold 15). Drivers by points: if/else 18 (21 pts), match/switch 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
lance_encoding::encodings::logical::primitive::sparse::select_position_set (cognitive 21) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:4131— lance_encoding::encodings::logical::primitive::sparse::select_position_set has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 4 (10 pts), match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
lance_encoding::encodings::logical::primitive::for_each_page_range (cognitive 20) rust/lance-encoding/src/encodings/logical/primitive.rs:4796— lance_encoding::encodings::logical::primitive::for_each_page_range has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_encoding::encodings::logical::primitive::sparse::writer::serialize_value_chunks (cognitive 20) rust/lance-encoding/src/encodings/logical/primitive/sparse/writer.rs:442— lance_encoding::encodings::logical::primitive::sparse::writer::serialize_value_chunks has cognitive complexity 20 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 5 (9 pts), boolean chains 1 (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
lance_encoding::encoder::encode_batch (cognitive 17) rust/lance-encoding/src/encoder.rs:402— lance_encoding::encoder::encode_batch has cognitive complexity 17 (threshold 15). Drivers by points: loops 7 (15 pts), boolean chains 1, if/else 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.
lance_file::concat::validate_blob_field (cognitive 39) rust/lance-file/src/concat.rs:379— lance_file::concat::validate_blob_field has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 4 (8 pts), boolean chains 5, match/switch 2 (4 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_file::versions::v1::writer::statistics::get_binary_statistics (cognitive 30) rust/lance-file/src/versions/v1/writer/statistics.rs:316— lance_file::versions::v1::writer::statistics::get_binary_statistics has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 1, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_file::versions::v1::writer::statistics::get_fixed_size_binary_statistics (cognitive 29) rust/lance-file/src/versions/v1/writer/statistics.rs:389— lance_file::versions::v1::writer::statistics::get_fixed_size_binary_statistics has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_file::versions::v1::writer::statistics::get_string_statistics (cognitive 28) rust/lance-file/src/versions/v1/writer/statistics.rs:241— lance_file::versions::v1::writer::statistics::get_string_statistics has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 1, match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_file::concat::copy_page_buffers (cognitive 27) rust/lance-file/src/concat.rs:795— lance_file::concat::copy_page_buffers has cognitive complexity 27 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 4 (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.
lance_file::concat::check_compatibility (cognitive 22) rust/lance-file/src/concat.rs:684— lance_file::concat::check_compatibility has cognitive complexity 22 (threshold 15). Drivers by points: if/else 13 (17 pts), loops 2 (3 pts), boolean chains 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.
lance_file::reader::describe_encoding (cognitive 20) rust/lance-file/src/reader.rs:2287— lance_file::reader::describe_encoding has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 3 (9 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.
Duplicated block (21 lines × 2) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:432— rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:432-452 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:493-513 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:465— rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:465-485 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:526-546 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:516— rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:516-536 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:610-630 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:549— rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs:549-569 | rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs:577-597 — before extracting anything, compare `rust/compression/bitpacking/src/bitpacker_internal/bitpacker4x.rs` and `rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 132 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:88— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:88-108 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:122-142 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:263— rust/lance-index/src/scalar/inverted/index/inverted_index.rs:263-283 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:332-352 — both copies are in the same file, so extract the block into 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) rust/lance-io/src/object_store/providers/oss.rs:68— rust/lance-io/src/object_store/providers/oss.rs:68-88 | rust/lance-io/src/object_store/providers/tos.rs:74-94 — before extracting anything, compare `rust/lance-io/src/object_store/providers/oss.rs` and `rust/lance-io/src/object_store/providers/tos.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance/src/index/vector/ivf.rs:2866— rust/lance/src/index/vector/ivf.rs:2866-2885 | rust/lance/src/index/vector/ivf.rs:2922-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 (20 lines × 2) rust/lance-encoding/src/decoder.rs:1649— rust/lance-encoding/src/decoder.rs:1649-1668 | rust/lance-encoding/src/decoder.rs:2114-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 (20 lines × 2) rust/lance-encoding/src/encodings/logical/primitive.rs:6645— rust/lance-encoding/src/encodings/logical/primitive.rs:6645-6664 | rust/lance-encoding/src/encodings/logical/primitive.rs:6667-6686 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/versions/v2_0/writer.rs:258— rust/lance-file/src/versions/v2_0/writer.rs:258-277 | rust/lance-file/src/writer/structural.rs:226-245 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) rust/lance-index/src/scalar/inverted/wand.rs:1374— rust/lance-index/src/scalar/inverted/wand.rs:1374-1393 | rust/lance-index/src/scalar/inverted/wand.rs:1432-1451 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/vector/flat/storage.rs:87— rust/lance-index/src/vector/flat/storage.rs:87-106 | rust/lance-index/src/vector/flat/storage.rs:267-286 — both copies are in the same file, so extract the block into 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) rust/lance-io/src/object_store/providers/azure.rs:255— rust/lance-io/src/object_store/providers/azure.rs:255-274 | rust/lance-io/src/object_store/providers/gcp.rs:299-318 — before extracting anything, compare `rust/lance-io/src/object_store/providers/azure.rs` and `rust/lance-io/src/object_store/providers/gcp.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 57 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance/src/dataset/mem_wal/memtable/flush.rs:260— rust/lance/src/dataset/mem_wal/memtable/flush.rs:260-278 | rust/lance/src/dataset/mem_wal/memtable/flush.rs:492-510 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector.rs:1299— rust/lance/src/index/vector.rs:1299-1317 | rust/lance/src/index/vector.rs:1354-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 (19 lines × 2) rust/lance/src/index/vector.rs:1944— rust/lance/src/index/vector.rs:1944-1962 | rust/lance/src/index/vector.rs:1983-2001 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/reader/structural.rs:124— rust/lance-file/src/reader/structural.rs:124-142 | rust/lance-file/src/versions/v2_0/reader.rs:104-122 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 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 × 2) rust/lance-file/src/versions/v2_2/compression.rs:110— rust/lance-file/src/versions/v2_2/compression.rs:110-128 | rust/lance-file/src/versions/v2_3/compression.rs:109-127 — `rust/lance-file/src/versions/v2_2/compression.rs` and `rust/lance-file/src/versions/v2_3/compression.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 4 separate duplicated blocks between them, totalling at least 61 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 (19 lines × 2) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:285— rust/lance-index/src/scalar/inverted/index/inverted_index.rs:285-303 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:354-372 — both copies are in the same file, so extract the block into 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) rust/lance-namespace-impls/src/dir.rs:4491— rust/lance-namespace-impls/src/dir.rs:4491-4509 | rust/lance-namespace-impls/src/dir.rs:4531-4549 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:96— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:96-106 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:147-157 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:104-114 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 180 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance/src/index/scalar/bloomfilter.rs:26— rust/lance/src/index/scalar/bloomfilter.rs:26-36 | rust/lance/src/index/scalar/minhash_lsh.rs:31-41 | rust/lance/src/index/scalar/rtree.rs:34-44 — before extracting anything, compare `rust/lance/src/index/scalar/bloomfilter.rs` and `rust/lance/src/index/scalar/minhash_lsh.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance-file/src/versions/v2_1/reader.rs:46— rust/lance-file/src/versions/v2_1/reader.rs:46-56 | rust/lance-file/src/versions/v2_2/reader.rs:46-56 | rust/lance-file/src/versions/v2_3/reader.rs:46-56 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.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 10 separate duplicated blocks between them, totalling at least 158 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) rust/lance-namespace-impls/src/dir/manifest.rs:2482— rust/lance-namespace-impls/src/dir/manifest.rs:2482-2492 | rust/lance-namespace-impls/src/dir/manifest.rs:2518-2528 | rust/lance-namespace-impls/src/dir/manifest.rs:2629-2641 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-index/src/scalar/inverted/compound.rs:1027— rust/lance-index/src/scalar/inverted/compound.rs:1027-1037 | rust/lance-index/src/scalar/inverted/compound.rs:3334-3344 | rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:508-518 — before extracting anything, compare `rust/lance-index/src/scalar/inverted/compound.rs` and `rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 30 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) rust/lance/src/io/exec/fts.rs:1396— rust/lance/src/io/exec/fts.rs:1396-1406 | rust/lance/src/io/exec/fts.rs:1949-1960 | rust/lance/src/io/exec/minhash.rs:178-188 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 3) rust/lance/src/index/scalar/bitmap.rs:46— rust/lance/src/index/scalar/bitmap.rs:46-56 | rust/lance/src/index/scalar/inverted.rs:988-998 | rust/lance/src/index/scalar/label_list.rs:117-127 — before extracting anything, compare `rust/lance/src/index/scalar/bitmap.rs` and `rust/lance/src/index/scalar/inverted.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–11 lines × 2) java/lance-jni/src/blocking_dataset.rs:783— java/lance-jni/src/blocking_dataset.rs:783-792 | rust/lance/src/dataset.rs:1040-1050 — 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) rust/lance/src/io/exec/fts.rs:5434— rust/lance/src/io/exec/fts.rs:5434-5444 | rust/lance/src/io/exec/fts.rs:5777-5786 — both copies are in the same file, so extract the block into 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) rust/lance-core/src/datatypes/schema.rs:231— rust/lance-core/src/datatypes/schema.rs:231-240 | rust/lance-core/src/datatypes/schema.rs:548-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 (10–11 lines × 2) rust/lance-file/src/reader.rs:2026— rust/lance-file/src/reader.rs:2026-2035 | rust/lance-file/src/reader.rs:2233-2243 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/vector/ivf/shuffler.rs:576— rust/lance-index/src/vector/ivf/shuffler.rs:576-585 | rust/lance-index/src/vector/ivf/shuffler.rs:610-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 (10–11 lines × 2) rust/lance-linalg/src/simd/dist_table.rs:663— rust/lance-linalg/src/simd/dist_table.rs:663-673 | rust/lance-linalg/src/simd/dist_table.rs:683-692 — both copies are in the same file, so extract the block into 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) java/src/main/java/org/lance/OpenDatasetBuilder.java:176— java/src/main/java/org/lance/OpenDatasetBuilder.java:176-186 | java/src/main/java/org/lance/WriteDatasetBuilder.java:395-404 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `java/src/main/java/org/lance/OpenDatasetBuilder.java:176` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
TransactionRebase::check_create_index_txn (cyclomatic 48) rust/lance/src/io/commit/conflict_resolver.rs:828— TransactionRebase::check_create_index_txn has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TransactionRebase::check_update_txn (cyclomatic 41) rust/lance/src/io/commit/conflict_resolver.rs:573— TransactionRebase::check_update_txn 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.
TransactionRebase::check_rewrite_txn (cyclomatic 41) rust/lance/src/io/commit/conflict_resolver.rs:1234— TransactionRebase::check_rewrite_txn 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.
TransactionRebase::check_data_replacement_txn (cyclomatic 35) rust/lance/src/io/commit/conflict_resolver.rs:1604— TransactionRebase::check_data_replacement_txn 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.
TransactionRebase::check_txn (cyclomatic 24) rust/lance/src/io/commit/conflict_resolver.rs:414— TransactionRebase::check_txn has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
TransactionRebase::check_delete_txn (cyclomatic 16) rust/lance/src/io/commit/conflict_resolver.rs:469— TransactionRebase::check_delete_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.
Duplicated block (24 lines × 2) java/lance-jni/src/transaction.rs:1343— java/lance-jni/src/transaction.rs:1343-1366 | java/lance-jni/src/transaction.rs:2245-2268 — both copies are in the same file, so extract the block into 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) java/lance-jni/src/lib.rs:107— java/lance-jni/src/lib.rs:107-130 | python/src/lib.rs:199-222 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (24 lines × 2) rust/lance/src/dataset/mem_wal/scanner/planner.rs:363— rust/lance/src/dataset/mem_wal/scanner/planner.rs:363-386 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:509-532 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/planner.rs` and `rust/lance/src/dataset/mem_wal/scanner/vector_search.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 89 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (24 lines × 2) rust/lance-linalg/src/simd/f32.rs:404— rust/lance-linalg/src/simd/f32.rs:404-427 | rust/lance-linalg/src/simd/i32.rs:244-267 — 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) rust/lance-namespace-impls/src/dir.rs:2165— rust/lance-namespace-impls/src/dir.rs:2165-2188 | rust/lance-namespace-impls/src/dir.rs:2191-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 (24 lines × 2) java/src/main/java/org/lance/ipc/AsyncScanner.java:70— java/src/main/java/org/lance/ipc/AsyncScanner.java:70-93 | java/src/main/java/org/lance/ipc/LanceScanner.java:66-89 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `java/src/main/java/org/lance/ipc/LanceScanner.java:90` calls `isCollectStats` and `java/src/main/java/org/lance/ipc/AsyncScanner.java:94` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18–19 lines × 2) rust/lance/src/dataset/scanner.rs:5449— rust/lance/src/dataset/scanner.rs:5449-5466 | rust/lance/src/dataset/scanner.rs:5608-5626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) rust/lance/src/dataset/write/merge_insert/exec/write.rs:937— rust/lance/src/dataset/write/merge_insert/exec/write.rs:937-955 | rust/lance/src/dataset/write/update.rs:397-414 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (18–19 lines × 2) rust/lance/src/io/exec/fts.rs:2940— rust/lance/src/io/exec/fts.rs:2940-2958 | rust/lance/src/io/exec/fts.rs:5118-5135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:328— rust/lance-file/src/versions/v2_0/writer.rs:328-346 | rust/lance-file/src/writer/structural.rs:415-432 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 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–19 lines × 2) rust/lance-index/src/scalar/inverted/index/posting_builder.rs:743— rust/lance-index/src/scalar/inverted/index/posting_builder.rs:743-761 | rust/lance-index/src/scalar/inverted/index/posting_builder.rs:806-823 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18–19 lines × 2) rust/lance-index/src/vector/bq/storage.rs:2062— rust/lance-index/src/vector/bq/storage.rs:2062-2079 | rust/lance-index/src/vector/storage.rs:229-247 — before extracting anything, compare `rust/lance-index/src/vector/bq/storage.rs` and `rust/lance-index/src/vector/storage.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) rust/lance/src/dataset/write/delete.rs:58— rust/lance/src/dataset/write/delete.rs:58-71 | rust/lance/src/dataset/write/merge_insert.rs:3040-3053 | rust/lance/src/dataset/write/merge_insert/exec.rs:72-85 — before extracting anything, compare `rust/lance/src/dataset/write/delete.rs` and `rust/lance/src/dataset/write/merge_insert.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) rust/lance/src/dataset/write/delete.rs:77— rust/lance/src/dataset/write/delete.rs:77-90 | rust/lance/src/dataset/write/merge_insert.rs:3059-3072 | rust/lance/src/dataset/write/merge_insert/exec.rs:91-104 — before extracting anything, compare `rust/lance/src/dataset/write/delete.rs` and `rust/lance/src/dataset/write/merge_insert.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 3) rust/lance-file/src/versions/v1/writer/statistics.rs:266— rust/lance-file/src/versions/v1/writer/statistics.rs:266-279 | rust/lance-file/src/versions/v1/writer/statistics.rs:343-356 | rust/lance-file/src/versions/v1/writer/statistics.rs:417-430 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (14 lines × 3) rust/lance-file/src/versions/v2_1/reader.rs:219— rust/lance-file/src/versions/v2_1/reader.rs:219-232 | rust/lance-file/src/versions/v2_2/reader.rs:221-234 | rust/lance-file/src/versions/v2_3/reader.rs:259-272 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.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 10 separate duplicated blocks between them, totalling at least 158 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 (14 lines × 3) rust/lance-namespace-impls/src/dir/manifest.rs:2956— rust/lance-namespace-impls/src/dir/manifest.rs:2956-2969 | rust/lance-namespace-impls/src/dir/manifest.rs:3164-3177 | rust/lance-namespace-impls/src/dir/manifest.rs:3637-3650 — all 3 copies are in the same file, so extract the block into one function there and call 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) java/lance-jni/src/schema.rs:256— java/lance-jni/src/schema.rs:256-269 | java/lance-jni/src/schema.rs:284-297 | java/lance-jni/src/schema.rs:314-327 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–12 lines × 2) python/src/dataset.rs:1480— python/src/dataset.rs:1480-1491 | python/src/fragment.rs:308-318 — before extracting anything, compare `python/src/dataset.rs` and `python/src/fragment.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 (11–12 lines × 2) rust/lance/src/dataset.rs:1081— rust/lance/src/dataset.rs:1081-1091 | rust/lance/src/dataset/builder.rs:143-154 — 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) rust/lance/src/dataset/hash_joiner.rs:153— rust/lance/src/dataset/hash_joiner.rs:153-164 | rust/lance/src/dataset/hash_joiner.rs:240-250 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/scalar/btree.rs:107— rust/lance/src/index/scalar/btree.rs:107-117 | rust/lance/src/index/scalar/ngram.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 (11–12 lines × 2) rust/lance-index/src/scalar/json.rs:137— rust/lance-index/src/scalar/json.rs:137-147 | rust/lance-index/src/scalar/json.rs:174-185 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) rust/lance-namespace-impls/src/dir.rs:1033— rust/lance-namespace-impls/src/dir.rs:1033-1043 | rust/lance-namespace-impls/src/dir.rs:1071-1082 — both copies are in the same file, so extract the block into 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 × 3) rust/lance/src/index/vector/ivf.rs:1097— rust/lance/src/index/vector/ivf.rs:1097-1105 | rust/lance/src/index/vector/ivf.rs:2227-2235 | rust/lance/src/index/vector/ivf.rs:2295-2303 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-datagen/src/generator.rs:145— rust/lance-datagen/src/generator.rs:145-153 | rust/lance-datagen/src/generator.rs:168-176 | rust/lance-datagen/src/generator.rs:191-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 (9 lines × 3) rust/lance-io/src/object_store/providers/oss.rs:143— rust/lance-io/src/object_store/providers/oss.rs:143-151 | rust/lance-io/src/object_store/providers/tencent.rs:99-107 | rust/lance-io/src/object_store/providers/tos.rs:149-157 — before extracting anything, compare `rust/lance-io/src/object_store/providers/oss.rs` and `rust/lance-io/src/object_store/providers/tos.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 62 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance-linalg/src/distance/dot.rs:640— rust/lance-linalg/src/distance/dot.rs:640-648 | rust/lance-linalg/src/distance/l2.rs:691-699 | rust/lance-linalg/src/distance/norm_l2.rs:292-300 — before extracting anything, compare `rust/lance-linalg/src/distance/dot.rs` and `rust/lance-linalg/src/distance/l2.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance-io/src/object_store/providers/aws.rs:632— rust/lance-io/src/object_store/providers/aws.rs:632-640 | rust/lance-io/src/object_store/providers/azure.rs:348-356 | rust/lance-io/src/object_store/providers/gcp.rs:381-389 — before extracting anything, compare `rust/lance-io/src/object_store/providers/aws.rs` and `rust/lance-io/src/object_store/providers/gcp.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) java/lance-jni/src/index_progress.rs:53— java/lance-jni/src/index_progress.rs:53-61 | java/lance-jni/src/index_progress.rs:104-112 | java/lance-jni/src/index_progress.rs:128-136 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
pylance::dataset::prepare_vector_index_params (cyclomatic 38) python/src/dataset.rs:5111— pylance::dataset::prepare_vector_index_params has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pylance::dataset::get_write_params (cyclomatic 32) python/src/dataset.rs:4901— pylance::dataset::get_write_params 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.
pylance::dataset::vector_query_params_from_dict (cyclomatic 21) python/src/dataset.rs:5680— pylance::dataset::vector_query_params_from_dict 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.
pylance::dataset::optimize::parse_compaction_options (cyclomatic 20) python/src/dataset/optimize.rs:26— pylance::dataset::optimize::parse_compaction_options 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.
pylance::dataset::writer_config_from_kwargs (cyclomatic 17) python/src/dataset.rs:213— pylance::dataset::writer_config_from_kwargs 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.
DirectoryNamespace::describe_table_impl (cyclomatic 36) rust/lance-namespace-impls/src/dir.rs:2062— DirectoryNamespace::describe_table_impl 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.
DirectoryNamespace::query_table (cyclomatic 35) rust/lance-namespace-impls/src/dir.rs:5366— DirectoryNamespace::query_table 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.
DirectoryNamespace::build_index_params (cyclomatic 26) rust/lance-namespace-impls/src/dir.rs:2410— DirectoryNamespace::build_index_params 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.
DirectoryNamespace::alter_transaction (cyclomatic 25) rust/lance-namespace-impls/src/dir.rs:4523— DirectoryNamespace::alter_transaction 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.
DirectoryNamespace::apply_query_params_to_scanner (cyclomatic 18) rust/lance-namespace-impls/src/dir.rs:3162— DirectoryNamespace::apply_query_params_to_scanner 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.
PrimitiveStructuralEncoder::encode_dense_page (cyclomatic 30) rust/lance-encoding/src/encodings/logical/primitive.rs:7170— PrimitiveStructuralEncoder::encode_dense_page 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.
PrimitiveStructuralEncoder::serialize_miniblocks (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive.rs:5751— PrimitiveStructuralEncoder::serialize_miniblocks 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.
PrimitiveStructuralEncoder::is_constant_values (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive.rs:6196— PrimitiveStructuralEncoder::is_constant_values 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.
PrimitiveStructuralEncoder::sample_unique_ratio (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive.rs:6962— PrimitiveStructuralEncoder::sample_unique_ratio has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
PrimitiveStructuralEncoder::should_dictionary_encode (cyclomatic 18) rust/lance-encoding/src/encodings/logical/primitive.rs:6837— PrimitiveStructuralEncoder::should_dictionary_encode 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.
lance_jni::transaction::convert_to_rust_operation (cyclomatic 29) java/lance-jni/src/transaction.rs:1682— lance_jni::transaction::convert_to_rust_operation 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.
lance_jni::blocking_scanner::build_scanner_with_options (cyclomatic 28) java/lance-jni/src/blocking_scanner.rs:289— lance_jni::blocking_scanner::build_scanner_with_options 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.
lance_jni::transaction::convert_to_java_operation_inner (cyclomatic 27) java/lance-jni/src/transaction.rs:877— lance_jni::transaction::convert_to_java_operation_inner 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.
lance_jni::index::determine_index_type (cyclomatic 18) java/lance-jni/src/index.rs:188— lance_jni::index::determine_index_type 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.
lance_jni::transaction::inner_commit_to_uri (cyclomatic 16) java/lance-jni/src/transaction.rs:2224— lance_jni::transaction::inner_commit_to_uri 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.
FixmeComment python/python/tests/test_dataset.py:1425— # FIXME: sqlparser seems to ignore the .y part, but I can't create a simple — 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.
FixmeComment rust/lance-core/src/utils/bloomfilter/sbbf.rs:27— //! FIXME: Make the upstream SBBF implementation public so that this file could be — 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.
FixmeComment rust/lance-datafusion/src/planner.rs:1444— // FIXME: This should work, but sqlparser doesn't recognize anything — 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.
FixmeComment rust/lance-file/src/versions/v1/writer/mod.rs:1139— // FIXME: these max values shouldn't be incremented — 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.
FixmeComment rust/lance/src/dataset/fragment.rs:2188— // FIXME, change this method to streams — 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.
pylance::dataset::get_write_params (cognitive 61) python/src/dataset.rs:4901— pylance::dataset::get_write_params has cognitive complexity 61 (threshold 15). Drivers by points: if/else 29 (49 pts), loops 3 (9 pts), boolean chains 3 (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pylance::dataset::prepare_vector_index_params (cognitive 53) python/src/dataset.rs:5111— pylance::dataset::prepare_vector_index_params has cognitive complexity 53 (threshold 15). Drivers by points: if/else 26 (46 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pylance::dataset::vector_query_params_from_dict (cognitive 33) python/src/dataset.rs:5680— pylance::dataset::vector_query_params_from_dict has cognitive complexity 33 (threshold 15). Drivers by points: if/else 24 (28 pts), boolean chains 5 (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.
pylance::dataset::writer_config_from_kwargs (cognitive 20) python/src/dataset.rs:213— pylance::dataset::writer_config_from_kwargs has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11, loops 2 (5 pts), match/switch 1 (4 pts) (nesting depth added 6). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
pylance::session::backend_config_from_dict (cognitive 16) python/src/session.rs:106— pylance::session::backend_config_from_dict 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.
IvfIndexBuilder::merge_partitions (cognitive 49) rust/lance/src/index/vector/builder.rs:1597— IvfIndexBuilder::merge_partitions has cognitive complexity 49 (threshold 15). Drivers by points: if/else 18 (38 pts), loops 3 (7 pts), boolean chains 2, match/switch 2 (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.
IvfIndexBuilder::build_partitions (cognitive 36) rust/lance/src/index/vector/builder.rs:999— IvfIndexBuilder::build_partitions has cognitive complexity 36 (threshold 15). Drivers by points: if/else 20 (27 pts), boolean chains 3, loops 1 (3 pts), match/switch 3 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IvfIndexBuilder::take_partition_batches (cognitive 32) rust/lance/src/index/vector/builder.rs:1489— IvfIndexBuilder::take_partition_batches has cognitive complexity 32 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 5 (12 pts), match/switch 1 (2 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.
IvfIndexBuilder::join_partitions_impl (cognitive 32) rust/lance/src/index/vector/builder.rs:2528— IvfIndexBuilder::join_partitions_impl has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 5 (14 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.
IvfIndexBuilder::build_fresh_partitions_windowed (cognitive 19) rust/lance/src/index/vector/builder.rs:1263— IvfIndexBuilder::build_fresh_partitions_windowed has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostingIterator::merge_optional_freqs (cognitive 45) rust/lance-index/src/scalar/inverted/wand_maxscore.rs:112— PostingIterator::merge_optional_freqs has cognitive complexity 45 (threshold 15). Drivers by points: if/else 15 (28 pts), loops 4 (8 pts), match/switch 5 (6 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.
PostingIterator::position_cursor (cognitive 28) rust/lance-index/src/scalar/inverted/wand.rs:1199— PostingIterator::position_cursor has cognitive complexity 28 (threshold 15). Drivers by points: if/else 3 (12 pts), loops 2 (10 pts), match/switch 3 (6 pts) (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.
PostingIterator::collect_window_scores (cognitive 26) rust/lance-index/src/scalar/inverted/wand.rs:1650— PostingIterator::collect_window_scores has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (7 pts), match/switch 2 (5 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostingIterator::take_docs_one_block_upto (cognitive 20) rust/lance-index/src/scalar/inverted/wand_maxscore.rs:218— PostingIterator::take_docs_one_block_upto has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 2 (4 pts), match/switch 1 (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.
PostingIterator::next_doc_id (cognitive 18) rust/lance-index/src/scalar/inverted/wand.rs:1397— PostingIterator::next_doc_id has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 1 (2 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.
Duplicated block (14–15 lines × 2) rust/lance/src/dataset/mem_wal/write.rs:2795— rust/lance/src/dataset/mem_wal/write.rs:2795-2809 | rust/lance/src/dataset/mem_wal/write.rs:2921-2934 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:2922— rust/lance/src/io/exec/fts.rs:2922-2936 | rust/lance/src/io/exec/fts.rs:5102-5115 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/ivf/io.rs:480— rust/lance/src/index/vector/ivf/io.rs:480-493 | rust/lance/src/index/vector/ivf/io.rs:504-518 — both copies are in the same file, so extract the block into 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) rust/lance-namespace-impls/src/credentials/azure.rs:800— rust/lance-namespace-impls/src/credentials/azure.rs:800-814 | rust/lance-namespace-impls/src/credentials/azure.rs:866-879 — both copies are in the same file, so extract the block into 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) java/src/main/java/org/lance/WriteDatasetBuilder.java:491— java/src/main/java/org/lance/WriteDatasetBuilder.java:491-505 | java/src/main/java/org/lance/WriteDatasetBuilder.java:530-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. Read the line range as the matched WINDOW rather than a finished unit: at `java/src/main/java/org/lance/WriteDatasetBuilder.java:491` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) rust/lance/src/dataset/scanner.rs:5684— rust/lance/src/dataset/scanner.rs:5684-5693 | rust/lance/src/dataset/scanner.rs:7332-7342 | rust/lance/src/dataset/scanner.rs:7393-7403 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-encoding/src/decoder.rs:886— rust/lance-encoding/src/decoder.rs:886-898 | rust/lance-encoding/src/decoder.rs:903-915 | rust/lance-encoding/src/decoder.rs:927-936 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-file/src/reader.rs:1316— rust/lance-file/src/reader.rs:1316-1325 | rust/lance-file/src/reader.rs:1356-1365 | rust/lance-file/src/reader.rs:1396-1405 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-index/src/vector/pq/storage.rs:427— rust/lance-index/src/vector/pq/storage.rs:427-436 | rust/lance-index/src/vector/quantizer.rs:373-382 | rust/lance-index/src/vector/sq/storage.rs:232-241 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (10 lines × 3) rust/lance/src/io/exec/filtered_read.rs:3242— rust/lance/src/io/exec/filtered_read.rs:3242-3251 | rust/lance/src/io/exec/pushdown_scan.rs:244-253 | rust/lance/src/io/exec/scan.rs:645-654 — 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 × 4) java/lance-jni/src/mem_wal.rs:772— java/lance-jni/src/mem_wal.rs:772-780 | java/lance-jni/src/mem_wal.rs:895-901 | python/src/mem_wal.rs:726-733 | python/src/mem_wal.rs:799-805 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (7 lines × 4) rust/lance-linalg/src/simd/f32.rs:445— rust/lance-linalg/src/simd/f32.rs:445-451 | rust/lance-linalg/src/simd/f32.rs:954-960 | rust/lance-linalg/src/simd/f64.rs:295-301 | rust/lance-linalg/src/simd/f64.rs:747-753 — before extracting anything, compare `rust/lance-linalg/src/simd/f32.rs` and `rust/lance-linalg/src/simd/f64.rs` as WHOLE FILES: this scan already matched 7 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 lines × 4) rust/lance-linalg/src/simd/f32.rs:753— rust/lance-linalg/src/simd/f32.rs:753-759 | rust/lance-linalg/src/simd/f32.rs:775-781 | rust/lance-linalg/src/simd/f64.rs:599-605 | rust/lance-linalg/src/simd/f64.rs:622-628 — before extracting anything, compare `rust/lance-linalg/src/simd/f32.rs` and `rust/lance-linalg/src/simd/f64.rs` as WHOLE FILES: this scan already matched 7 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 lines × 4) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/btree.rs:361— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/btree.rs:361-368 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:289-295 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:709-715 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:342-350 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 4) rust/lance-datafusion/src/expr.rs:139— rust/lance-datafusion/src/expr.rs:139-145 | rust/lance-datafusion/src/expr.rs:165-171 | rust/lance-datafusion/src/expr.rs:256-262 | rust/lance-datafusion/src/expr.rs:278-284 — 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.
Low cohesion: Dataset (LCOM4 16) rust/lance/src/dataset.rs:219— Dataset'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: FilteredReadOptions (LCOM4 11) rust/lance/src/io/exec/filtered_read.rs:1729— FilteredReadOptions's methods fall into 11 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 11 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RowAddrTreeMap (LCOM4 8) rust/lance-select/src/mask.rs:350— RowAddrTreeMap's methods fall into 8 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 8 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: MatchQuery (LCOM4 7) rust/lance-index/src/scalar/inverted/query.rs:340— MatchQuery's methods fall into 7 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 7 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RowIdSequence (LCOM4 4) rust/lance-table/src/rowids.rs:52— RowIdSequence'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.
lance_datafusion::expr::safe_coerce_scalar (cyclomatic 211) rust/lance-datafusion/src/expr.rs:108— lance_datafusion::expr::safe_coerce_scalar has cyclomatic complexity 211 (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.
lance_datafusion::substrait::normalize_expr (cyclomatic 31) rust/lance-datafusion/src/substrait.rs:313— lance_datafusion::substrait::normalize_expr has cyclomatic complexity 31 (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.
lance_datafusion::signed_zero::rewrite_node (cyclomatic 23) rust/lance-datafusion/src/signed_zero.rs:207— lance_datafusion::signed_zero::rewrite_node 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.
lance_datafusion::exec::collect_execution_metrics (cyclomatic 16) rust/lance-datafusion/src/exec.rs:594— lance_datafusion::exec::collect_execution_metrics 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.
lance_table::utils::stream::apply_row_id_and_deletes_with_system_columns (cyclomatic 24) rust/lance-table/src/utils/stream.rs:466— lance_table::utils::stream::apply_row_id_and_deletes_with_system_columns has cyclomatic complexity 24 (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.
lance_table::transaction::row_version::resolve_update_version_metadata (cyclomatic 23) rust/lance-table/src/transaction/row_version.rs:91— lance_table::transaction::row_version::resolve_update_version_metadata 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.
lance_table::format::key_existence::extract_key_value (cyclomatic 18) rust/lance-table/src/format/key_existence.rs:311— lance_table::format::key_existence::extract_key_value has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
lance_table::system_index::frag_reuse::gate::classify (cyclomatic 17) rust/lance-table/src/system_index/frag_reuse/gate.rs:46— lance_table::system_index::frag_reuse::gate::classify 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.
FtsMemIndex::to_index_builder (cognitive 61) rust/lance/src/dataset/mem_wal/index/fts.rs:2689— FtsMemIndex::to_index_builder has cognitive complexity 61 (threshold 15). Drivers by points: if/else 15 (38 pts), loops 14 (23 pts) (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FtsMemIndex::expand_fuzzy_term (cognitive 25) rust/lance/src/dataset/mem_wal/index/fts.rs:2443— FtsMemIndex::expand_fuzzy_term has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 5, loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FtsMemIndex::search_match_strings (cognitive 19) rust/lance/src/dataset/mem_wal/index/fts.rs:2092— FtsMemIndex::search_match_strings has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 3 (7 pts), boolean chains 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FtsMemIndex::insert_batch_with_keys (cognitive 16) rust/lance/src/dataset/mem_wal/index/fts.rs:1674— FtsMemIndex::insert_batch_with_keys has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, boolean chains 3, loops 1, match/switch 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.
lance_io::uring::thread::run_uring_thread (cognitive 51) rust/lance-io/src/uring/thread.rs:185— lance_io::uring::thread::run_uring_thread has cognitive complexity 51 (threshold 15). Drivers by points: if/else 12 (34 pts), match/switch 3 (9 pts), loops 3 (6 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_io::local::remove_empty_dirs (cognitive 39) rust/lance-io/src/local.rs:54— lance_io::local::remove_empty_dirs has cognitive complexity 39 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 5 (10 pts), loops 3 (4 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.
lance_io::uring::current_thread::process_thread_local_completions (cognitive 23) rust/lance-io/src/uring/current_thread.rs:126— lance_io::uring::current_thread::process_thread_local_completions has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (21 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.
lance_io::uring::thread::process_completions (cognitive 22) rust/lance-io/src/uring/thread.rs:447— lance_io::uring::thread::process_completions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 1 (nesting depth added 12). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ManifestNamespace::rewrite_manifest (cognitive 35) rust/lance-namespace-impls/src/dir/manifest.rs:1940— ManifestNamespace::rewrite_manifest has cognitive complexity 35 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 4 (10 pts), loops 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManifestNamespace::describe_table (cognitive 24) rust/lance-namespace-impls/src/dir/manifest.rs:2802— ManifestNamespace::describe_table has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (20 pts), match/switch 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.
ManifestNamespace::create_table (cognitive 22) rust/lance-namespace-impls/src/dir/manifest.rs:2950— ManifestNamespace::create_table has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15, match/switch 2 (4 pts), boolean chains 3 (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.
ManifestNamespace::list_tables (cognitive 17) rust/lance-namespace-impls/src/dir/manifest.rs:2716— ManifestNamespace::list_tables has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (12 pts), loops 3 (5 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.
ShouldMaxScoreScorer::current_score_upper_bound (cognitive 30) rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:520— ShouldMaxScoreScorer::current_score_upper_bound has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 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.
ShouldMaxScoreScorer::prepare_window (cognitive 25) rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:209— ShouldMaxScoreScorer::prepare_window has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 3, 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.
ShouldMaxScoreScorer::ensure_confirmed (cognitive 20) rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:345— ShouldMaxScoreScorer::ensure_confirmed has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 4, loops 3 (4 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShouldMaxScoreScorer::position (cognitive 18) rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:275— ShouldMaxScoreScorer::position 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.
Duplicated block (23 lines × 2) rust/lance/src/dataset/scanner.rs:7326— rust/lance/src/dataset/scanner.rs:7326-7348 | rust/lance/src/dataset/scanner.rs:7387-7409 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/commit.rs:1792— rust/lance/src/io/commit.rs:1792-1814 | rust/lance/src/io/commit.rs:1862-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 (23 lines × 2) rust/lance-io/src/uring/current_thread.rs:280— rust/lance-io/src/uring/current_thread.rs:280-302 | rust/lance-io/src/uring/reader.rs:131-153 — before extracting anything, compare `rust/lance-io/src/uring/current_thread.rs` and `rust/lance-io/src/uring/reader.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance-namespace-impls/src/dir.rs:2103— rust/lance-namespace-impls/src/dir.rs:2103-2125 | rust/lance-namespace-impls/src/dir.rs:3541-3563 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:345— rust/lance/src/io/exec/fts.rs:345-366 | rust/lance/src/io/exec/fts.rs:416-437 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) rust/lance-encoding/src/encodings/physical/fsst.rs:331— rust/lance-encoding/src/encodings/physical/fsst.rs:331-352 | rust/lance-encoding/src/encodings/physical/fsst.rs:355-376 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) rust/lance-index/src/vector/graph.rs:399— rust/lance-index/src/vector/graph.rs:399-420 | rust/lance-index/src/vector/graph.rs:478-499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 2) rust/lance-io/src/uring/current_thread.rs:308— rust/lance-io/src/uring/current_thread.rs:308-329 | rust/lance-io/src/uring/reader.rs:159-180 — before extracting anything, compare `rust/lance-io/src/uring/current_thread.rs` and `rust/lance-io/src/uring/reader.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 82 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) java/lance-jni/src/namespace.rs:412— java/lance-jni/src/namespace.rs:412-424 | java/lance-jni/src/namespace.rs:736-748 | java/lance-jni/src/namespace.rs:926-938 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance/src/index/vector/ivf.rs:3183— rust/lance/src/index/vector/ivf.rs:3183-3195 | rust/lance/src/index/vector/ivf.rs:4589-4601 | rust/lance/src/index/vector/ivf.rs:4812-4824 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-encoding/src/decoder.rs:1646— rust/lance-encoding/src/decoder.rs:1646-1658 | rust/lance-encoding/src/decoder.rs:1893-1905 | rust/lance-encoding/src/decoder.rs:2111-2123 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-file/src/versions/v2_1/compression.rs:95— rust/lance-file/src/versions/v2_1/compression.rs:95-107 | rust/lance-file/src/versions/v2_2/compression.rs:89-101 | rust/lance-file/src/versions/v2_3/compression.rs:88-100 — `rust/lance-file/src/versions/v2_2/compression.rs` and `rust/lance-file/src/versions/v2_3/compression.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 4 separate duplicated blocks between them, totalling at least 61 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 (9–11 lines × 2) rust/lance/src/dataset/scanner.rs:3675— rust/lance/src/dataset/scanner.rs:3675-3685 | rust/lance/src/dataset/scanner.rs:7974-7982 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:3105— rust/lance/src/io/exec/fts.rs:3105-3115 | rust/lance/src/io/exec/fts.rs:5260-5268 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/versions/v1/writer/statistics.rs:249— rust/lance-file/src/versions/v1/writer/statistics.rs:249-257 | rust/lance-file/src/versions/v1/writer/statistics.rs:324-334 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–11 lines × 2) rust/lance-index/src/scalar/rtree.rs:398— rust/lance-index/src/scalar/rtree.rs:398-408 | rust/lance-index/src/scalar/rtree.rs:439-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 (8–10 lines × 2) rust/lance-encoding/src/decoder.rs:1308— rust/lance-encoding/src/decoder.rs:1308-1315 | rust/lance-encoding/src/decoder.rs:1368-1377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–10 lines × 2) rust/lance-encoding/src/encodings/logical/primitive.rs:5833— rust/lance-encoding/src/encodings/logical/primitive.rs:5833-5842 | rust/lance-encoding/src/encodings/logical/primitive/sparse/writer.rs:474-481 — 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–10 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:481— rust/lance-file/src/versions/v2_0/writer.rs:481-490 | rust/lance-file/src/versions/v2_0/writer.rs:572-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 (8–10 lines × 2) rust/lance-index/src/scalar/json.rs:561— rust/lance-index/src/scalar/json.rs:561-568 | rust/lance-index/src/scalar/json.rs:687-696 — both copies are in the same file, so extract the block into 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 × 3) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:460— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:460-466 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/btree.rs:351-359 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:345-353 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/btree.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 (7 lines × 3) rust/lance-index/src/scalar/btree.rs:2315— rust/lance-index/src/scalar/btree.rs:2315-2321 | rust/lance-index/src/scalar/rtree.rs:510-516 | rust/lance/src/index/scalar/rtree.rs:16-22 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (7 lines × 3) rust/lance-index/src/scalar/bitmap.rs:2132— rust/lance-index/src/scalar/bitmap.rs:2132-2138 | rust/lance-index/src/scalar/btree.rs:3750-3756 | rust/lance-index/src/scalar/label_list.rs:1070-1076 — 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) rust/lance-arrow/src/lib.rs:1115— rust/lance-arrow/src/lib.rs:1115-1121 | rust/lance-arrow/src/lib.rs:1137-1143 | rust/lance-arrow/src/lib.rs:1159-1165 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Outbound HTTP without resilience REDACTED:270— `urlopen(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout. 4 of the 7 files that make outbound calls are unbounded; the first 4 are listed.
Outbound HTTP without resilience python/python/lance/download.py:57— `requests.get(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience rust/lance-namespace-impls/src/credentials/azure.rs:231— `reqwest::Client::new(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Outbound HTTP without resilience rust/lance-namespace-impls/src/rest/tls.rs:77— `reqwest::Client::builder(` makes an outbound HTTP call, and nothing bounds it: no timeout, deadline, retry or circuit breaker is set for it here, and the client has no process-wide default. A slow or failing dependency will hold this service's request, thread or connection until the call gives up on its own — or never, for a client with no default timeout.
Transaction::build_manifest_prepared (cyclomatic 151) rust/lance-table/src/transaction/manifest_build.rs:585— Transaction::build_manifest_prepared has cyclomatic complexity 151 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Transaction::try_from (cyclomatic 34) rust/lance-table/src/transaction/proto.rs:86— Transaction::try_from 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.
Transaction::withdraw_rewritten_coverage (cyclomatic 16) rust/lance-table/src/transaction/index_maintenance.rs:259— Transaction::withdraw_rewritten_coverage 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.
CleanupTask::cleanup_file_if_not_referenced (cyclomatic 33) rust/lance/src/dataset/cleanup.rs:975— CleanupTask::cleanup_file_if_not_referenced 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.
CleanupTask::delete_unreferenced_files (cyclomatic 27) rust/lance/src/dataset/cleanup.rs:697— CleanupTask::delete_unreferenced_files 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.
CleanupTask::process_branch_referenced_manifests (cyclomatic 16) rust/lance/src/dataset/cleanup.rs:1325— CleanupTask::process_branch_referenced_manifests 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.
FileFragment::scanner (cyclomatic 24) python/src/fragment.rs:217— FileFragment::scanner has cyclomatic complexity 24 (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.
FileFragment::validate (cyclomatic 22) rust/lance/src/dataset/fragment.rs:1765— FileFragment::validate 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.
FileFragment::update_columns_with_offsets (cyclomatic 21) rust/lance/src/dataset/fragment.rs:2393— FileFragment::update_columns_with_offsets 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.
IVFIndex::search_partitions (cognitive 65) rust/lance/src/index/vector/ivf/v2.rs:2318— IVFIndex::search_partitions has cognitive complexity 65 (threshold 15). Drivers by points: if/else 14 (32 pts), loops 7 (15 pts), match/switch 4 (12 pts), boolean chains 6 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IVFIndex::prewarm_partition_window (cognitive 25) rust/lance/src/index/vector/ivf/v2.rs:1862— IVFIndex::prewarm_partition_window has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (7 pts), boolean chains 2, match/switch 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IVFIndex::search_partitions_batch (cognitive 16) rust/lance/src/index/vector/ivf/v2.rs:2644— IVFIndex::search_partitions_batch has cognitive complexity 16 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 5 (6 pts) (nesting depth added 5). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
CleanupTask::cleanup_file_if_not_referenced (cognitive 55) rust/lance/src/dataset/cleanup.rs:975— CleanupTask::cleanup_file_if_not_referenced has cognitive complexity 55 (threshold 15). Drivers by points: if/else 34 (52 pts), boolean chains 2, match/switch 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.
CleanupTask::delete_unreferenced_files (cognitive 44) rust/lance/src/dataset/cleanup.rs:697— CleanupTask::delete_unreferenced_files has cognitive complexity 44 (threshold 15). Drivers by points: if/else 18 (29 pts), match/switch 3 (6 pts), boolean chains 5, loops 2 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CleanupTask::process_branch_referenced_manifests (cognitive 34) rust/lance/src/dataset/cleanup.rs:1325— CleanupTask::process_branch_referenced_manifests has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (27 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 19). 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.
MergeInsertJob::execute_uncommitted_impl (cognitive 40) rust/lance/src/dataset/write/merge_insert.rs:2726— MergeInsertJob::execute_uncommitted_impl has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (25 pts), loops 3 (9 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MergeInsertJob::update_fragments (cognitive 39) rust/lance/src/dataset/write/merge_insert.rs:1580— MergeInsertJob::update_fragments has cognitive complexity 39 (threshold 15). Drivers by points: if/else 18 (40 pts), loops 11 (24 pts), match/switch 5 (12 pts), boolean chains 1 (nesting depth added 42). To reduce it, split the body into named stages: move each independent 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 (MergeInsertJob::update_fragments::handle_fragment) 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.
MergeInsertJob::update_fragments::handle_fragment (cognitive 23) rust/lance/src/dataset/write/merge_insert.rs:1671— MergeInsertJob::update_fragments::handle_fragment has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), loops 4 (10 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (MergeInsertJob::update_fragments) 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.
FileFragment::update_columns_with_offsets (cognitive 37) rust/lance/src/dataset/fragment.rs:2393— FileFragment::update_columns_with_offsets has cognitive complexity 37 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 4 (6 pts), boolean chains 3 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileFragment::validate (cognitive 31) rust/lance/src/dataset/fragment.rs:1765— FileFragment::validate has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (16 pts), loops 6 (8 pts), boolean chains 5, 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.
FileFragment::scanner (cognitive 28) python/src/fragment.rs:217— FileFragment::scanner has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20 (24 pts), match/switch 2 (4 pts) (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Partition::maxscore_loop (cognitive 35) rust/lance/src/dataset/mem_wal/index/fts.rs:4565— Partition::maxscore_loop has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 6 (11 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.
Partition::from_tail (cognitive 18) rust/lance/src/dataset/mem_wal/index/fts.rs:4302— Partition::from_tail has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 4 (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.
Partition::search_phrase (cognitive 16) rust/lance/src/dataset/mem_wal/index/fts.rs:4633— Partition::search_phrase has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SerializerContext::record_offsets (cognitive 35) rust/lance-encoding/src/repdef.rs:714— SerializerContext::record_offsets has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (17 pts), loops 6 (16 pts), boolean chains 1, 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.
SerializerContext::normalize_specials_and_plan_splits (cognitive 34) rust/lance-encoding/src/repdef.rs:958— SerializerContext::normalize_specials_and_plan_splits has cognitive complexity 34 (threshold 15). Drivers by points: if/else 23 (29 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SerializerContext::multiply_levels (cognitive 26) rust/lance-encoding/src/repdef.rs:871— SerializerContext::multiply_levels has cognitive complexity 26 (threshold 15). Drivers by points: loops 8 (21 pts), if/else 4, boolean chains 1 (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.
MinHashLshIndex::refine (cognitive 31) rust/lance-index/src/scalar/minhash_lsh/index.rs:670— MinHashLshIndex::refine has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 3 (5 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.
MinHashLshIndex::read_queued (cognitive 25) rust/lance-index/src/scalar/minhash_lsh/index.rs:773— MinHashLshIndex::read_queued has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MinHashLshIndex::next_candidate (cognitive 21) rust/lance-index/src/scalar/minhash_lsh/index.rs:517— MinHashLshIndex::next_candidate has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 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.
lance_core::datatypes::schema::compare_fields (cognitive 27) rust/lance-core/src/datatypes/schema.rs:930— lance_core::datatypes::schema::compare_fields has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 4, loops 2 (4 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_core::datatypes::schema::parse_field_path (cognitive 27) rust/lance-core/src/datatypes/schema.rs:1581— lance_core::datatypes::schema::parse_field_path has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
lance_core::utils::cpu::detect_host_features (cognitive 17) rust/lance-core/src/utils/cpu.rs:99— lance_core::utils::cpu::detect_host_features has cognitive complexity 17 (threshold 15). Drivers by points: if/else 17. 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.
Field::do_intersection (cognitive 26) rust/lance-core/src/datatypes/field.rs:913— Field::do_intersection has cognitive complexity 26 (threshold 15). Drivers by points: if/else 17 (24 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.
Field::project_by_field (cognitive 19) rust/lance-core/src/datatypes/field.rs:788— Field::project_by_field has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), boolean chains 5, match/switch 2 (3 pts), 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.
Field::try_from (cognitive 16) rust/lance-core/src/datatypes/field.rs:1207— Field::try_from has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 3, 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.
lance_arrow::json::convert_json_array (cognitive 19) rust/lance-arrow/src/json.rs:461— lance_arrow::json::convert_json_array has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 1 (2 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.
lance_arrow::ipc::read_ipc_stream_at (cognitive 17) rust/lance-arrow/src/ipc.rs:203— lance_arrow::ipc::read_ipc_stream_at has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (15 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.
lance_arrow::stream::rechunk_stream_by_size_inner (cognitive 16) rust/lance-arrow/src/stream.rs:61— lance_arrow::stream::rechunk_stream_by_size_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7, boolean chains 4, loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 2). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change-coupling hub: bitmap.rs → fixed_size_list.rs, list.rs, value.rs rust/lance-encoding/src/array_encoding/physical/bitmap.rs— `rust/lance-encoding/src/array_encoding/physical/bitmap.rs` changes together with 3 other files — `rust/lance-encoding/src/array_encoding/physical/fixed_size_list.rs`, `rust/lance-encoding/src/encodings/logical/list.rs`, `rust/lance-encoding/src/encodings/physical/value.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
Change-coupling hub: basic.rs → bitmap.rs, fixed_size_list.rs, fixed_size_list.rs, list.rs, value.rs rust/lance-encoding/src/array_encoding/physical/basic.rs— `rust/lance-encoding/src/array_encoding/physical/basic.rs` changes together with 5 other files — `rust/lance-encoding/src/array_encoding/physical/bitmap.rs`, `rust/lance-encoding/src/array_encoding/physical/fixed_size_list.rs`, `rust/lance-encoding/src/encodings/logical/fixed_size_list.rs`, `rust/lance-encoding/src/encodings/logical/list.rs`, `rust/lance-encoding/src/encodings/physical/value.rs` — none of which declares a dependency on it: one file is the hub of 5 separate couplings, not 5 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 5.
Change-coupling hub: binary.rs → encoder.rs, fixed_size_list.rs, list.rs rust/lance-encoding/src/array_encoding/logical/binary.rs— `rust/lance-encoding/src/array_encoding/logical/binary.rs` changes together with 3 other files — `rust/lance-encoding/src/encoder.rs`, `rust/lance-encoding/src/encodings/logical/fixed_size_list.rs`, `rust/lance-encoding/src/encodings/logical/list.rs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (6 members, 50+ identical tokens) rust/lance/src/io/exec/fts.rs:3856— rust/lance/src/io/exec/fts.rs:3856-3980 | rust/lance/src/io/exec/fts.rs:4303-4431 | rust/lance/src/io/exec/fts.rs:4647-4807 | rust/lance/src/io/exec/knn.rs:992-1066 | rust/lance/src/io/exec/rowids.rs:181-231 | rust/lance/src/io/exec/scalar_index.rs:557-636 — 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) rust/lance-linalg/src/distance/cosine.rs:1166— rust/lance-linalg/src/distance/cosine.rs:1166-1185 | rust/lance-linalg/src/distance/cosine.rs:1257-1271 | rust/lance-linalg/src/distance/dot.rs:685-703 | rust/lance-linalg/src/distance/dot.rs:708-726 | rust/lance-linalg/src/distance/l2.rs:743-765 | rust/lance-linalg/src/distance/l2.rs:770-792 — 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) rust/lance-namespace-impls/src/dir/manifest.rs:2802— rust/lance-namespace-impls/src/dir/manifest.rs:2802-2922 | rust/lance-namespace-impls/src/dir/manifest.rs:2924-2948 | rust/lance-namespace-impls/src/dir/manifest.rs:2954-3160 | rust/lance-namespace-impls/src/dir/manifest.rs:3162-3213 | rust/lance-namespace-impls/src/dir/manifest.rs:3557-3630 | rust/lance-namespace-impls/src/dir/manifest.rs:3635-3674 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (5 members, 50+ identical tokens) rust/lance-index/src/vector/ivf.rs:122— rust/lance-index/src/vector/ivf.rs:122-143 | rust/lance-index/src/vector/ivf.rs:150-181 | rust/lance-index/src/vector/ivf.rs:190-232 | rust/lance-index/src/vector/ivf.rs:240-275 | rust/lance-index/src/vector/ivf.rs:283-324 — 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) rust/lance-namespace-impls/src/dir/manifest.rs:2148— rust/lance-namespace-impls/src/dir/manifest.rs:2148-2216 | rust/lance-namespace-impls/src/dir/manifest.rs:2279-2307 | rust/lance-namespace-impls/src/dir/manifest.rs:2406-2472 | rust/lance-namespace-impls/src/dir/manifest.rs:2716-2800 | rust/lance-namespace-impls/src/dir/manifest.rs:3218-3273 — 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) python/python/lance/dataset.py:1635— python/python/lance/dataset.py:1635-1768 | python/python/lance/dataset.py:1797-1835 | python/python/lance/dataset.py:2214-2248 | python/python/lance/fragment.py:707-724 | python/python/lance/fragment.py:745-760 — 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 (37 lines × 2) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:297— rust/lance-encoding/src/encodings/logical/primitive/dict.rs:297-333 | rust/lance-encoding/src/encodings/logical/primitive/dict.rs:353-389 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (37 lines × 2) rust/lance-file/src/versions/v2_2/mod.rs:74— rust/lance-file/src/versions/v2_2/mod.rs:74-110 | rust/lance-file/src/versions/v2_3/mod.rs:82-118 — `rust/lance-file/src/versions/v2_2/mod.rs` and `rust/lance-file/src/versions/v2_3/mod.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 57 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 (37 lines × 2) rust/lance-index/src/vector/graph.rs:422— rust/lance-index/src/vector/graph.rs:422-458 | rust/lance-index/src/vector/graph.rs:500-536 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/reader/structural.rs:285— rust/lance-file/src/reader/structural.rs:285-317 | rust/lance-file/src/versions/v2_0/reader.rs:245-277 — before extracting anything, compare `rust/lance-file/src/reader/structural.rs` and `rust/lance-file/src/versions/v2_0/reader.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 101 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 (33 lines × 2) rust/lance-index/src/scalar/inverted/index/posting_builder.rs:488— rust/lance-index/src/scalar/inverted/index/posting_builder.rs:488-520 | rust/lance-index/src/scalar/inverted/index/posting_builder.rs:773-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 (33 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1280— rust/lance-index/src/vector/distributed/index_merger.rs:1280-1312 | rust/lance-index/src/vector/distributed/index_merger.rs:1438-1470 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24–25 lines × 2) rust/lance/src/dataset/scanner.rs:5369— rust/lance/src/dataset/scanner.rs:5369-5392 | rust/lance/src/dataset/scanner.rs:5534-5558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24–25 lines × 2) rust/lance-encoding/src/array_encoding/strategy.rs:137— rust/lance-encoding/src/array_encoding/strategy.rs:137-161 | rust/lance-encoding/src/encoder/structural.rs:43-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (24–25 lines × 2) rust/lance-index/src/scalar/inverted.rs:123— rust/lance-index/src/scalar/inverted.rs:123-146 | rust/lance-index/src/scalar/inverted/index/search.rs:397-421 — before extracting anything, compare `rust/lance-index/src/scalar/inverted.rs` and `rust/lance-index/src/scalar/inverted/index/search.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 2) java/lance-jni/src/fragment.rs:485— java/lance-jni/src/fragment.rs:485-502 | java/lance-jni/src/fragment.rs:545-561 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 2) rust/lance/src/dataset/cleanup.rs:1031— rust/lance/src/dataset/cleanup.rs:1031-1047 | rust/lance/src/dataset/cleanup.rs:1102-1119 — both copies are in the same file, so extract the block into 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) rust/lance-table/src/io/commit/dynamodb.rs:271— rust/lance-table/src/io/commit/dynamodb.rs:271-287 | rust/lance-table/src/io/commit/dynamodb.rs:304-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 (12–14 lines × 2) rust/lance/src/dataset/mem_wal/index/fts.rs:1825— rust/lance/src/dataset/mem_wal/index/fts.rs:1825-1836 | rust/lance/src/io/exec/fts.rs:2294-2307 — 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–14 lines × 2) rust/lance/src/index/vector/ivf.rs:1056— rust/lance/src/index/vector/ivf.rs:1056-1069 | rust/lance/src/index/vector/ivf.rs:1144-1155 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/encodings/physical/bitpacking.rs:345— rust/lance-encoding/src/encodings/physical/bitpacking.rs:345-356 | rust/lance-encoding/src/encodings/physical/bitpacking.rs:368-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 (13–14 lines × 2) rust/lance/src/dataset/scanner.rs:5721— rust/lance/src/dataset/scanner.rs:5721-5733 | rust/lance/src/dataset/scanner.rs:6085-6098 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector.rs:1929— rust/lance/src/index/vector.rs:1929-1941 | rust/lance/src/index/vector.rs:1965-1978 — both copies are in the same file, so extract the block into 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) rust/lance/src/io/exec/fts.rs:2986— rust/lance/src/io/exec/fts.rs:2986-2999 | rust/lance/src/io/exec/fts.rs:5162-5174 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–12 lines × 2) java/lance-jni/src/mem_wal.rs:896— java/lance-jni/src/mem_wal.rs:896-905 | python/src/mem_wal.rs:800-811 — before extracting anything, compare `java/lance-jni/src/mem_wal.rs` and `python/src/mem_wal.rs` as WHOLE FILES: this scan already matched 4 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.
Duplicated block (10–12 lines × 2) python/src/dataset.rs:2200— python/src/dataset.rs:2200-2211 | python/src/dataset.rs:2234-2243 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–12 lines × 2) rust/lance/src/dataset/write/merge_insert/exec/delete.rs:157— rust/lance/src/dataset/write/merge_insert/exec/delete.rs:157-166 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:742-753 — before extracting anything, compare `rust/lance/src/dataset/write/merge_insert/exec/delete.rs` and `rust/lance/src/dataset/write/merge_insert/exec/write.rs` as WHOLE FILES: this scan already matched 7 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 (10 lines × 4) rust/lance/src/dataset/write/delete.rs:56— rust/lance/src/dataset/write/delete.rs:56-65 | rust/lance/src/dataset/write/merge_insert.rs:3038-3047 | rust/lance/src/dataset/write/merge_insert/exec.rs:70-79 | rust/lance/src/dataset/write/update.rs:697-706 — before extracting anything, compare `rust/lance/src/dataset/write/delete.rs` and `rust/lance/src/dataset/write/merge_insert.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) rust/lance/src/dataset/write/delete.rs:87— rust/lance/src/dataset/write/delete.rs:87-96 | rust/lance/src/dataset/write/merge_insert.rs:3069-3078 | rust/lance/src/dataset/write/merge_insert/exec.rs:101-110 | rust/lance/src/dataset/write/update.rs:728-737 — before extracting anything, compare `rust/lance/src/dataset/write/delete.rs` and `rust/lance/src/dataset/write/merge_insert.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) rust/lance/src/io/exec/fts.rs:2938— rust/lance/src/io/exec/fts.rs:2938-2947 | rust/lance/src/io/exec/fts.rs:2960-2969 | rust/lance/src/io/exec/fts.rs:5116-5125 | rust/lance/src/io/exec/fts.rs:5136-5145 — 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) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1121— rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1121-1129 | rust/lance/src/dataset/mem_wal/scanner/planner.rs:365-373 | rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:701-709 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:511-519 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/fts_search.rs` and `rust/lance/src/dataset/mem_wal/scanner/planner.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) python/src/dataset/optimize.rs:241— python/src/dataset/optimize.rs:241-249 | python/src/dataset/optimize.rs:353-361 | python/src/fragment.rs:720-728 | python/src/fragment.rs:779-787 — 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) rust/lance-namespace-impls/src/credentials/azure.rs:404— rust/lance-namespace-impls/src/credentials/azure.rs:404-415 | rust/lance-namespace-impls/src/credentials/azure.rs:461-470 | rust/lance-namespace-impls/src/credentials/azure.rs:517-528 | rust/lance-namespace-impls/src/credentials/gcp.rs:1107-1115 — before extracting anything, compare `rust/lance-namespace-impls/src/credentials/azure.rs` and `rust/lance-namespace-impls/src/credentials/gcp.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–7 lines × 2) rust/lance-file/src/concat.rs:473— rust/lance-file/src/concat.rs:473-479 | rust/lance/src/dataset/blob.rs:284-289 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6–7 lines × 2) rust/lance-encoding/src/encodings/physical/block.rs:519— rust/lance-encoding/src/encodings/physical/block.rs:519-524 | rust/lance-encoding/src/encodings/physical/block.rs:538-544 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6–7 lines × 2) rust/lance-index/src/scalar/rtree.rs:662— rust/lance-index/src/scalar/rtree.rs:662-667 | rust/lance-index/src/scalar/rtree.rs:822-828 — both copies are in the same file, so extract the block into 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 × 4) rust/lance-namespace-impls/src/dir/manifest.rs:2151— rust/lance-namespace-impls/src/dir/manifest.rs:2151-2157 | rust/lance-namespace-impls/src/dir/manifest.rs:2409-2414 | rust/lance-namespace-impls/src/dir/manifest.rs:2738-2743 | rust/lance-namespace-impls/src/dir/manifest.rs:3240-3245 — 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 (6 lines × 4) rust/lance-linalg/src/distance/dot.rs:535— rust/lance-linalg/src/distance/dot.rs:535-540 | rust/lance-linalg/src/distance/dot.rs:553-558 | rust/lance-linalg/src/distance/dot.rs:571-576 | rust/lance-linalg/src/distance/l2.rs:576-581 — before extracting anything, compare `rust/lance-linalg/src/distance/dot.rs` and `rust/lance-linalg/src/distance/l2.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 86 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 4) java/src/main/java/org/lance/Dataset.java:1614— java/src/main/java/org/lance/Dataset.java:1614-1619 | java/src/main/java/org/lance/Dataset.java:1773-1778 | java/src/main/java/org/lance/Dataset.java:2446-2451 | java/src/main/java/org/lance/ipc/LanceScanner.java:267-272 — 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 (5 lines × 4) rust/lance-index/src/vector/bq/storage.rs:2070— rust/lance-index/src/vector/bq/storage.rs:2070-2074 | rust/lance-index/src/vector/bq/storage.rs:2106-2110 | rust/lance-index/src/vector/storage.rs:205-209 | rust/lance-index/src/vector/storage.rs:238-242 — before extracting anything, compare `rust/lance-index/src/vector/bq/storage.rs` and `rust/lance-index/src/vector/storage.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) java/lance-jni/src/blocking_dataset.rs:921— java/lance-jni/src/blocking_dataset.rs:921-934 | java/lance-jni/src/blocking_scanner.rs:683-696 | java/lance-jni/src/file_reader.rs:85-89 | java/lance-jni/src/file_writer.rs:51-55 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (5 lines × 4) rust/lance-datafusion/src/expr.rs:196— rust/lance-datafusion/src/expr.rs:196-200 | rust/lance-datafusion/src/expr.rs:227-231 | rust/lance-datafusion/src/expr.rs:305-309 | rust/lance-datafusion/src/expr.rs:336-340 — 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.
Off the main sequence: fsst — fsst: 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: lance-arrow-scalar — lance-arrow-scalar: 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: lance-datagen — lance-datagen: abstractness 0.05, instability 0.00, distance 0.95 — zone of pain — concrete and depended on by 2 project(s), so it's rigid to change.
CI formatting step cannot fail REDACTED:138— `8. Run "cargo fmt --all" to ensure formatting is correct.` invokes cargo fmt in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:139— `- For formatting issues: Run "cargo fmt --all"` invokes cargo fmt in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
CI formatting step cannot fail REDACTED:143— `- Run "cargo fmt --all" to ensure formatting is correct` invokes cargo fmt in the mode that REWRITES the files it reformats and exits 0 whatever it changed. The rewrite happens inside the runner's throwaway checkout and is then discarded, so the step passes on a badly-formatted change exactly as it passes on a clean one — it enforces nothing, and no other step in this file reads the result. `--check` is the flag that turns the same invocation into a gate: it leaves the files alone and exits non-zero when anything would have been reformatted.
MergeInsertJob::update_fragments (cyclomatic 34) rust/lance/src/dataset/write/merge_insert.rs:1580— MergeInsertJob::update_fragments has cyclomatic complexity 34 (threshold 15). Of this number, 21 points are the body's own statements and 13 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MergeInsertJob::execute_uncommitted_impl (cyclomatic 19) rust/lance/src/dataset/write/merge_insert.rs:2726— MergeInsertJob::execute_uncommitted_impl 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.
SerializerContext::normalize_specials_and_plan_splits (cyclomatic 28) rust/lance-encoding/src/repdef.rs:958— SerializerContext::normalize_specials_and_plan_splits 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.
SerializerContext::record_offsets (cyclomatic 18) rust/lance-encoding/src/repdef.rs:714— SerializerContext::record_offsets has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
lance_io::local::remove_empty_dirs (cyclomatic 28) rust/lance-io/src/local.rs:54— lance_io::local::remove_empty_dirs 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.
lance_io::uring::thread::run_uring_thread (cyclomatic 19) rust/lance-io/src/uring/thread.rs:185— lance_io::uring::thread::run_uring_thread 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.
FtsMemIndex::to_index_builder (cyclomatic 26) rust/lance/src/dataset/mem_wal/index/fts.rs:2689— FtsMemIndex::to_index_builder 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.
FtsMemIndex::expand_fuzzy_term (cyclomatic 16) rust/lance/src/dataset/mem_wal/index/fts.rs:2443— FtsMemIndex::expand_fuzzy_term 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.
PyLance::into_pyobject (cyclomatic 24) python/src/transaction.rs:659— PyLance::into_pyobject has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
PyLance::extract (cyclomatic 18) python/src/transaction.rs:416— PyLance::extract has cyclomatic complexity 18 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
IvfIndexBuilder::build_partitions (cyclomatic 24) rust/lance/src/index/vector/builder.rs:999— IvfIndexBuilder::build_partitions 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.
IvfIndexBuilder::merge_partitions (cyclomatic 22) rust/lance/src/index/vector/builder.rs:1597— IvfIndexBuilder::merge_partitions 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.
lance_file::concat::validate_blob_field (cyclomatic 22) rust/lance-file/src/concat.rs:379— lance_file::concat::validate_blob_field 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.
lance_file::concat::check_compatibility (cyclomatic 17) rust/lance-file/src/concat.rs:684— lance_file::concat::check_compatibility 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.
Field::project_by_field (cyclomatic 21) rust/lance-core/src/datatypes/field.rs:788— Field::project_by_field has cyclomatic complexity 21 (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.
Field::try_from (cyclomatic 19) rust/lance-core/src/datatypes/field.rs:1207— Field::try_from 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.
lance_encoding::encodings::logical::primitive::dict::dictionary_encode (cyclomatic 21) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:278— lance_encoding::encodings::logical::primitive::dict::dictionary_encode 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.
lance_encoding::array_encoding::physical::decoder_from_array_encoding (cyclomatic 21) rust/lance-encoding/src/array_encoding/physical.rs:141— lance_encoding::array_encoding::physical::decoder_from_array_encoding 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.
LsmFtsSearchPlanner::plan_bound_search (cyclomatic 20) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:772— LsmFtsSearchPlanner::plan_bound_search has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LsmFtsSearchPlanner::build_source_plan (cyclomatic 19) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1073— LsmFtsSearchPlanner::build_source_plan 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.
FragmentScanner::read_batch (cyclomatic 17) rust/lance/src/io/exec/pushdown_scan.rs:390— FragmentScanner::read_batch 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.
FragmentScanner::extract_guarantees (cyclomatic 17) rust/lance/src/io/exec/pushdown_scan.rs:578— FragmentScanner::extract_guarantees 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.
HackComment python/python/lance/vector.py:762— # Hack for Windows due to — 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.
HackComment rust/lance-datafusion/src/sql.rs:85— // Hack to allow == as equals — 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.
CreateIndexBuilder::execute_uncommitted_impl (cognitive 78) rust/lance/src/index/create.rs:161— CreateIndexBuilder::execute_uncommitted_impl has cognitive complexity 78 (threshold 15). Drivers by points: if/else 42 (65 pts), boolean chains 6, match/switch 3 (5 pts), loops 1 (2 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.
CreateIndexBuilder::execute_multi_segment_fmindex (cognitive 20) rust/lance/src/index/create.rs:726— CreateIndexBuilder::execute_multi_segment_fmindex has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 3, loops 2 (3 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.
fsst::fsst::build_symbol_table (cognitive 65) rust/compression/fsst/src/fsst.rs:561— fsst::fsst::build_symbol_table has cognitive complexity 65 (threshold 15). Drivers by points: if/else 25 (51 pts), loops 9 (11 pts), boolean chains 3 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
fsst::fsst::decompress_bulk (cognitive 25) rust/compression/fsst/src/fsst.rs:926— fsst::fsst::decompress_bulk has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 3 (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.
InvertedPartition::load_posting_lists_with_policy (cognitive 62) rust/lance-index/src/scalar/inverted/index/partition.rs:1314— InvertedPartition::load_posting_lists_with_policy has cognitive complexity 62 (threshold 15). Drivers by points: if/else 24 (40 pts), boolean chains 10, loops 5 (9 pts), match/switch 2 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InvertedPartition::stale_row_stats_for_terms (cognitive 27) rust/lance-index/src/scalar/inverted/index/partition.rs:751— InvertedPartition::stale_row_stats_for_terms has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 5 (9 pts), match/switch 1 (2 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FilteredReadStream::plan_scan (cognitive 53) rust/lance/src/io/exec/filtered_read.rs:837— FilteredReadStream::plan_scan has cognitive complexity 53 (threshold 15). Drivers by points: if/else 22 (47 pts), boolean chains 4, loops 2 (nesting depth added 25). 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.
FilteredReadStream::read_fragment (cognitive 19) rust/lance/src/io/exec/filtered_read.rs:1471— FilteredReadStream::read_fragment has cognitive complexity 19 (threshold 15). Drivers by points: if/else 16 (17 pts), boolean chains 1, match/switch 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
U64Segment::with_new_high (cognitive 38) rust/lance-table/src/rowids/segment.rs:508— U64Segment::with_new_high has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (30 pts), match/switch 3 (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.
U64Segment::from_stats_and_sequence (cognitive 17) rust/lance-table/src/rowids/segment.rs:196— U64Segment::from_stats_and_sequence has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 1 (4 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.
DatasetBuilder::load_impl (cognitive 35) rust/lance/src/dataset/builder.rs:687— DatasetBuilder::load_impl has cognitive complexity 35 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 8, match/switch 4 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DatasetBuilder::load_by_uri (cognitive 17) rust/lance/src/dataset/builder.rs:863— DatasetBuilder::load_by_uri has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (9 pts), match/switch 3 (8 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.
FragmentReuseIndex::remap_row_ids_excluding (cognitive 33) rust/lance/src/index/frag_reuse_reader.rs:386— FragmentReuseIndex::remap_row_ids_excluding has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (25 pts), loops 4 (8 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.
FragmentReuseIndex::segment_plans (cognitive 28) rust/lance/src/index/frag_reuse_reader.rs:232— FragmentReuseIndex::segment_plans has cognitive complexity 28 (threshold 15). Drivers by points: loops 8 (15 pts), if/else 3 (8 pts), match/switch 2 (5 pts) (nesting depth added 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
HNSW::flat_search (cognitive 33) rust/lance-index/src/vector/hnsw/builder.rs:621— HNSW::flat_search has cognitive complexity 33 (threshold 15). Drivers by points: if/else 10 (24 pts), loops 3 (6 pts), boolean chains 2, 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.
HNSW::search (cognitive 17) rust/lance-index/src/vector/hnsw/builder.rs:1612— HNSW::search has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
FragmentScanner::extract_guarantees (cognitive 31) rust/lance/src/io/exec/pushdown_scan.rs:578— FragmentScanner::extract_guarantees has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 3 (6 pts), loops 3 (4 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FragmentScanner::read_batch (cognitive 30) rust/lance/src/io/exec/pushdown_scan.rs:390— FragmentScanner::read_batch has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (26 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LsmFtsSearchPlanner::build_source_plan (cognitive 30) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1073— LsmFtsSearchPlanner::build_source_plan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 9 (14 pts), loops 1 (2 pts) (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.
LsmFtsSearchPlanner::plan_bound_search (cognitive 25) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:772— LsmFtsSearchPlanner::plan_bound_search has cognitive complexity 25 (threshold 15). Drivers by points: if/else 13 (15 pts), boolean chains 4, loops 3, match/switch 2 (3 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.
SegmentCursorState::extend_dense_bitmap_range (cognitive 28) rust/lance-table/src/rowids/segment.rs:858— SegmentCursorState::extend_dense_bitmap_range has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 3 (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.
SegmentCursorState::extend_range (cognitive 20) rust/lance-table/src/rowids/segment.rs:773— SegmentCursorState::extend_range has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 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.
MemTableBruteForceVectorExec::compute_topk (cognitive 26) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:204— MemTableBruteForceVectorExec::compute_topk has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (18 pts), boolean chains 5, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemTableBruteForceVectorExec::materialize_rows (cognitive 19) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:328— MemTableBruteForceVectorExec::materialize_rows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemTableScanner::collect_or_equalities (cognitive 25) rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1375— MemTableScanner::collect_or_equalities has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), loops 1 (2 pts), match/switch 2, boolean chains 1 (nesting depth added 12). Of this number, 24 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.
MemTableScanner::extract_btree_predicate (cognitive 17) rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1448— MemTableScanner::extract_btree_predicate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (4 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.
LsmScanPlanner::plan_scan (cognitive 25) rust/lance/src/dataset/mem_wal/scanner/planner.rs:130— LsmScanPlanner::plan_scan has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 4 (7 pts), boolean chains 4, loops 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
LsmScanPlanner::build_source_scan (cognitive 19) rust/lance/src/dataset/mem_wal/scanner/planner.rs:330— LsmScanPlanner::build_source_scan has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (3 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.
TopKCollector::collect_mapped (cognitive 25) rust/lance-index/src/scalar/inverted/compound.rs:2067— TopKCollector::collect_mapped has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (20 pts), boolean chains 3, loops 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.
TopKCollector::insert (cognitive 23) rust/lance-index/src/scalar/inverted/compound.rs:1987— TopKCollector::insert has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 3 (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.
FilteredReadExec::try_new_row_stream (cognitive 24) rust/lance/src/io/exec/filtered_read.rs:2194— FilteredReadExec::try_new_row_stream has cognitive complexity 24 (threshold 15). Drivers by points: if/else 17, boolean chains 7. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
FilteredReadExec::partition_statistics (cognitive 20) rust/lance/src/io/exec/filtered_read.rs:3339— FilteredReadExec::partition_statistics has cognitive complexity 20 (threshold 15). Drivers by points: if/else 13 (16 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.
LsmVectorSearchPlanner::build_knn_plan (cognitive 23) rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:460— LsmVectorSearchPlanner::build_knn_plan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 3 (5 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.
LsmVectorSearchPlanner::plan_search (cognitive 19) rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:259— LsmVectorSearchPlanner::plan_search has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RowIdIndex::probe (cognitive 23) rust/lance-table/src/rowids/index.rs:190— RowIdIndex::probe has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (19 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RowIdIndex::get_many (cognitive 18) rust/lance-table/src/rowids/index.rs:142— RowIdIndex::get_many has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LsmPointLookupPlanner::lookup_many (cognitive 21) rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:490— LsmPointLookupPlanner::lookup_many has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 3 (5 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.
LsmPointLookupPlanner::lookup (cognitive 16) rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:384— LsmPointLookupPlanner::lookup has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 3 (8 pts), if/else 3 (7 pts), boolean chains 1 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
InvertedIndexBuilder::merge_existing_segments (cognitive 21) rust/lance-index/src/scalar/inverted/builder.rs:301— InvertedIndexBuilder::merge_existing_segments has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InvertedIndexBuilder::update_index (cognitive 16) rust/lance-index/src/scalar/inverted/builder.rs:399— InvertedIndexBuilder::update_index has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 5 (6 pts), match/switch 2 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ShardWriter::open (cognitive 20) rust/lance/src/dataset/mem_wal/write.rs:2223— ShardWriter::open has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (18 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.
ShardWriter::close (cognitive 16) rust/lance/src/dataset/mem_wal/write.rs:3658— ShardWriter::close has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 7). 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.
InnerBuilder::merge_from (cognitive 19) rust/lance-index/src/scalar/inverted/builder.rs:1010— InnerBuilder::merge_from has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 4 (6 pts), match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
InnerBuilder::write_posting_lists (cognitive 16) rust/lance-index/src/scalar/inverted/builder.rs:1147— InnerBuilder::write_posting_lists has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Near-duplicate member pair (30 shared lines) rust/lance-io/src/object_store/providers/oss.rs:106— rust/lance-io/src/object_store/providers/oss.rs:106-151 | rust/lance-io/src/object_store/providers/tos.rs:112-157 — These two members are variants of one another: 30 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 (30 shared lines) rust/lance/src/index/vector/ivf.rs:3790— rust/lance/src/index/vector/ivf.rs:3790-3827 | rust/lance/src/index/vector/ivf.rs:3841-3886 — These two members are variants of one another: 30 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 (21 corresponding lines) · ×2
Edited copy of a member (21 corresponding lines) rust/lance-linalg/src/simd/f32.rs:431— rust/lance-linalg/src/simd/f32.rs:431-451 | rust/lance-linalg/src/simd/f32.rs:936-960 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (21 corresponding lines) rust/lance-linalg/src/simd/f64.rs:281— rust/lance-linalg/src/simd/f64.rs:281-301 | rust/lance-linalg/src/simd/f64.rs:729-753 — These two members are one piece of code written twice and then edited apart: 21 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (18 corresponding lines) · ×2
Edited copy of a member (18 corresponding lines) rust/lance-linalg/src/distance/cosine.rs:943— rust/lance-linalg/src/distance/cosine.rs:943-973 | rust/lance-linalg/src/distance/norm_l2.rs:262-281 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
Edited copy of a member (18 corresponding lines) rust/lance-linalg/src/distance/dot.rs:632— rust/lance-linalg/src/distance/dot.rs:632-657 | rust/lance-linalg/src/distance/norm_l2.rs:285-304 — These two members are one piece of code written twice and then edited apart: 18 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (7 members, 50+ identical tokens) · ×2
Members sharing a duplicated core (7 members, 50+ identical tokens) java/lance-jni/src/namespace.rs:353— java/lance-jni/src/namespace.rs:353-424 | java/lance-jni/src/namespace.rs:435-483 | java/lance-jni/src/namespace.rs:494-566 | java/lance-jni/src/namespace.rs:577-656 | java/lance-jni/src/namespace.rs:670-748 | java/lance-jni/src/namespace.rs:759-829 | java/lance-jni/src/namespace.rs:844-938 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Members sharing a duplicated core (7 members, 50+ identical tokens) rust/lance-datafusion/src/udf/json.rs:281— rust/lance-datafusion/src/udf/json.rs:281-303 | rust/lance-datafusion/src/udf/json.rs:447-468 | rust/lance-datafusion/src/udf/json.rs:509-534 | rust/lance-datafusion/src/udf/json.rs:562-590 | rust/lance-datafusion/src/udf/json.rs:618-646 | rust/lance-datafusion/src/udf/json.rs:674-702 | rust/lance-datafusion/src/udf/json.rs:730-758 — These 7 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 7 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 7 times.
Duplicated block (35 lines × 2) java/lance-jni/src/async_scanner.rs:272— java/lance-jni/src/async_scanner.rs:272-306 | java/lance-jni/src/blocking_scanner.rs:621-655 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (35 lines × 2) rust/lance/src/index/vector/ivf.rs:1192— rust/lance/src/index/vector/ivf.rs:1192-1226 | rust/lance/src/index/vector/ivf.rs:2391-2425 — both copies are in the same file, so extract the block into 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–29 lines × 2) java/lance-jni/src/otel.rs:235— java/lance-jni/src/otel.rs:235-261 | python/src/otel.rs:293-321 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 115 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 (27–29 lines × 2) rust/lance/src/io/exec/scan.rs:468— rust/lance/src/io/exec/scan.rs:468-494 | rust/lance/src/io/exec/scan.rs:502-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 (27 lines × 2) rust/lance-encoding/src/encodings/physical/fsst.rs:233— rust/lance-encoding/src/encodings/physical/fsst.rs:233-259 | rust/lance-encoding/src/encodings/physical/fsst.rs:264-290 — both copies are in the same file, so extract the block into 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) rust/lance-file/src/versions/v1/writer/statistics.rs:344— rust/lance-file/src/versions/v1/writer/statistics.rs:344-370 | rust/lance-file/src/versions/v1/writer/statistics.rs:418-444 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–23 lines × 2) rust/lance/src/dataset/mem_wal/memtable/flush.rs:307— rust/lance/src/dataset/mem_wal/memtable/flush.rs:307-326 | rust/lance/src/dataset/mem_wal/memtable/flush.rs:607-629 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20–23 lines × 2) rust/lance-table/src/io/commit/external_manifest.rs:80— rust/lance-table/src/io/commit/external_manifest.rs:80-102 | rust/lance-table/src/io/commit/external_manifest.rs:685-704 — both copies are in the same file, so extract the block into 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 × 3) rust/lance-file/src/versions/v2_1/compression.rs:62— rust/lance-file/src/versions/v2_1/compression.rs:62-83 | rust/lance-file/src/versions/v2_2/compression.rs:54-75 | rust/lance-file/src/versions/v2_3/compression.rs:54-75 — `rust/lance-file/src/versions/v2_2/compression.rs` and `rust/lance-file/src/versions/v2_3/compression.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 4 separate duplicated blocks between them, totalling at least 61 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 (22 lines × 3) rust/lance-file/src/versions/v2_1/reader.rs:110— rust/lance-file/src/versions/v2_1/reader.rs:110-131 | rust/lance-file/src/versions/v2_2/reader.rs:116-137 | rust/lance-file/src/versions/v2_3/reader.rs:156-177 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.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 10 separate duplicated blocks between them, totalling at least 158 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 (19–22 lines × 2) rust/lance/src/dataset/scanner.rs:5328— rust/lance/src/dataset/scanner.rs:5328-5346 | rust/lance/src/dataset/scanner.rs:5496-5517 — both copies are in the same file, so extract the block into 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–22 lines × 2) rust/lance/src/index/scalar/inverted.rs:546— rust/lance/src/index/scalar/inverted.rs:546-567 | rust/lance/src/index/scalar/inverted.rs:607-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 (19 lines × 3) rust/lance-file/src/versions/v2_1/writer.rs:206— rust/lance-file/src/versions/v2_1/writer.rs:206-224 | rust/lance-file/src/versions/v2_2/writer.rs:206-224 | rust/lance-file/src/versions/v2_3/writer.rs:206-224 — `rust/lance-file/src/versions/v2_1/writer.rs` and `rust/lance-file/src/versions/v2_2/writer.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 4 separate duplicated blocks between them, totalling at least 62 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 (19 lines × 3) rust/lance-index/src/vector/ivf.rs:158— rust/lance-index/src/vector/ivf.rs:158-176 | rust/lance-index/src/vector/ivf.rs:198-216 | rust/lance-index/src/vector/ivf.rs:248-266 — all 3 copies are in the same file, so extract the block into one function there and call 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 lines × 3) java/lance-jni/src/blocking_dataset.rs:2551— java/lance-jni/src/blocking_dataset.rs:2551-2567 | java/lance-jni/src/blocking_dataset.rs:2603-2619 | java/lance-jni/src/blocking_dataset.rs:2661-2677 — all 3 copies are in the same file, so extract the block into one function there and call 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 lines × 3) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:164— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:164-180 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/btree.rs:117-133 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:132-148 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/btree.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 (14–17 lines × 2) rust/lance-index/src/scalar/zonemap.rs:1224— rust/lance-index/src/scalar/zonemap.rs:1224-1240 | rust/lance-index/src/scalar/zonemap.rs:1719-1732 — both copies are in the same file, so extract the block into 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) python/python/lance/vector.py:562— python/python/lance/vector.py:562-575 | python/python/lance/vector.py:744-760 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `python/python/lance/vector.py:562` it begins part-way through the construct above it, so those exact lines 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 × 3) rust/lance/src/index/vector/ivf.rs:2719— rust/lance/src/index/vector/ivf.rs:2719-2733 | rust/lance/src/index/vector/ivf.rs:2866-2881 | rust/lance/src/index/vector/ivf.rs:2922-2937 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-io/src/object_store/providers/aws.rs:241— rust/lance-io/src/object_store/providers/aws.rs:241-256 | rust/lance-io/src/object_store/providers/azure.rs:284-298 | rust/lance-io/src/object_store/providers/gcp.rs:328-342 — before extracting anything, compare `rust/lance-io/src/object_store/providers/aws.rs` and `rust/lance-io/src/object_store/providers/gcp.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 34 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) rust/lance-index/src/scalar/inverted.rs:155— rust/lance-index/src/scalar/inverted.rs:155-170 | rust/lance-index/src/scalar/inverted/index/partition.rs:943-958 | rust/lance-index/src/scalar/inverted/index/search.rs:428-443 — before extracting anything, compare `rust/lance-index/src/scalar/inverted.rs` and `rust/lance-index/src/scalar/inverted/index/search.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 3) python/python/lance/dataset.py:4568— python/python/lance/dataset.py:4568-4583 | python/python/lance/dataset.py:4713-4728 | python/python/lance/fragment.py:1427-1442 — 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 (15 lines × 3) rust/lance/src/index/vector.rs:1559— rust/lance/src/index/vector.rs:1559-1573 | rust/lance/src/index/vector.rs:1577-1591 | rust/lance/src/index/vector.rs:1617-1631 — all 3 copies are in the same file, so extract the block into one function there and call 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 lines × 3) rust/lance-datafusion/src/expr.rs:389— rust/lance-datafusion/src/expr.rs:389-403 | rust/lance-datafusion/src/expr.rs:521-535 | rust/lance-datafusion/src/expr.rs:537-551 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–15 lines × 2) java/lance-jni/src/blocking_dataset.rs:2896— java/lance-jni/src/blocking_dataset.rs:2896-2910 | java/lance-jni/src/blocking_dataset.rs:2941-2951 — both copies are in the same file, so extract the block into 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–15 lines × 2) rust/lance/src/dataset/fragment.rs:1980— rust/lance/src/dataset/fragment.rs:1980-1994 | rust/lance/src/dataset/fragment/session.rs:61-71 — 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 × 4) rust/lance/src/dataset/scanner.rs:6607— rust/lance/src/dataset/scanner.rs:6607-6620 | rust/lance/src/dataset/scanner.rs:7710-7723 | rust/lance/src/dataset/scanner.rs:7770-7783 | rust/lance/src/dataset/scanner.rs:7793-7806 — 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 × 4) rust/lance-index/src/vector/ivf.rs:128— rust/lance-index/src/vector/ivf.rs:128-141 | rust/lance-index/src/vector/ivf.rs:156-169 | rust/lance-index/src/vector/ivf.rs:196-209 | rust/lance-index/src/vector/ivf.rs:246-259 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (11–14 lines × 2) rust/lance-linalg/src/simd/dist_table.rs:588— rust/lance-linalg/src/simd/dist_table.rs:588-598 | rust/lance-linalg/src/simd/dist_table.rs:687-700 — both copies are in the same file, so extract the block into 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–14 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2123— rust/lance-namespace-impls/src/dir/manifest.rs:2123-2136 | rust/lance-namespace-impls/src/dir/manifest.rs:3393-3403 — both copies are in the same file, so extract the block into 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) rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1071— rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1071-1083 | rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1135-1145 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 2) rust/lance-encoding/src/compression.rs:181— rust/lance-encoding/src/compression.rs:181-193 | rust/lance-encoding/src/compression.rs:289-299 — both copies are in the same file, so extract the block into 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) rust/lance-encoding/src/encodings/physical/binary.rs:398— rust/lance-encoding/src/encodings/physical/binary.rs:398-409 | rust/lance-encoding/src/encodings/physical/binary.rs:428-440 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/wand.rs:1671— rust/lance-index/src/scalar/inverted/wand.rs:1671-1683 | rust/lance-index/src/scalar/inverted/wand_maxscore.rs:230-241 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 4) rust/lance/src/dataset/mem_wal/scanner/builder.rs:614— rust/lance/src/dataset/mem_wal/scanner/builder.rs:614-625 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:679-690 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:725-736 | rust/lance/src/dataset/mem_wal/scanner/builder.rs:752-763 — 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) rust/lance-namespace/src/schema.rs:110— rust/lance-namespace/src/schema.rs:110-121 | rust/lance-namespace/src/schema.rs:128-139 | rust/lance-namespace/src/schema.rs:146-157 | rust/lance-namespace/src/schema.rs:190-201 — 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) rust/lance-file/src/versions/v2_0/reader.rs:138— rust/lance-file/src/versions/v2_0/reader.rs:138-148 | rust/lance-file/src/versions/v2_1/reader.rs:181-191 | rust/lance-file/src/versions/v2_2/reader.rs:183-193 | rust/lance-file/src/versions/v2_3/reader.rs:221-231 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.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 10 separate duplicated blocks between them, totalling at least 158 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 × 4) rust/lance-file/src/versions/v2_0/reader.rs:361— rust/lance-file/src/versions/v2_0/reader.rs:361-371 | rust/lance-file/src/versions/v2_1/reader.rs:224-234 | rust/lance-file/src/versions/v2_2/reader.rs:226-236 | rust/lance-file/src/versions/v2_3/reader.rs:264-274 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.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 10 separate duplicated blocks between them, totalling at least 158 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 (3–6 lines × 4) rust/lance-linalg/src/distance/cosine.rs:947— rust/lance-linalg/src/distance/cosine.rs:947-949 | rust/lance-linalg/src/distance/dot.rs:603-608 | rust/lance-linalg/src/distance/l2.rs:648-653 | rust/lance-linalg/src/distance/norm_l2.rs:263-268 — before extracting anything, compare `rust/lance-linalg/src/distance/cosine.rs` and `rust/lance-linalg/src/distance/dot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–6 lines × 4) rust/lance-linalg/src/distance/cosine.rs:956— rust/lance-linalg/src/distance/cosine.rs:956-958 | rust/lance-linalg/src/distance/dot.rs:610-615 | rust/lance-linalg/src/distance/l2.rs:656-661 | rust/lance-linalg/src/distance/norm_l2.rs:269-274 — before extracting anything, compare `rust/lance-linalg/src/distance/cosine.rs` and `rust/lance-linalg/src/distance/dot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
AC7 · A11y enforcement· Accessibility enforcement below the top rung · ×1
Accessibility enforcement below the top rung — No accessibility enforcement found — no accessibility linting at author time and no automated accessibility check in tests or CI. Add your UI toolkit's own accessibility assertion to the test suite (Flutter `meetsGuideline`, Espresso `AccessibilityChecks`, XCTest `performAccessibilityAudit`), then gate that test in the pipeline. What was searched, so you can tell an absence from a miss: the 5 markup file(s) this pass actually assessed, the linter configuration checked in beside them, and this repository's test and CI files — matched by name against the accessibility checkers this dimension carries. An audit run outside the repository, a hosted scanner, or a check whose name is not one of those, is not seen here.
Operation::eq (cyclomatic 238) rust/lance-table/src/transaction/conflicts.rs:19— Operation::eq has cyclomatic complexity 238 (threshold 15). Of this number, 237 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.
OrderableScalarValue::cmp (cyclomatic 188) rust/lance-index/src/scalar/btree.rs:139— OrderableScalarValue::cmp has cyclomatic complexity 188 (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.
LanceDataset._create_index_impl (cyclomatic 78) python/python/lance/dataset.py:3924— LanceDataset._create_index_impl has cyclomatic complexity 78 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ZoneMapIndex::evaluate_zone_against_query (cyclomatic 76) rust/lance-index/src/scalar/zonemap.rs:241— ZoneMapIndex::evaluate_zone_against_query has cyclomatic complexity 76 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BloomFilterIndex::evaluate_block_against_query (cyclomatic 56) rust/lance-index/src/scalar/bloomfilter.rs:305— BloomFilterIndex::evaluate_block_against_query 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.
lance_arrow_scalar::serde::format_string_to_data_type (cyclomatic 49) rust/arrow-scalar/src/serde.rs:161— lance_arrow_scalar::serde::format_string_to_data_type has cyclomatic complexity 49 (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.
lance_namespace::schema::arrow_type_to_json (cyclomatic 44) rust/lance-namespace/src/schema.rs:50— lance_namespace::schema::arrow_type_to_json has cyclomatic complexity 44 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (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.
CreateIndexBuilder::execute_uncommitted_impl (cyclomatic 43) rust/lance/src/index/create.rs:161— CreateIndexBuilder::execute_uncommitted_impl has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Planner::parse_sql_expr (cyclomatic 43) rust/lance-datafusion/src/planner.rs:683— Planner::parse_sql_expr has cyclomatic complexity 43 (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.
lance_arrow_stats::find_min_max_indices (cyclomatic 41) rust/arrow-stats/src/lib.rs:429— lance_arrow_stats::find_min_max_indices has cyclomatic complexity 41 (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.
LogicalType::try_from (cyclomatic 38) rust/lance-core/src/datatypes.rs:320— LogicalType::try_from has cyclomatic complexity 38 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
InvertedPartition::load_posting_lists_with_policy (cyclomatic 36) rust/lance-index/src/scalar/inverted/index/partition.rs:1314— InvertedPartition::load_posting_lists_with_policy 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.
PQDistCalculator::accumulate_topk_with_scratch (cyclomatic 36) rust/lance-index/src/vector/pq/storage.rs:982— PQDistCalculator::accumulate_topk_with_scratch 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.
IVFIndex::search_partitions (cyclomatic 34) rust/lance/src/index/vector/ivf/v2.rs:2318— IVFIndex::search_partitions 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.
DecodeMiniBlockTask::map_range (cyclomatic 34) rust/lance-encoding/src/encodings/logical/primitive.rs:495— DecodeMiniBlockTask::map_range 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.
fsst::fsst::build_symbol_table (cyclomatic 33) rust/compression/fsst/src/fsst.rs:561— fsst::fsst::build_symbol_table 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.
PackedStructVariablePerValueDecompressor::decompress (cyclomatic 31) rust/lance-encoding/src/encodings/physical/packed.rs:607— PackedStructVariablePerValueDecompressor::decompress 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.
RawInvertedIndexParams::resolve (cyclomatic 31) rust/lance-index/src/scalar/inverted/tokenizer.rs:288— RawInvertedIndexParams::resolve has cyclomatic complexity 31 (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.
dataset._build_vector_search_query (cyclomatic 30) python/python/lance/dataset.py:8430— dataset._build_vector_search_query has cyclomatic complexity 30 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Merger::execute_batch (cyclomatic 29) rust/lance/src/dataset/write/merge_insert.rs:3533— Merger::execute_batch 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.
RowIdSequence::mask_to_offset_ranges (cyclomatic 28) rust/lance-table/src/rowids.rs:609— RowIdSequence::mask_to_offset_ranges 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.
Builder.build (cyclomatic 27) java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java:447— Builder.build has cyclomatic complexity 27 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LanceDataset._prepare_scalar_index_request (cyclomatic 27) python/python/lance/dataset.py:3491— LanceDataset._prepare_scalar_index_request 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.
DatasetBuilder::load_impl (cyclomatic 26) rust/lance/src/dataset/builder.rs:687— DatasetBuilder::load_impl 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.
BlobPreprocessor::logical_to_prepared_blob_array (cyclomatic 25) rust/lance/src/dataset/blob.rs:1122— BlobPreprocessor::logical_to_prepared_blob_array 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.
PostingIterator::merge_optional_freqs (cyclomatic 25) rust/lance-index/src/scalar/inverted/wand_maxscore.rs:112— PostingIterator::merge_optional_freqs 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.
U64Segment::with_new_high (cyclomatic 25) rust/lance-table/src/rowids/segment.rs:508— U64Segment::with_new_high 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.
types._coerce_reader (cyclomatic 25) python/python/lance/types.py:89— types._coerce_reader has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CompactionOptions::apply_dataset_config (cyclomatic 24) rust/lance/src/dataset/optimize.rs:408— CompactionOptions::apply_dataset_config has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
CommitBuilder::execute_inner (cyclomatic 24) rust/lance/src/dataset/write/commit.rs:320— CommitBuilder::execute_inner has cyclomatic complexity 24 (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.
CompoundQueryExec::execute (cyclomatic 24) rust/lance/src/io/exec/fts.rs:1420— CompoundQueryExec::execute 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.
IndexWorker::process_document (cyclomatic 24) rust/lance-index/src/scalar/inverted/builder.rs:1573— IndexWorker::process_document 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.
FtsTokenizerOptions::apply (cyclomatic 23) python/src/fts.rs:63— FtsTokenizerOptions::apply 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.
FtsIndexExec::materialize_rows_sorted (cyclomatic 23) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:321— FtsIndexExec::materialize_rows_sorted 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.
TakeOperation::try_from_expr (cyclomatic 23) rust/lance/src/dataset/scanner.rs:1337— TakeOperation::try_from_expr 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.
BitmapIndex::search_with_options (cyclomatic 23) rust/lance-index/src/scalar/bitmap.rs:768— BitmapIndex::search_with_options 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.
BTreeLookup::pages_between (cyclomatic 23) rust/lance-index/src/scalar/btree.rs:1059— BTreeLookup::pages_between 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.
CompoundScorerPlan::analyze_node (cyclomatic 23) rust/lance-index/src/scalar/inverted/compound.rs:497— CompoundScorerPlan::analyze_node 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.
dataset.write_dataset (cyclomatic 23) python/python/lance/dataset.py:8037— dataset.write_dataset 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.
ChunkInstructions::schedule_instructions (cyclomatic 22) rust/lance-encoding/src/encodings/logical/primitive.rs:2407— ChunkInstructions::schedule_instructions 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.
LanceDataset.__iter__ (cyclomatic 22) python/python/lance/torch/data.py:369— LanceDataset.__iter__ 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.
ScalarBackend::insert_array_and_report_existing (cyclomatic 21) rust/lance/src/dataset/mem_wal/index/btree.rs:702— ScalarBackend::insert_array_and_report_existing 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.
DefaultCompactionPlanner::plan (cyclomatic 21) rust/lance/src/dataset/optimize.rs:817— DefaultCompactionPlanner::plan 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.
FilteredReadStream::plan_scan (cyclomatic 21) rust/lance/src/io/exec/filtered_read.rs:837— FilteredReadStream::plan_scan 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.
FilteredReadExec::try_new_row_stream (cyclomatic 21) rust/lance/src/io/exec/filtered_read.rs:2194— FilteredReadExec::try_new_row_stream 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.
RepDefUnraveler::unravel_offsets (cyclomatic 21) rust/lance-encoding/src/repdef.rs:1720— RepDefUnraveler::unravel_offsets 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.
RQTransformer::transform (cyclomatic 21) rust/lance-index/src/vector/bq/transform.rs:284— RQTransformer::transform 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.
data._to_tensor (cyclomatic 21) python/python/lance/torch/data.py:114— data._to_tensor 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.
BytesBackend::insert_array_and_report_existing (cyclomatic 20) rust/lance/src/dataset/mem_wal/index/btree.rs:506— BytesBackend::insert_array_and_report_existing 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.
BitpackedPageDecoder::decode (cyclomatic 20) rust/lance-encoding/src/array_encoding/physical/bitpack.rs:377— BitpackedPageDecoder::decode 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.
ArrayFieldEncodingStrategy::validate_v2_0_array_reachability (cyclomatic 20) rust/lance-encoding/src/array_encoding/strategy.rs:291— ArrayFieldEncodingStrategy::validate_v2_0_array_reachability 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.
DataBlock::from_arrays (cyclomatic 20) rust/lance-encoding/src/data.rs:1891— DataBlock::from_arrays 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.
RQPairScorer::stage (cyclomatic 20) rust/lance-index/src/vector/bq/pairwise.rs:137— RQPairScorer::stage has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MemTableBruteForceVectorExec::compute_topk (cyclomatic 19) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:204— MemTableBruteForceVectorExec::compute_topk 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.
SparseStructuralScheduler::validate_value_encoding (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:1425— SparseStructuralScheduler::validate_value_encoding 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.
DecodeSparseStructuralTask::validate_value_buffers (cyclomatic 19) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:3453— DecodeSparseStructuralTask::validate_value_buffers 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.
RepDefBuilder::concat_layers (cyclomatic 19) rust/lance-encoding/src/repdef.rs:1409— RepDefBuilder::concat_layers 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.
ReqOptScorer::position (cyclomatic 19) rust/lance-index/src/scalar/inverted/compound.rs:3156— ReqOptScorer::position 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.
KNNVectorDistanceExec::execute_batch (cyclomatic 18) rust/lance/src/io/exec/knn.rs:798— KNNVectorDistanceExec::execute_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.
lance_core::utils::cpu::detect_host_features (cyclomatic 18) rust/lance-core/src/utils/cpu.rs:99— lance_core::utils::cpu::detect_host_features 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.
HnswBuilder::connect_stranded_nodes (cyclomatic 18) rust/lance-index/src/vector/hnsw/builder.rs:940— HnswBuilder::connect_stranded_nodes 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.
GooseFsStoreProvider::parse_decimal_times_unit (cyclomatic 18) rust/lance-io/src/object_store/providers/goosefs.rs:294— GooseFsStoreProvider::parse_decimal_times_unit 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.
ManifestNamespace::create_table (cyclomatic 18) rust/lance-namespace-impls/src/dir/manifest.rs:2950— ManifestNamespace::create_table 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.
udf.normalize_transform (cyclomatic 18) REDACTED:185— udf.normalize_transform 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.
FixedIntBackend::insert_array_and_report_existing (cyclomatic 17) rust/lance/src/dataset/mem_wal/index/btree.rs:323— FixedIntBackend::insert_array_and_report_existing 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.
Partition::maxscore_loop (cyclomatic 17) rust/lance/src/dataset/mem_wal/index/fts.rs:4565— Partition::maxscore_loop 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.
IndexStore::insert_batches (cyclomatic 17) rust/lance/src/dataset/mem_wal/index.rs:1008— IndexStore::insert_batches has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
LsmPointLookupPlanner::lookup_many (cyclomatic 17) rust/lance/src/dataset/mem_wal/scanner/point_lookup.rs:490— LsmPointLookupPlanner::lookup_many has cyclomatic complexity 17 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
UpdateJob::execute_impl (cyclomatic 17) rust/lance/src/dataset/write/update.rs:322— UpdateJob::execute_impl 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.
TakeStream::map_batch (cyclomatic 17) rust/lance/src/io/exec/take.rs:243— TakeStream::map_batch 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.
CoreFieldDecoderStrategy::create_array_field_scheduler (cyclomatic 17) rust/lance-encoding/src/decoder.rs:987— CoreFieldDecoderStrategy::create_array_field_scheduler 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.
SargableQuery::to_expr (cyclomatic 17) rust/lance-index/src/scalar.rs:273— SargableQuery::to_expr 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.
FlatIndex::search_with_scratch (cyclomatic 17) rust/lance-index/src/vector/flat/index.rs:141— FlatIndex::search_with_scratch 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.
lance_linalg::distance::multivec_distance (cyclomatic 17) rust/lance-linalg/src/distance.rs:468— lance_linalg::distance::multivec_distance 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.
MemTableScanner::collect_or_equalities (cyclomatic 16) rust/lance/src/dataset/mem_wal/memtable/scanner/builder.rs:1375— MemTableScanner::collect_or_equalities has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MemTableDedupScanExec::execute (cyclomatic 16) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:175— MemTableDedupScanExec::execute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MemTableScanExec::execute (cyclomatic 16) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:213— MemTableScanExec::execute has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
CoalesceFirstStream::poll_next (cyclomatic 16) rust/lance/src/dataset/mem_wal/scanner/exec/coalesce_first.rs:204— CoalesceFirstStream::poll_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.
LsmScanPlanner::plan_scan (cyclomatic 16) rust/lance/src/dataset/mem_wal/scanner/planner.rs:130— LsmScanPlanner::plan_scan 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.
IndexDescriptionImpl::try_new (cyclomatic 16) rust/lance/src/index.rs:1578— IndexDescriptionImpl::try_new 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.
LanceStream::try_new_v2 (cyclomatic 16) rust/lance/src/io/exec/scan.rs:179— LanceStream::try_new_v2 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.
AimdConfig::validate (cyclomatic 16) rust/lance-core/src/utils/aimd.rs:103— AimdConfig::validate has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SharedStream::poll_next (cyclomatic 16) rust/lance-core/src/utils/futures.rs:81— SharedStream::poll_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.
BTreeIndex::search_with_options (cyclomatic 16) rust/lance-index/src/scalar/btree.rs:2495— BTreeIndex::search_with_options 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: BTreeLookup::candidate_pages_for_values (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.
ShouldMaxScoreScorer::ensure_confirmed (cyclomatic 16) rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs:345— ShouldMaxScoreScorer::ensure_confirmed 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.
JsonIndexPlugin::convert_batch_by_type (cyclomatic 16) rust/lance-index/src/scalar/json.rs:680— JsonIndexPlugin::convert_batch_by_type 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.
HNSW::flat_search (cyclomatic 16) rust/lance-index/src/vector/hnsw/builder.rs:621— HNSW::flat_search 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.
WriteDatasetBuilder.execute (cyclomatic 16) java/src/main/java/org/lance/WriteDatasetBuilder.java:388— WriteDatasetBuilder.execute 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.
lance.dataset (cyclomatic 16) python/python/lance/__init__.py:137— lance.dataset 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.
pydantic.is_nullable (cyclomatic 16) python/python/lance/pydantic.py:344— pydantic.is_nullable has cyclomatic complexity 16 (threshold 15). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
OrderableScalarValue::cmp (cognitive 144) rust/lance-index/src/scalar/btree.rs:139— OrderableScalarValue::cmp has cognitive complexity 144 (threshold 15). Drivers by points: if/else 90 (135 pts), match/switch 4 (5 pts), boolean chains 4 (nesting depth added 46). 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.
LanceDataset._create_index_impl (cognitive 133) python/python/lance/dataset.py:3924— LanceDataset._create_index_impl has cognitive complexity 133 (threshold 15). Drivers by points: if/else 55 (111 pts), boolean chains 20, error handling 1, loops 1 (nesting depth added 56). 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.
ZoneMapIndex::evaluate_zone_against_query (cognitive 125) rust/lance-index/src/scalar/zonemap.rs:241— ZoneMapIndex::evaluate_zone_against_query has cognitive complexity 125 (threshold 15). Drivers by points: if/else 35 (82 pts), match/switch 14 (34 pts), boolean chains 9 (nesting depth added 67). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DecodeMiniBlockTask::map_range (cognitive 124) rust/lance-encoding/src/encodings/logical/primitive.rs:495— DecodeMiniBlockTask::map_range has cognitive complexity 124 (threshold 15). Drivers by points: if/else 31 (103 pts), loops 5 (19 pts), match/switch 1 (2 pts) (nesting depth added 87). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
RowIdSequence::mask_to_offset_ranges (cognitive 78) rust/lance-table/src/rowids.rs:609— RowIdSequence::mask_to_offset_ranges has cognitive complexity 78 (threshold 15). Drivers by points: if/else 14 (48 pts), loops 8 (23 pts), match/switch 2 (6 pts), boolean chains 1 (nesting depth added 53). 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.
Merger::execute_batch (cognitive 71) rust/lance/src/dataset/write/merge_insert.rs:3533— Merger::execute_batch has cognitive complexity 71 (threshold 15). Drivers by points: if/else 22 (51 pts), match/switch 6 (12 pts), loops 3 (8 pts) (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.
ReqOptScorer::position (cognitive 66) rust/lance-index/src/scalar/inverted/compound.rs:3156— ReqOptScorer::position has cognitive complexity 66 (threshold 15). Drivers by points: if/else 15 (60 pts), loops 2 (5 pts), boolean chains 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.
PQDistCalculator::accumulate_topk_with_scratch (cognitive 66) rust/lance-index/src/vector/pq/storage.rs:982— PQDistCalculator::accumulate_topk_with_scratch has cognitive complexity 66 (threshold 15). Drivers by points: if/else 24 (42 pts), loops 5 (11 pts), boolean chains 9, match/switch 1 (4 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PackedStructVariablePerValueDecompressor::decompress (cognitive 61) rust/lance-encoding/src/encodings/physical/packed.rs:607— PackedStructVariablePerValueDecompressor::decompress has cognitive complexity 61 (threshold 15). Drivers by points: if/else 13 (41 pts), match/switch 5 (11 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BitpackedPageDecoder::decode (cognitive 56) rust/lance-encoding/src/array_encoding/physical/bitpack.rs:377— BitpackedPageDecoder::decode has cognitive complexity 56 (threshold 15). Drivers by points: if/else 9 (35 pts), loops 5 (15 pts), boolean chains 4, match/switch 1 (2 pts) (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlobPreprocessor::logical_to_prepared_blob_array (cognitive 53) rust/lance/src/dataset/blob.rs:1122— BlobPreprocessor::logical_to_prepared_blob_array has cognitive complexity 53 (threshold 15). Drivers by points: if/else 24 (47 pts), boolean chains 5, 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.
KNNVectorDistanceExec::execute_batch (cognitive 52) rust/lance/src/io/exec/knn.rs:798— KNNVectorDistanceExec::execute_batch has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (43 pts), loops 4 (7 pts), boolean chains 2 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ChunkInstructions::schedule_instructions (cognitive 52) rust/lance-encoding/src/encodings/logical/primitive.rs:2407— ChunkInstructions::schedule_instructions has cognitive complexity 52 (threshold 15). Drivers by points: if/else 15 (40 pts), boolean chains 7, loops 3 (5 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.
Planner::parse_sql_expr (cognitive 47) rust/lance-datafusion/src/planner.rs:683— Planner::parse_sql_expr has cognitive complexity 47 (threshold 15). Drivers by points: if/else 12 (27 pts), match/switch 6 (13 pts), loops 3 (7 pts) (nesting depth added 26). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
CompoundScorerPlan::analyze_node (cognitive 44) rust/lance-index/src/scalar/inverted/compound.rs:497— CompoundScorerPlan::analyze_node has cognitive complexity 44 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 7 (17 pts), boolean chains 2, match/switch 1 (nesting depth added 23). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SequenceCursor::fill (cognitive 41) rust/lance/src/dataset/delta.rs:820— SequenceCursor::fill has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (32 pts), loops 3 (7 pts), match/switch 1 (2 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.
LanceDataset._prepare_scalar_index_request (cognitive 41) python/python/lance/dataset.py:3491— LanceDataset._prepare_scalar_index_request has cognitive complexity 41 (threshold 15). Drivers by points: if/else 16 (34 pts), boolean chains 7 (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.
FlatIndex::search_with_scratch (cognitive 39) rust/lance-index/src/vector/flat/index.rs:141— FlatIndex::search_with_scratch has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (12 pts), boolean chains 4, match/switch 1 (nesting depth added 22). 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.
TakeOperation::try_from_expr (cognitive 38) rust/lance/src/dataset/scanner.rs:1337— TakeOperation::try_from_expr has cognitive complexity 38 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 4 (13 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommitBuilder::execute_inner (cognitive 38) rust/lance/src/dataset/write/commit.rs:320— CommitBuilder::execute_inner has cognitive complexity 38 (threshold 15). Drivers by points: if/else 23 (30 pts), match/switch 5 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
IndexWorker::process_document (cognitive 38) rust/lance-index/src/scalar/inverted/builder.rs:1573— IndexWorker::process_document has cognitive complexity 38 (threshold 15). Drivers by points: if/else 15 (23 pts), loops 4 (8 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LanceDataset.__iter__ (cognitive 38) python/python/lance/torch/data.py:369— LanceDataset.__iter__ has cognitive complexity 38 (threshold 15). Drivers by points: if/else 19 (29 pts), loops 3 (7 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CompoundQueryExec::execute (cognitive 37) rust/lance/src/io/exec/fts.rs:1420— CompoundQueryExec::execute has cognitive complexity 37 (threshold 15). Drivers by points: if/else 15 (20 pts), match/switch 5 (12 pts), boolean chains 5 (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.
FtsIndexExec::materialize_rows_sorted (cognitive 36) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:321— FtsIndexExec::materialize_rows_sorted has cognitive complexity 36 (threshold 15). Drivers by points: if/else 16 (23 pts), loops 5 (9 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LazyLevels::seek_row_start (cognitive 36) rust/lance-encoding/src/encodings/logical/primitive.rs:1412— LazyLevels::seek_row_start has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 4 (11 pts), boolean chains 2, match/switch 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FixedFullZipDecodeTask::decode (cognitive 35) rust/lance-encoding/src/encodings/logical/primitive.rs:4073— FixedFullZipDecodeTask::decode has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (28 pts), loops 3 (7 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.
BitmapIndex::search_with_options (cognitive 35) rust/lance-index/src/scalar/bitmap.rs:768— BitmapIndex::search_with_options has cognitive complexity 35 (threshold 15). Drivers by points: if/else 17 (26 pts), match/switch 4 (7 pts), boolean chains 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ZoneTrainer::train (cognitive 34) rust/lance-index/src/scalar/zoned.rs:92— ZoneTrainer::train has cognitive complexity 34 (threshold 15). Drivers by points: if/else 9 (24 pts), loops 3 (7 pts), match/switch 1 (3 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileScheduler::submit_request (cognitive 34) rust/lance-io/src/scheduler.rs:1196— FileScheduler::submit_request has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (22 pts), loops 5 (11 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.
BytesBackend::insert_array_and_report_existing (cognitive 32) rust/lance/src/dataset/mem_wal/index/btree.rs:506— BytesBackend::insert_array_and_report_existing has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (24 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemTableScanExec::execute (cognitive 32) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/scan.rs:213— MemTableScanExec::execute has cognitive complexity 32 (threshold 15). Drivers by points: if/else 13 (19 pts), match/switch 4 (9 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaskDispatcher::run (cognitive 32) rust/lance/src/dataset/mem_wal/write.rs:448— TaskDispatcher::run has cognitive complexity 32 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 4 (14 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.
CoreFieldDecoderStrategy::create_array_field_scheduler (cognitive 32) rust/lance-encoding/src/decoder.rs:987— CoreFieldDecoderStrategy::create_array_field_scheduler has cognitive complexity 32 (threshold 15). Drivers by points: if/else 16 (27 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepDefUnraveler::unravel_offsets (cognitive 32) rust/lance-encoding/src/repdef.rs:1720— RepDefUnraveler::unravel_offsets has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 3 (5 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HnswBuilder::connect_stranded_nodes (cognitive 32) rust/lance-index/src/vector/hnsw/builder.rs:940— HnswBuilder::connect_stranded_nodes has cognitive complexity 32 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 8 (12 pts), match/switch 1 (3 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dataset._build_vector_search_query (cognitive 32) python/python/lance/dataset.py:8430— dataset._build_vector_search_query has cognitive complexity 32 (threshold 15). Drivers by points: if/else 20 (22 pts), boolean chains 10 (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.
SymbolTable::finalize (cognitive 31) rust/compression/fsst/src/fsst.rs:424— SymbolTable::finalize has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 6 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemTableDedupScanExec::execute (cognitive 31) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/dedup_scan.rs:175— MemTableDedupScanExec::execute has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 3 (8 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RabitQuantizationStorage::raw_query_factors (cognitive 31) rust/lance-index/src/vector/bq/storage.rs:530— RabitQuantizationStorage::raw_query_factors has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (20 pts), loops 2 (9 pts), boolean chains 1, match/switch 1 (nesting depth added 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
CoalesceFirstStream::poll_next (cognitive 30) rust/lance/src/dataset/mem_wal/scanner/exec/coalesce_first.rs:204— CoalesceFirstStream::poll_next has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 3 (7 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.
LanceStream::try_new_v2 (cognitive 30) rust/lance/src/io/exec/scan.rs:179— LanceStream::try_new_v2 has cognitive complexity 30 (threshold 15). Drivers by points: if/else 20 (27 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
udf.normalize_transform (cognitive 30) REDACTED:185— udf.normalize_transform has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (20 pts), error handling 2 (4 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DefaultCompactionPlanner::plan (cognitive 29) rust/lance/src/dataset/optimize.rs:817— DefaultCompactionPlanner::plan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 4, 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.
DatasetPreFilter::create_deletion_mask_impl (cognitive 29) rust/lance/src/index/prefilter.rs:314— DatasetPreFilter::create_deletion_mask_impl has cognitive complexity 29 (threshold 15). Drivers by points: if/else 13 (18 pts), loops 3 (6 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
dataset.write_dataset (cognitive 29) python/python/lance/dataset.py:8037— dataset.write_dataset has cognitive complexity 29 (threshold 15). Drivers by points: if/else 17 (25 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.
TakeStream::map_batch (cognitive 28) rust/lance/src/io/exec/take.rs:243— TakeStream::map_batch has cognitive complexity 28 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SharedStream::poll_next (cognitive 28) rust/lance-core/src/utils/futures.rs:81— SharedStream::poll_next has cognitive complexity 28 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 5 (8 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FragReuseLedger::decode_content (cognitive 28) rust/lance-table/src/system_index/frag_reuse/ledger.rs:173— FragReuseLedger::decode_content has cognitive complexity 28 (threshold 15). Drivers by points: if/else 6 (19 pts), loops 3 (7 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.
AddRowAddrExec::compute_row_addrs (cognitive 27) rust/lance/src/io/exec/rowids.rs:127— AddRowAddrExec::compute_row_addrs has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 2 (6 pts) (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.
LanceEncodingsIo::submit_request (cognitive 27) rust/lance-file/src/io.rs:51— LanceEncodingsIo::submit_request has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (19 pts), loops 5 (8 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StablePartitionMapping::remap_row_ids (cognitive 27) rust/lance-index/src/frag_reuse/stable_partition.rs:114— StablePartitionMapping::remap_row_ids has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (18 pts), loops 5 (8 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RawInvertedIndexParams::resolve (cognitive 27) rust/lance-index/src/scalar/inverted/tokenizer.rs:288— RawInvertedIndexParams::resolve has cognitive complexity 27 (threshold 15). Drivers by points: if/else 22, boolean chains 3, 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.
JsonIndexPlugin::convert_batch_by_type (cognitive 27) rust/lance-index/src/scalar/json.rs:680— JsonIndexPlugin::convert_batch_by_type has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 4 (8 pts), boolean chains 2, match/switch 1 (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RQPairScorer::stage (cognitive 27) rust/lance-index/src/vector/bq/pairwise.rs:137— RQPairScorer::stage has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (18 pts), loops 3 (6 pts), match/switch 3 (nesting depth added 7). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PyLance::into_pyobject (cognitive 26) python/src/transaction.rs:659— PyLance::into_pyobject has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 3 (6 pts), loops 1 (4 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.
IndexDescriptionImpl::try_new (cognitive 26) rust/lance/src/index.rs:1578— IndexDescriptionImpl::try_new has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (22 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.
FixedFullZipDecoder::slice_next_task (cognitive 26) rust/lance-encoding/src/encodings/logical/primitive.rs:3535— FixedFullZipDecoder::slice_next_task has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 1 (2 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BTreeLookup::pages_between (cognitive 26) rust/lance-index/src/scalar/btree.rs:1059— BTreeLookup::pages_between has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 7 (10 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.
Builder.build (cognitive 26) java/src/main/java/org/lance/index/scalar/InvertedIndexParams.java:447— Builder.build has cognitive complexity 26 (threshold 15). Drivers by points: if/else 22, boolean chains 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.
pydantic.is_nullable (cognitive 26) python/python/lance/pydantic.py:344— pydantic.is_nullable has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (18 pts), error handling 2 (5 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
BackgroundExecutor::block_on_pumping (cognitive 25) python/src/executor.rs:191— BackgroundExecutor::block_on_pumping has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (14 pts), match/switch 4 (10 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.
DatasetIndexRemapper::remap_indices (cognitive 24) rust/lance/src/dataset/index.rs:81— DatasetIndexRemapper::remap_indices has cognitive complexity 24 (threshold 15). Drivers by points: if/else 4 (13 pts), match/switch 3 (9 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.
HnswGraph::visit_published_neighbors (cognitive 24) rust/lance/src/dataset/mem_wal/hnsw/graph.rs:980— HnswGraph::visit_published_neighbors has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 4 (10 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MergeState::process_row_action (cognitive 24) rust/lance/src/dataset/write/merge_insert/exec/write.rs:100— MergeState::process_row_action has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 3 (6 pts), boolean chains 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BlobV2StructuralEncoder::maybe_encode (cognitive 24) rust/lance-encoding/src/encodings/logical/blob.rs:256— BlobV2StructuralEncoder::maybe_encode has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
IndexStore::insert_batches (cognitive 23) rust/lance/src/dataset/mem_wal/index.rs:1008— IndexStore::insert_batches has cognitive complexity 23 (threshold 15). Drivers by points: loops 7 (9 pts), if/else 6 (8 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepDefBuilder::concat_layers (cognitive 23) rust/lance-encoding/src/repdef.rs:1409— RepDefBuilder::concat_layers has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 4 (7 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.
ProductQuantizer::transform_impl (cognitive 23) rust/lance-index/src/vector/pq.rs:160— ProductQuantizer::transform_impl has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (12 pts), loops 3 (10 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpdateConfig.<init> (cognitive 23) java/src/main/java/org/lance/operation/UpdateConfig.java:105— UpdateConfig.<init> has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (5 pts), boolean chains 4, ternaries 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.
lance.dataset (cognitive 23) python/python/lance/__init__.py:137— lance.dataset has cognitive complexity 23 (threshold 15). Drivers by points: if/else 12 (19 pts), boolean chains 4 (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.
TileJobs::next_job (cognitive 22) rust/lance/src/index/vector/dedup.rs:497— TileJobs::next_job has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 2 (4 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.
BooleanQueryExec::execute (cognitive 22) rust/lance/src/io/exec/fts.rs:5705— BooleanQueryExec::execute has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 7 (11 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.
ArrayFieldEncodingStrategy::validate_v2_0_array_reachability (cognitive 22) rust/lance-encoding/src/array_encoding/strategy.rs:291— ArrayFieldEncodingStrategy::validate_v2_0_array_reachability has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 2 (4 pts), boolean chains 3, 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.
IvfShuffler::shuffle_to_partitions (cognitive 22) rust/lance-index/src/vector/ivf/shuffler.rs:626— IvfShuffler::shuffle_to_partitions has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 3 (6 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GooseFsStoreProvider::parse_decimal_times_unit (cognitive 22) rust/lance-io/src/object_store/providers/goosefs.rs:294— GooseFsStoreProvider::parse_decimal_times_unit has cognitive complexity 22 (threshold 15). Drivers by points: if/else 17 (18 pts), match/switch 2 (3 pts), boolean chains 1 (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.
lance_linalg::distance::multivec_distance (cognitive 22) rust/lance-linalg/src/distance.rs:468— lance_linalg::distance::multivec_distance has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 7 (9 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WriteDatasetBuilder.executeWithNamespaceClient (cognitive 22) java/src/main/java/org/lance/WriteDatasetBuilder.java:440— WriteDatasetBuilder.executeWithNamespaceClient has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (13 pts), boolean chains 5, ternaries 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.
data._to_tensor (cognitive 22) python/python/lance/torch/data.py:114— data._to_tensor has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 8, loops 1, ternaries 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MemTableFlushHandler::flush_memtable (cognitive 21) rust/lance/src/dataset/mem_wal/write.rs:4283— MemTableFlushHandler::flush_memtable has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (14 pts), loops 1 (3 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.
FullSchemaMergeInsertExec::split_updates_and_inserts (cognitive 21) rust/lance/src/dataset/write/merge_insert/exec/write.rs:622— FullSchemaMergeInsertExec::split_updates_and_inserts has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (5 pts), boolean chains 2, 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.
Schema::do_project (cognitive 21) rust/lance-core/src/datatypes/schema.rs:259— Schema::do_project has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (20 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.
StrictBatchSizeStream::poll_next (cognitive 21) rust/lance-datafusion/src/chunker.rs:511— StrictBatchSizeStream::poll_next has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (18 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.
VariableFullZipDecoder::unzip (cognitive 21) rust/lance-encoding/src/encodings/logical/primitive.rs:3864— VariableFullZipDecoder::unzip has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (7 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FtsTokenizerOptions::apply (cognitive 20) python/src/fts.rs:63— FtsTokenizerOptions::apply has cognitive complexity 20 (threshold 15). Drivers by points: if/else 17, match/switch 2, 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.
StatisticsAccumulator::update_item (cognitive 20) rust/arrow-stats/src/lib.rs:195— StatisticsAccumulator::update_item has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VariablePackedFieldData::append_row_bytes (cognitive 20) rust/lance-encoding/src/encodings/physical/packed.rs:232— VariablePackedFieldData::append_row_bytes has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 2 (3 pts), boolean chains 1 (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.
BloomFilterIndex::evaluate_block_against_query (cognitive 20) rust/lance-index/src/scalar/bloomfilter.rs:305— BloomFilterIndex::evaluate_block_against_query has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 3 (6 pts), loops 1 (2 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.
PostingListGroup::new_packed_with_block_size (cognitive 20) rust/lance-index/src/scalar/inverted/index/cache.rs:382— PostingListGroup::new_packed_with_block_size has cognitive complexity 20 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 1 (2 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScannerBuilder.filter (cognitive 20) python/python/lance/dataset.py:6969— ScannerBuilder.filter has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), error handling 2 (5 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.
dataset._coerce_query_vector (cognitive 20) python/python/lance/dataset.py:8379— dataset._coerce_query_vector has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3, error handling 1 (2 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.
sampler._filtered_efficient_sample (cognitive 20) python/python/lance/sampler.py:119— sampler._filtered_efficient_sample has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (18 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.
types._coerce_reader (cognitive 20) python/python/lance/types.py:89— types._coerce_reader has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 4 (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.
DatasetDelta::resolve_range (cognitive 19) rust/lance/src/dataset/delta.rs:254— DatasetDelta::resolve_range has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorIndexExec::materialize_rows (cognitive 19) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:194— VectorIndexExec::materialize_rows has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 4 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UpdateJob::execute_impl (cognitive 19) rust/lance/src/dataset/write/update.rs:322— UpdateJob::execute_impl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (15 pts), boolean chains 2, match/switch 2 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
WeightedCoreset::reduce_to_budget (cognitive 19) rust/lance/src/index/vector/ivf.rs:3937— WeightedCoreset::reduce_to_budget has cognitive complexity 19 (threshold 15). Drivers by points: loops 7 (13 pts), if/else 4 (6 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.
FlatCombinedFieldsExec::execute (cognitive 19) rust/lance/src/io/exec/fts.rs:4643— FlatCombinedFieldsExec::execute has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 5, 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.
BatchReaderChunker::next_sized (cognitive 19) rust/lance-datafusion/src/chunker.rs:60— BatchReaderChunker::next_sized has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (17 pts), loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SparseStructuralScheduler::validate_value_encoding (cognitive 19) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:1425— SparseStructuralScheduler::validate_value_encoding has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (18 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.
ScalarIndexExpr::optimize_and_leaves (cognitive 19) rust/lance-index/src/scalar/expression.rs:1720— ScalarIndexExpr::optimize_and_leaves has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (3 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.
BooleanScorer::try_new (cognitive 19) rust/lance-index/src/scalar/inverted/compound.rs:3420— BooleanScorer::try_new has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4 (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.
RTreeIndexPlugin::write_index (cognitive 19) rust/lance-index/src/scalar/rtree.rs:1074— RTreeIndexPlugin::write_index has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (10 pts), if/else 4 (9 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.
RQTransformer::transform (cognitive 19) rust/lance-index/src/vector/bq/transform.rs:284— RQTransformer::transform has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (9 pts), boolean chains 5, match/switch 4 (5 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.
OnlineHnswBuilder::insert_with_generator (cognitive 19) rust/lance-index/src/vector/hnsw/online.rs:238— OnlineHnswBuilder::insert_with_generator has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 6 (9 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.
RowAddrTreeMap::from (cognitive 19) rust/lance-table/src/rowids.rs:866— RowAddrTreeMap::from has cognitive complexity 19 (threshold 15). Drivers by points: loops 5 (13 pts), if/else 1 (4 pts), match/switch 1 (2 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.
new_contributors.resolve_usernames_via_api (cognitive 19) ci/new_contributors.py:105— new_contributors.resolve_usernames_via_api 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
new_contributors.main (cognitive 19) ci/new_contributors.py:183— new_contributors.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 6 (7 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PQIndex::search (cognitive 18) rust/lance/src/index/vector/pq.rs:260— PQIndex::search has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 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.
BlobPageScheduler::schedule_ranges (cognitive 18) rust/lance-encoding/src/encodings/logical/primitive/blob.rs:363— BlobPageScheduler::schedule_ranges has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (15 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.
HuffmanWaveletTree::build (cognitive 18) rust/lance-index/src/scalar/fmindex.rs:267— HuffmanWaveletTree::build has cognitive complexity 18 (threshold 15). Drivers by points: loops 8 (10 pts), if/else 4 (7 pts), match/switch 1 (nesting depth added 5). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
NGramIndexBuilder::merge_spill_streams (cognitive 18) rust/lance-index/src/scalar/ngram.rs:1450— NGramIndexBuilder::merge_spill_streams has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 3 (7 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.
KMeans::train_kmeans (cognitive 18) rust/lance-index/src/vector/kmeans.rs:1032— KMeans::train_kmeans has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadBatchParams::slice (cognitive 18) rust/lance-io/src/lib.rs:156— ReadBatchParams::slice has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), 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.
ObjectStore::copy_via_stream (cognitive 18) rust/lance-io/src/object_store.rs:1245— ObjectStore::copy_via_stream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (15 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.
BitmapSlice::count_ones (cognitive 18) rust/lance-table/src/rowids/bitmap.rs:127— BitmapSlice::count_ones has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 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.
HoleRuns::from_bitmap (cognitive 18) rust/lance-table/src/rowids/runs.rs:87— HoleRuns::from_bitmap has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 2 (4 pts), match/switch 1 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WalAppender::append (cognitive 17) rust/lance/src/dataset/mem_wal/wal.rs:1215— WalAppender::append has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeleteOnlyMergeInsertExec::collect_deletions (cognitive 17) rust/lance/src/dataset/write/merge_insert/exec/delete.rs:110— DeleteOnlyMergeInsertExec::collect_deletions has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 1 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AddRowOffsetExec::compute_row_offsets (cognitive 17) rust/lance/src/io/exec/rowids.rs:440— AddRowOffsetExec::compute_row_offsets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SparseStructuralUnraveler::unravel_offsets (cognitive 17) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:931— SparseStructuralUnraveler::unravel_offsets has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (16 pts), 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.
DecodeSparseStructuralTask::validate_value_buffers (cognitive 17) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:3453— DecodeSparseStructuralTask::validate_value_buffers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 5 (7 pts) (nesting depth added 7). 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.
BTreeIndex::search_with_options (cognitive 17) rust/lance-index/src/scalar/btree.rs:2495— BTreeIndex::search_with_options has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 4 (6 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
InvertedIndex::expand_fuzzy_tokens (cognitive 17) rust/lance-index/src/scalar/inverted/index/search.rs:394— InvertedIndex::expand_fuzzy_tokens has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (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.
AimdMultipartUploadService::call (cognitive 17) rust/lance-io/src/object_store/throttle.rs:714— AimdMultipartUploadService::call has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 4, match/switch 1 (3 pts), 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.
WriteDatasetBuilder.execute (cognitive 17) java/src/main/java/org/lance/WriteDatasetBuilder.java:388— WriteDatasetBuilder.execute has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (13 pts), boolean chains 4 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
LanceDataset.scanner (cognitive 17) python/python/lance/dataset.py:1221— LanceDataset.scanner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pydantic._pydantic_type_to_arrow_type (cognitive 17) python/python/lance/pydantic.py:270— pydantic._pydantic_type_to_arrow_type has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (17 pts) (nesting depth added 10). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
lance_arrow_stats::find_min_max_indices (cognitive 16) rust/arrow-stats/src/lib.rs:429— lance_arrow_stats::find_min_max_indices has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 4, loops 1 (2 pts), match/switch 1 (nesting depth added 7). 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.
ShardManifestStore::find_latest_version (cognitive 16) rust/lance/src/dataset/mem_wal/manifest.rs:310— ShardManifestStore::find_latest_version has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 3 (5 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalBackpressureController::maybe_apply_backpressure (cognitive 16) rust/lance/src/dataset/mem_wal/write.rs:1157— LocalBackpressureController::maybe_apply_backpressure has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 2 (5 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.
AimdConfig::validate (cognitive 16) rust/lance-core/src/utils/aimd.rs:103— AimdConfig::validate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (12 pts), boolean chains 3, loops 1 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CycleNanGenerator::generate (cognitive 16) rust/lance-datagen/src/generator.rs:129— CycleNanGenerator::generate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 3 (6 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.
NullGenerator::generate (cognitive 16) rust/lance-datagen/src/generator.rs:299— NullGenerator::generate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlobDescriptionDecodePageTask::decode (cognitive 16) rust/lance-encoding/src/encodings/logical/primitive/blob.rs:152— BlobDescriptionDecodePageTask::decode has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (14 pts), boolean chains 1, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
SparsePositionSet::validate_domain (cognitive 16) rust/lance-encoding/src/encodings/logical/primitive/sparse.rs:320— SparsePositionSet::validate_domain has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 1 (2 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.
StructuralPrimitiveFieldDecoder::plan_decoded_bytes (cognitive 16) rust/lance-encoding/src/encodings/logical/primitive.rs:5321— StructuralPrimitiveFieldDecoder::plan_decoded_bytes 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.
ByteStreamSplitEncoder::compress (cognitive 16) rust/lance-encoding/src/encodings/physical/byte_stream_split.rs:110— ByteStreamSplitEncoder::compress has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (9 pts), if/else 3 (6 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.
PostingListBatchBuilder::append (cognitive 16) rust/lance-index/src/scalar/inverted/index/posting_batch_builder.rs:79— PostingListBatchBuilder::append has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (10 pts), if/else 3 (5 pts), match/switch 1 (nesting depth added 7). 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.
PostingListReader::posting_read_chunk_ranges (cognitive 16) rust/lance-index/src/scalar/inverted/index/posting_prewarm.rs:625— PostingListReader::posting_read_chunk_ranges has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ProductQuantizationStorage::new_with_remapper (cognitive 16) rust/lance-index/src/vector/pq/storage.rs:234— ProductQuantizationStorage::new_with_remapper has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (13 pts), loops 1 (2 pts), match/switch 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ObjectWriter::poll_tasks (cognitive 16) rust/lance-io/src/object_writer.rs:351— ObjectWriter::poll_tasks has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (12 pts), loops 2 (4 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.
lance_namespace_impls::dir::build_engine_fts_query (cognitive 16) rust/lance-namespace-impls/src/dir.rs:6081— lance_namespace_impls::dir::build_engine_fts_query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (6 pts) (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Operation::modifies_same_metadata (cognitive 16) rust/lance-table/src/transaction/conflicts.rs:919— Operation::modifies_same_metadata has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 1 (3 pts), boolean chains 2, match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
fragment.write_fragments (cognitive 16) python/python/lance/fragment.py:1223— fragment.write_fragments has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, ternaries 1 (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pydantic._unwrap_optional_annotation (cognitive 16) python/python/lance/pydantic.py:312— pydantic._unwrap_optional_annotation has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), boolean chains 3 (nesting depth added 7). This file's own header attributes it to another copyright holder, so it is code this repository carries rather than code it wrote: restructuring the body in place forks it from upstream and turns every future re-sync into a manual merge. The performable moves are to leave the body as close to its upstream form as possible and keep it behind a narrow interface of your own, and to re-sync it when upstream changes — or, if it has already diverged far enough that you maintain it here, adopt it deliberately and then split the body into named stages.
D22 · Internal API Consistency· Redundant methods with identical signatures and likely identical implementation logic. The distinction between `_size` and `_size_bytes` is semantically unclear for `usize` types, suggesting copy-paste errors or legacy remnants. · ×1
Redundant methods with identical signatures and likely identical implementation logic. The distinction between `_size` and `_size_bytes` is semantically unclear for `usize` types, suggesting copy-paste errors or legacy remnants. — Remove the `_size` variants and keep only `_size_bytes` (or vice versa, but `_bytes` is more explicit for memory sizes). Ensure the remaining method name is consistent across both index and metadata caches. (signatures: DatasetBuilder.with_index_cache_size_bytes(cache_size: usize) | DatasetBuilder.with_index_cache_size(cache_size: usize) | DatasetBuilder.with_metadata_cache_size_bytes(cache_size: usize) | DatasetBuilder.with_metadata_cache_size(cache_size: usize))
D22 · Internal API Consistency· Ambiguous distinction between `update_columns` and `update_columns_with_offsets`. Without documentation, it is unclear if the latter is a performance optimization, a different join strategy, or a bug-prone variant. They appear to do the same high-level operation (updating columns via join) but with a signature difference that isn't self-explanatory. · ×1
Ambiguous distinction between `update_columns` and `update_columns_with_offsets`. Without documentation, it is unclear if the latter is a performance optimization, a different join strategy, or a bug-prone variant. They appear to do the same high-level operation (updating columns via join) but with a signature difference that isn't self-explanatory. — Rename `update_columns_with_offsets` to `update_columns_with_row_offsets` if it specifically handles row offsets, or merge them if the offset handling is internal. If they are distinct operations, ensure the naming clearly reflects the difference (e.g., `update_columns_standard` vs `update_columns_offset_based`). (signatures: FileFragment.update_columns(right_stream: ..., left_on: ..., right_on: ...) | FileFragment.update_columns_with_offsets(right_stream: ..., left_on: ..., right_on: ...))
D22 · Internal API Consistency· Inconsistent constructor naming pattern. While `new_inline`, `new_dedicated`, and `new_packed` follow a pattern, `new_external` breaks the pattern slightly by using a different semantic category (storage location vs storage format). More importantly, `BlobDescriptorArrayBuilder` uses `push_external` and `push_inline`/`push_dedicated`/`push_packed`, creating a naming mismatch between the builder and the file constructor for the 'external' case. · ×1
Inconsistent constructor naming pattern. While `new_inline`, `new_dedicated`, and `new_packed` follow a pattern, `new_external` breaks the pattern slightly by using a different semantic category (storage location vs storage format). More importantly, `BlobDescriptorArrayBuilder` uses `push_external` and `push_inline`/`push_dedicated`/`push_packed`, creating a naming mismatch between the builder and the file constructor for the 'external' case. — Align the naming. If `BlobDescriptorArrayBuilder` uses `push_external`, `BlobFile` should arguably use `new_external` (which it does), but ensure the semantic grouping is clear. Consider if `new_external` should be `new_remote` or similar to match `inline/dedicated/packed` as storage *types* rather than locations, or rename the builder methods to match the file constructors exactly. (signatures: BlobFile.new_inline(...) | BlobFile.new_dedicated(...) | BlobFile.new_packed(...) | BlobFile.new_external(...))
TooManyFields: Scanner rust/lance/src/dataset/scanner.rs:1104— TooManyFields — 38 stored fields beside 161 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.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×1
D4 · Code Duplication· Near-duplicate member family (4 members, 20 shared lines) · ×1
Near-duplicate member family (4 members, 20 shared lines) rust/lance/src/dataset/write/delete.rs:55— rust/lance/src/dataset/write/delete.rs:55-96 | rust/lance/src/dataset/write/merge_insert.rs:3037-3078 | rust/lance/src/dataset/write/merge_insert/exec.rs:69-110 | rust/lance/src/dataset/write/update.rs:696-737 — These 4 members are variants of one another: a block of 20 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 11 shared lines) · ×1
Near-duplicate member family (3 members, 11 shared lines) rust/lance-namespace-impls/src/rest.rs:859— rust/lance-namespace-impls/src/rest.rs:859-881 | rust/lance-namespace-impls/src/rest.rs:1269-1289 | rust/lance-namespace-impls/src/rest.rs:1314-1344 — These 3 members are variants of one another: a block of 11 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 (88 shared lines) rust/lance/src/dataset/scanner.rs:5322— rust/lance/src/dataset/scanner.rs:5322-5478 | rust/lance/src/dataset/scanner.rs:5486-5638 — These two members are variants of one another: 88 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 (55 shared lines) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:253— rust/lance-index/src/scalar/inverted/index/inverted_index.rs:253-314 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:322-383 — These two members are variants of one another: 55 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) rust/lance-file/src/versions/v2_2/reader.rs:26— rust/lance-file/src/versions/v2_2/reader.rs:26-106 | rust/lance-file/src/versions/v2_3/reader.rs:26-89 — 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 (28 shared lines) rust/lance-file/src/versions/v2_0/writer.rs:856— rust/lance-file/src/versions/v2_0/writer.rs:856-952 | rust/lance-file/src/writer/structural.rs:834-922 — These two members are variants of one another: 28 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (26 corresponding lines) · ×1
Edited copy of a member (26 corresponding lines) rust/lance-linalg/src/distance/cosine.rs:1137— rust/lance-linalg/src/distance/cosine.rs:1137-1162 | rust/lance-linalg/src/distance/cosine.rs:551-580 — These two members are one piece of code written twice and then edited apart: 26 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (39 corresponding lines) · ×1
Edited copy of a member (39 corresponding lines) rust/lance-file/src/versions/v2_2/mod.rs:73— rust/lance-file/src/versions/v2_2/mod.rs:73-118 | rust/lance-file/src/versions/v2_3/mod.rs:81-126 — These two members are one piece of code written twice and then edited apart: 39 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (27 corresponding lines) · ×1
Edited copy of a member (27 corresponding lines) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:89— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:89-120 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:88-127 — These two members are one piece of code written twice and then edited apart: 27 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) rust/lance/src/index/scalar/bitmap.rs:19— rust/lance/src/index/scalar/bitmap.rs:19-76 | rust/lance/src/index/scalar/bloomfilter.rs:20-98 | rust/lance/src/index/scalar/fmindex.rs:30-122 | rust/lance/src/index/scalar/inverted.rs:935-1020 | rust/lance/src/index/scalar/label_list.rs:66-148 | rust/lance/src/index/scalar/minhash_lsh.rs:25-85 | rust/lance/src/index/scalar/rtree.rs:28-92 | rust/lance/src/index/scalar/zonemap.rs:20-86 — 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.
Duplicated block (60–63 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1216— rust/lance-index/src/vector/distributed/index_merger.rs:1216-1278 | rust/lance-index/src/vector/distributed/index_merger.rs:1377-1436 — both copies are in the same file, so extract the block into 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–55 lines × 2) rust/lance-index/src/vector/distributed/index_merger.rs:1050— rust/lance-index/src/vector/distributed/index_merger.rs:1050-1104 | rust/lance-index/src/vector/distributed/index_merger.rs:1473-1522 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (47 lines × 2) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:492— rust/lance-index/src/scalar/inverted/index/inverted_index.rs:492-538 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:604-650 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (40–43 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:364— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:364-403 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:235-277 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 180 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (39–41 lines × 2) rust/lance/src/dataset/fragment.rs:3695— rust/lance/src/dataset/fragment.rs:3695-3733 | rust/lance/src/dataset/fragment.rs:3888-3928 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/index/inverted_index.rs:446— rust/lance-index/src/scalar/inverted/index/inverted_index.rs:446-486 | rust/lance-index/src/scalar/inverted/index/inverted_index.rs:558-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 (40 lines × 2) rust/lance/src/io/commit/conflict_resolver.rs:487— rust/lance/src/io/commit/conflict_resolver.rs:487-526 | rust/lance/src/io/commit/conflict_resolver.rs:735-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 (39 lines × 2) rust/lance-file/src/versions/v2_1/reader.rs:33— rust/lance-file/src/versions/v2_1/reader.rs:33-71 | rust/lance-file/src/versions/v2_2/reader.rs:33-71 — `rust/lance-file/src/versions/v2_1/reader.rs` and `rust/lance-file/src/versions/v2_2/reader.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 10 separate duplicated blocks between them, totalling at least 158 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 (32–37 lines × 2) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:329— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:329-360 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:195-231 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 180 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (34–35 lines × 2) rust/lance-index/src/scalar/inverted/builder.rs:593— rust/lance-index/src/scalar/inverted/builder.rs:593-627 | rust/lance-index/src/scalar/inverted/builder.rs:667-700 — both copies are in the same file, so extract the block into 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–34 lines × 2) rust/lance-file/src/versions/v2_0/writer.rs:598— rust/lance-file/src/versions/v2_0/writer.rs:598-631 | rust/lance-file/src/writer/structural.rs:313-341 — before extracting anything, compare `rust/lance-file/src/versions/v2_0/writer.rs` and `rust/lance-file/src/writer/structural.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 216 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 (31–33 lines × 2) rust/lance/src/io/commit/conflict_resolver.rs:531— rust/lance/src/io/commit/conflict_resolver.rs:531-563 | rust/lance/src/io/commit/conflict_resolver.rs:779-809 — both copies are in the same file, so extract the block into 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 lines × 3) rust/lance-file/src/versions/v2_1/writer.rs:155— rust/lance-file/src/versions/v2_1/writer.rs:155-186 | rust/lance-file/src/versions/v2_2/writer.rs:155-186 | rust/lance-file/src/versions/v2_3/writer.rs:155-186 — `rust/lance-file/src/versions/v2_1/writer.rs` and `rust/lance-file/src/versions/v2_2/writer.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 4 separate duplicated blocks between them, totalling at least 62 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 (30–32 lines × 3) rust/lance-namespace-impls/src/dir/manifest.rs:3684— rust/lance-namespace-impls/src/dir/manifest.rs:3684-3715 | rust/lance-namespace-impls/src/dir/manifest.rs:3749-3778 | rust/lance-namespace-impls/src/dir/manifest.rs:3801-3830 — all 3 copies are in the same file, so extract the block into one function there and call 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 (32 lines × 2) rust/lance/src/index/vector/ivf/v2.rs:1281— rust/lance/src/index/vector/ivf/v2.rs:1281-1312 | rust/lance/src/index/vector/ivf/v2.rs:1365-1396 — both copies are in the same file, so extract the block into 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–32 lines × 2) rust/lance-namespace-impls/src/dir.rs:1127— rust/lance-namespace-impls/src/dir.rs:1127-1158 | rust/lance-namespace-impls/src/dir/manifest.rs:2678-2707 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (21–30 lines × 2) rust/lance/src/index/frag_reuse.rs:936— rust/lance/src/index/frag_reuse.rs:936-956 | rust/lance/src/index/frag_reuse.rs:1468-1497 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28–29 lines × 2) rust/lance/src/index/create.rs:819— rust/lance/src/index/create.rs:819-847 | rust/lance/src/index/create.rs:895-922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–29 lines × 2) rust/lance-io/src/uring/current_thread_future.rs:38— rust/lance-io/src/uring/current_thread_future.rs:38-58 | rust/lance-io/src/uring/current_thread_future.rs:70-98 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (28 lines × 3) rust/lance-namespace-impls/src/dir.rs:3844— rust/lance-namespace-impls/src/dir.rs:3844-3871 | rust/lance-namespace-impls/src/dir.rs:3901-3928 | rust/lance-namespace-impls/src/dir.rs:3951-3978 — all 3 copies are in the same file, so extract the block into one function there and call 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 (28 lines × 2) java/lance-jni/src/lib.rs:133— java/lance-jni/src/lib.rs:133-160 | python/src/lib.rs:225-252 — 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–28 lines × 2) rust/lance-index/src/scalar/inverted/builder.rs:2002— rust/lance-index/src/scalar/inverted/builder.rs:2002-2027 | rust/lance-index/src/scalar/inverted/builder.rs:2080-2107 — both copies are in the same file, so extract the block into 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–26 lines × 2) rust/lance/src/dataset/write/merge_insert/exec/write.rs:111— rust/lance/src/dataset/write/merge_insert/exec/write.rs:111-136 | rust/lance/src/dataset/write/merge_insert/exec/write.rs:143-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 (17–26 lines × 2) rust/lance/src/io/commit/conflict_resolver.rs:928— rust/lance/src/io/commit/conflict_resolver.rs:928-953 | rust/lance/src/io/commit/conflict_resolver.rs:1176-1192 — both copies are in the same file, so extract the block into 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) rust/lance/src/index/vector/ivf/io.rs:214— rust/lance/src/index/vector/ivf/io.rs:214-239 | rust/lance/src/index/vector/ivf/io.rs:322-346 — both copies are in the same file, so extract the block into 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) rust/lance-index/src/scalar/inverted/wand.rs:4221— rust/lance-index/src/scalar/inverted/wand.rs:4221-4246 | rust/lance-index/src/scalar/inverted/wand.rs:4332-4357 — both copies are in the same file, so extract the block into 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–25 lines × 2) rust/lance/src/dataset/mem_wal/write.rs:472— rust/lance/src/dataset/mem_wal/write.rs:472-490 | rust/lance/src/dataset/mem_wal/write.rs:496-520 — both copies are in the same file, so extract the block into 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 × 3) rust/lance-namespace-impls/src/credentials/aws.rs:552— rust/lance-namespace-impls/src/credentials/aws.rs:552-575 | rust/lance-namespace-impls/src/credentials/azure.rs:835-857 | rust/lance-namespace-impls/src/credentials/gcp.rs:888-910 — before extracting anything, compare `rust/lance-namespace-impls/src/credentials/aws.rs` and `rust/lance-namespace-impls/src/credentials/gcp.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (24 lines × 3) rust/lance-namespace-impls/src/rest.rs:624— rust/lance-namespace-impls/src/rest.rs:624-647 | rust/lance-namespace-impls/src/rest.rs:661-684 | rust/lance-namespace-impls/src/rest.rs:729-752 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (23 lines × 3) rust/lance-index/src/scalar/inverted/index/posting_builder.rs:482— rust/lance-index/src/scalar/inverted/index/posting_builder.rs:482-504 | rust/lance-index/src/scalar/inverted/index/posting_builder.rs:706-728 | rust/lance-index/src/scalar/inverted/index/posting_builder.rs:767-789 — all 3 copies are in the same file, so extract the block into one function there and call 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 (22–23 lines × 2) java/lance-jni/src/blocking_dataset.rs:795— java/lance-jni/src/blocking_dataset.rs:795-817 | java/lance-jni/src/fragment.rs:359-380 — 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–22 lines × 2) java/lance-jni/src/otel.rs:264— java/lance-jni/src/otel.rs:264-280 | python/src/otel.rs:375-396 — before extracting anything, compare `java/lance-jni/src/otel.rs` and `python/src/otel.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 115 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 3) java/lance-jni/src/optimize.rs:99— java/lance-jni/src/optimize.rs:99-119 | java/lance-jni/src/optimize.rs:198-218 | java/lance-jni/src/optimize.rs:312-332 — all 3 copies are in the same file, so extract the block into one function there and call 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–21 lines × 2) rust/lance/src/dataset.rs:1056— rust/lance/src/dataset.rs:1056-1076 | rust/lance/src/dataset.rs:1125-1142 — both copies are in the same file, so extract the block into 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–20 lines × 2) java/lance-jni/src/namespace.rs:234— java/lance-jni/src/namespace.rs:234-250 | java/lance-jni/src/namespace.rs:288-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 (19–20 lines × 2) python/src/dataset.rs:1502— python/src/dataset.rs:1502-1521 | python/src/fragment.rs:280-298 — before extracting anything, compare `python/src/dataset.rs` and `python/src/fragment.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 (18–20 lines × 2) rust/lance-namespace-impls/src/dir/manifest.rs:2482— rust/lance-namespace-impls/src/dir/manifest.rs:2482-2499 | rust/lance-namespace-impls/src/dir/manifest.rs:2630-2649 — both copies are in the same file, so extract the block into 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–20 lines × 2) rust/lance-namespace-impls/src/dir.rs:2067— rust/lance-namespace-impls/src/dir.rs:2067-2086 | rust/lance-namespace-impls/src/dir.rs:3524-3538 — both copies are in the same file, so extract the block into 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 × 4) rust/lance/src/io/commit/conflict_resolver.rs:216— rust/lance/src/io/commit/conflict_resolver.rs:216-233 | rust/lance/src/io/commit/conflict_resolver.rs:262-279 | rust/lance/src/io/commit/conflict_resolver.rs:283-300 | rust/lance/src/io/commit/conflict_resolver.rs:303-320 — 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–17 lines × 3) rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1119— rust/lance/src/dataset/mem_wal/scanner/fts_search.rs:1119-1130 | rust/lance/src/dataset/mem_wal/scanner/planner.rs:363-379 | rust/lance/src/dataset/mem_wal/scanner/vector_search.rs:509-525 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/scanner/fts_search.rs` and `rust/lance/src/dataset/mem_wal/scanner/planner.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 38 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 2) java/lance-jni/src/blocking_dataset.rs:444— java/lance-jni/src/blocking_dataset.rs:444-459 | java/lance-jni/src/transaction.rs:2338-2354 — 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–17 lines × 2) python/src/indices.rs:423— python/src/indices.rs:423-437 | python/src/indices.rs:593-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 (14–16 lines × 3) rust/lance-encoding/src/array_encoding/physical/fsst.rs:162— rust/lance-encoding/src/array_encoding/physical/fsst.rs:162-175 | rust/lance-encoding/src/encodings/physical/fsst.rs:55-70 | rust/lance-encoding/src/encodings/physical/fsst.rs:88-103 — 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–16 lines × 2) rust/lance/src/dataset/hash_joiner.rs:132— rust/lance/src/dataset/hash_joiner.rs:132-147 | rust/lance/src/dataset/hash_joiner.rs:221-233 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) rust/lance-datafusion/src/planner.rs:622— rust/lance-datafusion/src/planner.rs:622-637 | rust/lance-datafusion/src/planner.rs:639-653 — both copies are in the same file, so extract the block into 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 × 5) rust/lance-index/src/vector/distributed/index_merger.rs:1053— rust/lance-index/src/vector/distributed/index_merger.rs:1053-1067 | rust/lance-index/src/vector/distributed/index_merger.rs:1112-1124 | rust/lance-index/src/vector/distributed/index_merger.rs:1219-1233 | rust/lance-index/src/vector/distributed/index_merger.rs:1380-1392 | rust/lance-index/src/vector/distributed/index_merger.rs:1476-1488 — 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 (15 lines × 4) rust/lance/src/index/vector.rs:1666— rust/lance/src/index/vector.rs:1666-1680 | rust/lance/src/index/vector.rs:1684-1698 | rust/lance/src/index/vector.rs:1702-1716 | rust/lance/src/index/vector.rs:1720-1734 — 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–15 lines × 3) rust/lance-encoding/src/encodings/logical/primitive/dict.rs:257— rust/lance-encoding/src/encodings/logical/primitive/dict.rs:257-271 | rust/lance-encoding/src/encodings/logical/primitive/dict.rs:335-348 | rust/lance-encoding/src/encodings/logical/primitive/dict.rs:391-404 — all 3 copies are in the same file, so extract the block into one function there and call 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–15 lines × 2) python/src/file.rs:341— python/src/file.rs:341-355 | python/src/file.rs:932-939 — both copies are in the same file, so extract the block into 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–15 lines × 2) rust/lance-index/src/vector/pq/storage.rs:556— rust/lance-index/src/vector/pq/storage.rs:556-570 | rust/lance-index/src/vector/pq/storage.rs:590-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 (12–14 lines × 4) rust/lance-index/src/vector/ivf.rs:123— rust/lance-index/src/vector/ivf.rs:123-134 | rust/lance-index/src/vector/ivf.rs:191-202 | rust/lance-index/src/vector/ivf.rs:241-252 | rust/lance-index/src/vector/ivf.rs:284-297 — 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–14 lines × 3) rust/compression/fsst/src/fsst.rs:963— rust/compression/fsst/src/fsst.rs:963-976 | rust/compression/fsst/src/fsst.rs:993-1006 | rust/compression/fsst/src/fsst.rs:1023-1034 — all 3 copies are in the same file, so extract the block into one function there and call 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–14 lines × 2) rust/lance/src/index/append.rs:459— rust/lance/src/index/append.rs:459-472 | rust/lance/src/index/append.rs:1298-1307 — both copies are in the same file, so extract the block into 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–13 lines × 3) python/src/file.rs:339— python/src/file.rs:339-351 | python/src/file.rs:502-511 | python/src/file.rs:930-939 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance-namespace-impls/src/credentials/gcp.rs:859— rust/lance-namespace-impls/src/credentials/gcp.rs:859-869 | rust/lance-namespace-impls/src/credentials/gcp.rs:919-930 | rust/lance-namespace-impls/src/credentials/gcp.rs:981-993 — all 3 copies are in the same file, so extract the block into one function there and call 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) rust/lance/src/dataset/optimize.rs:719— rust/lance/src/dataset/optimize.rs:719-731 | rust/lance/src/dataset/optimize/binary_copy.rs:174-183 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 6) rust/lance-namespace-impls/src/dir/manifest.rs:2803— rust/lance-namespace-impls/src/dir/manifest.rs:2803-2814 | rust/lance-namespace-impls/src/dir/manifest.rs:2925-2936 | rust/lance-namespace-impls/src/dir/manifest.rs:2955-2966 | rust/lance-namespace-impls/src/dir/manifest.rs:3163-3174 | rust/lance-namespace-impls/src/dir/manifest.rs:3558-3569 | rust/lance-namespace-impls/src/dir/manifest.rs:3636-3647 — 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–12 lines × 5) rust/lance-index/src/vector/ivf.rs:127— rust/lance-index/src/vector/ivf.rs:127-138 | rust/lance-index/src/vector/ivf.rs:155-166 | rust/lance-index/src/vector/ivf.rs:195-206 | rust/lance-index/src/vector/ivf.rs:245-256 | rust/lance-index/src/vector/ivf.rs:288-297 — 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 (11–12 lines × 3) rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:387— rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs:387-397 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/fts.rs:512-523 | rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs:260-271 — before extracting anything, compare `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/brute_force_vector.rs` and `rust/lance/src/dataset/mem_wal/memtable/scanner/exec/vector.rs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 180 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) rust/lance-index/src/vector/hnsw/builder.rs:351— rust/lance-index/src/vector/hnsw/builder.rs:351-362 | rust/lance-index/src/vector/hnsw/builder.rs:535-541 — both copies are in the same file, so extract the block into 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) rust/lance-io/src/object_store/providers.rs:252— rust/lance-io/src/object_store/providers.rs:252-259 | rust/lance-io/src/object_store/providers.rs:280-291 — both copies are in the same file, so extract the block into 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 × 6) rust/lance-namespace-impls/src/rest.rs:799— rust/lance-namespace-impls/src/rest.rs:799-809 | rust/lance-namespace-impls/src/rest.rs:864-874 | rust/lance-namespace-impls/src/rest.rs:1272-1282 | rust/lance-namespace-impls/src/rest.rs:1319-1329 | rust/lance-namespace-impls/src/rest.rs:1535-1545 | rust/lance-namespace-impls/src/rest.rs:1622-1632 — 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–11 lines × 3) rust/lance/src/index/scalar/bitmap.rs:61— rust/lance/src/index/scalar/bitmap.rs:61-70 | rust/lance/src/index/scalar/inverted.rs:1004-1014 | rust/lance/src/index/scalar/label_list.rs:132-142 — before extracting anything, compare `rust/lance/src/index/scalar/bitmap.rs` and `rust/lance/src/index/scalar/inverted.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–11 lines × 3) rust/lance/src/index/scalar/bloomfilter.rs:85— rust/lance/src/index/scalar/bloomfilter.rs:85-94 | rust/lance/src/index/scalar/minhash_lsh.rs:74-81 | rust/lance/src/index/scalar/rtree.rs:78-88 — before extracting anything, compare `rust/lance/src/index/scalar/bloomfilter.rs` and `rust/lance/src/index/scalar/minhash_lsh.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 39 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 10) rust/lance/src/index/vector/ivf.rs:818— rust/lance/src/index/vector/ivf.rs:818-826 | rust/lance/src/index/vector/ivf.rs:837-846 | rust/lance/src/index/vector/ivf.rs:859-868 | rust/lance/src/index/vector/ivf.rs:880-889 | rust/lance/src/index/vector/ivf.rs:901-910 | rust/lance/src/index/vector/ivf.rs:921-930 | rust/lance/src/index/vector/ivf.rs:943-951 | rust/lance/src/index/vector/ivf.rs:962-971 | rust/lance/src/index/vector/ivf.rs:984-993 | rust/lance/src/index/vector/ivf.rs:1005-1014 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 8) rust/lance/src/index/scalar/bitmap.rs:20— rust/lance/src/index/scalar/bitmap.rs:20-29 | rust/lance/src/index/scalar/bloomfilter.rs:21-30 | rust/lance/src/index/scalar/fmindex.rs:31-40 | rust/lance/src/index/scalar/inverted.rs:936-945 | rust/lance/src/index/scalar/label_list.rs:67-76 | rust/lance/src/index/scalar/minhash_lsh.rs:26-35 | rust/lance/src/index/scalar/rtree.rs:29-38 | rust/lance/src/index/scalar/zonemap.rs:21-30 — before extracting anything, compare `rust/lance/src/index/scalar/bitmap.rs` and `rust/lance/src/index/scalar/inverted.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 5) rust/lance/src/index/scalar/bitmap.rs:62— rust/lance/src/index/scalar/bitmap.rs:62-71 | rust/lance/src/index/scalar/fmindex.rs:108-117 | rust/lance/src/index/scalar/inverted.rs:1006-1015 | rust/lance/src/index/scalar/label_list.rs:134-143 | rust/lance/src/index/scalar/zonemap.rs:72-81 — before extracting anything, compare `rust/lance/src/index/scalar/bitmap.rs` and `rust/lance/src/index/scalar/inverted.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 4) rust/lance/src/dataset/refs.rs:219— rust/lance/src/dataset/refs.rs:219-228 | rust/lance/src/dataset/refs.rs:254-263 | rust/lance/src/dataset/refs.rs:269-277 | rust/lance/src/dataset/refs.rs:302-310 — 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 (4–10 lines × 4) rust/lance-linalg/src/distance/cosine.rs:1015— rust/lance-linalg/src/distance/cosine.rs:1015-1018 | rust/lance-linalg/src/distance/dot.rs:732-741 | rust/lance-linalg/src/distance/l2.rs:798-807 | rust/lance-linalg/src/distance/norm_l2.rs:358-367 — before extracting anything, compare `rust/lance-linalg/src/distance/cosine.rs` and `rust/lance-linalg/src/distance/dot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (2–10 lines × 5) rust/lance-linalg/src/distance/cosine.rs:567— rust/lance-linalg/src/distance/cosine.rs:567-576 | rust/lance-linalg/src/distance/cosine.rs:1152-1159 | rust/lance-linalg/src/distance/cosine.rs:1247-1249 | rust/lance-linalg/src/distance/cosine.rs:1300-1301 | rust/lance-linalg/src/distance/cosine.rs:1302-1304 — 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–10 lines × 2) rust/lance-namespace-impls/src/dir.rs:3971— rust/lance-namespace-impls/src/dir.rs:3971-3980 | rust/lance-namespace-impls/src/dir/manifest.rs:3826-3832 — 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 × 7) java/lance-jni/src/namespace.rs:357— java/lance-jni/src/namespace.rs:357-365 | java/lance-jni/src/namespace.rs:438-446 | java/lance-jni/src/namespace.rs:497-505 | java/lance-jni/src/namespace.rs:580-588 | java/lance-jni/src/namespace.rs:674-682 | java/lance-jni/src/namespace.rs:762-770 | java/lance-jni/src/namespace.rs:848-856 — 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 (4–9 lines × 4) rust/lance-linalg/src/distance/cosine.rs:1026— rust/lance-linalg/src/distance/cosine.rs:1026-1029 | rust/lance-linalg/src/distance/dot.rs:743-751 | rust/lance-linalg/src/distance/l2.rs:810-818 | rust/lance-linalg/src/distance/norm_l2.rs:368-376 — before extracting anything, compare `rust/lance-linalg/src/distance/cosine.rs` and `rust/lance-linalg/src/distance/dot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6–9 lines × 2) rust/lance/src/index/vector/ivf/io.rs:243— rust/lance/src/index/vector/ivf/io.rs:243-248 | rust/lance/src/index/vector/ivf/io.rs:372-380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–9 lines × 2) rust/lance-index/src/vector/bq/dist_table_quant.rs:63— rust/lance-index/src/vector/bq/dist_table_quant.rs:63-71 | rust/lance-index/src/vector/bq/dist_table_quant.rs:102-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (3–9 lines × 3) rust/lance-linalg/src/distance/cosine.rs:558— rust/lance-linalg/src/distance/cosine.rs:558-566 | rust/lance-linalg/src/distance/cosine.rs:1143-1151 | rust/lance-linalg/src/distance/cosine.rs:1240-1242 — all 3 copies are in the same file, so extract the block into one function there and call 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 × 5) rust/lance-datafusion/src/udf/json.rs:517— rust/lance-datafusion/src/udf/json.rs:517-524 | rust/lance-datafusion/src/udf/json.rs:570-577 | rust/lance-datafusion/src/udf/json.rs:626-633 | rust/lance-datafusion/src/udf/json.rs:682-689 | rust/lance-datafusion/src/udf/json.rs:738-745 — 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–8 lines × 2) rust/lance-file/src/versions/v1/writer/mod.rs:507— rust/lance-file/src/versions/v1/writer/mod.rs:507-511 | rust/lance-file/src/versions/v1/writer/mod.rs:555-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 (7–8 lines × 2) rust/lance-index/src/scalar/btree.rs:2339— rust/lance-index/src/scalar/btree.rs:2339-2345 | rust/lance-index/src/scalar/rtree.rs:552-559 — 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 × 7) rust/lance/src/index/scalar/bitmap.rs:70— rust/lance/src/index/scalar/bitmap.rs:70-76 | rust/lance/src/index/scalar/bloomfilter.rs:92-98 | rust/lance/src/index/scalar/fmindex.rs:116-122 | rust/lance/src/index/scalar/label_list.rs:142-148 | rust/lance/src/index/scalar/minhash_lsh.rs:79-85 | rust/lance/src/index/scalar/rtree.rs:86-92 | rust/lance/src/index/scalar/zonemap.rs:80-86 — before extracting anything, compare `rust/lance/src/index/scalar/bitmap.rs` and `rust/lance/src/index/scalar/label_list.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–7 lines × 4) rust/lance/src/io/exec/fts.rs:3973— rust/lance/src/io/exec/fts.rs:3973-3978 | rust/lance/src/io/exec/knn.rs:1059-1064 | rust/lance/src/io/exec/rowids.rs:221-227 | rust/lance/src/io/exec/scalar_index.rs:626-632 — 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 (4–6 lines × 6) rust/lance-linalg/src/distance/cosine.rs:1171— rust/lance-linalg/src/distance/cosine.rs:1171-1174 | rust/lance-linalg/src/distance/cosine.rs:1258-1263 | rust/lance-linalg/src/distance/dot.rs:686-691 | rust/lance-linalg/src/distance/dot.rs:709-714 | rust/lance-linalg/src/distance/l2.rs:744-749 | rust/lance-linalg/src/distance/l2.rs:771-776 — before extracting anything, compare `rust/lance-linalg/src/distance/cosine.rs` and `rust/lance-linalg/src/distance/dot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–6 lines × 4) rust/lance-linalg/src/distance/cosine.rs:1194— rust/lance-linalg/src/distance/cosine.rs:1194-1197 | rust/lance-linalg/src/distance/cosine.rs:1215-1220 | rust/lance-linalg/src/distance/dot.rs:663-668 | rust/lance-linalg/src/distance/l2.rs:717-722 — before extracting anything, compare `rust/lance-linalg/src/distance/cosine.rs` and `rust/lance-linalg/src/distance/dot.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (4–5 lines × 3) rust/lance/src/io/exec/fts.rs:1136— rust/lance/src/io/exec/fts.rs:1136-1139 | rust/lance/src/io/exec/fts.rs:1433-1437 | rust/lance/src/io/exec/fts.rs:1987-1991 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (54 lines × 2) rust/lance-index/src/vector/flat.rs:34— rust/lance-index/src/vector/flat.rs:34-87 | rust/lance/src/index/vector/utils.rs:33-86 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (6 lines × 7) rust/lance-index/src/scalar.rs:362— rust/lance-index/src/scalar.rs:362-367 | rust/lance-index/src/scalar.rs:433-438 | rust/lance-index/src/scalar.rs:489-494 | rust/lance-index/src/scalar.rs:561-566 | rust/lance-index/src/scalar.rs:590-595 | rust/lance-index/src/scalar.rs:634-639 | rust/lance-index/src/scalar/json.rs:300-305 — there are 7 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 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (13 lines × 4) rust/lance/src/io/exec/fts.rs:2629— rust/lance/src/io/exec/fts.rs:2629-2641 | rust/lance/src/io/exec/fts.rs:3689-3701 | rust/lance/src/io/exec/fts.rs:4098-4110 | rust/lance/src/io/exec/fts.rs:4856-4868 — 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 × 8) rust/lance-namespace-impls/src/rest.rs:796— rust/lance-namespace-impls/src/rest.rs:796-800 | rust/lance-namespace-impls/src/rest.rs:861-865 | rust/lance-namespace-impls/src/rest.rs:885-889 | rust/lance-namespace-impls/src/rest.rs:966-970 | rust/lance-namespace-impls/src/rest.rs:1021-1025 | rust/lance-namespace-impls/src/rest.rs:1316-1320 | rust/lance-namespace-impls/src/rest.rs:1532-1536 | rust/lance-namespace-impls/src/rest.rs:1619-1623 — 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 × 5) rust/lance-datafusion/src/expr.rs:173— rust/lance-datafusion/src/expr.rs:173-178 | rust/lance-datafusion/src/expr.rs:204-209 | rust/lance-datafusion/src/expr.rs:264-269 | rust/lance-datafusion/src/expr.rs:286-291 | rust/lance-datafusion/src/expr.rs:313-318 — 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 (46 lines × 2) java/src/main/java/org/lance/namespace/DirectoryNamespace.java:875— java/src/main/java/org/lance/namespace/DirectoryNamespace.java:875-920 | java/src/main/java/org/lance/namespace/RestNamespace.java:782-827 — before extracting anything, compare `java/src/main/java/org/lance/namespace/DirectoryNamespace.java` and `java/src/main/java/org/lance/namespace/RestNamespace.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 4) java/src/main/java/org/lance/Fragment.java:327— java/src/main/java/org/lance/Fragment.java:327-342 | java/src/main/java/org/lance/Fragment.java:350-365 | java/src/main/java/org/lance/Fragment.java:401-416 | java/src/main/java/org/lance/Fragment.java:423-438 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 7) java/src/main/java/org/lance/delta/DatasetDelta.java:113— java/src/main/java/org/lance/delta/DatasetDelta.java:113-120 | java/src/main/java/org/lance/ipc/LanceScanner.java:136-143 | java/src/main/java/org/lance/memwal/ExecutionPlan.java:98-105 | java/src/main/java/org/lance/memwal/LsmPointLookupPlanner.java:109-116 | java/src/main/java/org/lance/memwal/LsmScanner.java:182-189 | java/src/main/java/org/lance/memwal/LsmVectorSearchPlanner.java:221-228 | java/src/main/java/org/lance/memwal/ShardWriter.java:184-191 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 7 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 7 times.
Duplicated block (6 lines × 25) java/src/main/java/org/lance/Dataset.java:997— java/src/main/java/org/lance/Dataset.java:997-1002 | java/src/main/java/org/lance/Dataset.java:1020-1025 | java/src/main/java/org/lance/Dataset.java:1034-1039 | java/src/main/java/org/lance/Dataset.java:1051-1056 | java/src/main/java/org/lance/Dataset.java:1063-1068 | java/src/main/java/org/lance/Dataset.java:1080-1085 | java/src/main/java/org/lance/Dataset.java:1099-1104 | java/src/main/java/org/lance/Dataset.java:1550-1555 | java/src/main/java/org/lance/Dataset.java:1569-1574 | java/src/main/java/org/lance/Dataset.java:1600-1605 | java/src/main/java/org/lance/Dataset.java:1641-1646 | java/src/main/java/org/lance/Dataset.java:1655-1660 | java/src/main/java/org/lance/Dataset.java:1740-1745 | java/src/main/java/org/lance/Dataset.java:1757-1762 | java/src/main/java/org/lance/Dataset.java:1789-1794 | java/src/main/java/org/lance/Dataset.java:2144-2149 | java/src/main/java/org/lance/Dataset.java:2248-2253 | java/src/main/java/org/lance/Dataset.java:2289-2294 | java/src/main/java/org/lance/delta/DatasetDelta.java:57-62 | java/src/main/java/org/lance/ipc/LanceScanner.java:251-256 | java/src/main/java/org/lance/memwal/ExecutionPlan.java:71-76 | java/src/main/java/org/lance/memwal/LsmScanner.java:168-173 | java/src/main/java/org/lance/memwal/ShardWriter.java:78-83 | java/src/main/java/org/lance/memwal/ShardWriter.java:134-139 | java/src/main/java/org/lance/memwal/ShardWriter.java:144-149 — there are 25 copies across 6 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 25 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 74) java/src/main/java/org/lance/namespace/DirectoryNamespace.java:306— java/src/main/java/org/lance/namespace/DirectoryNamespace.java:306-311 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:314-319 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:322-327 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:330-335 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:346-351 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:354-359 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:362-367 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:378-383 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:386-391 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:411-416 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:419-424 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:447-452 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:455-460 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:471-476 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:479-484 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:488-494 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:497-502 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:505-510 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:515-520 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:523-528 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:531-536 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:540-546 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:549-554 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:557-562 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:565-570 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:573-578 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:582-588 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:591-596 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:613-618 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:622-627 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:630-635 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:638-643 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:646-651 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:654-659 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:662-667 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:670-675 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:679-684 | java/src/main/java/org/lance/namespace/RestNamespace.java:220-225 | java/src/main/java/org/lance/namespace/RestNamespace.java:228-233 | java/src/main/java/org/lance/namespace/RestNamespace.java:236-241 | java/src/main/java/org/lance/namespace/RestNamespace.java:244-249 | java/src/main/java/org/lance/namespace/RestNamespace.java:260-265 | java/src/main/java/org/lance/namespace/RestNamespace.java:268-273 | java/src/main/java/org/lance/namespace/RestNamespace.java:276-281 | java/src/main/java/org/lance/namespace/RestNamespace.java:292-297 | java/src/main/java/org/lance/namespace/RestNamespace.java:300-305 | java/src/main/java/org/lance/namespace/RestNamespace.java:324-329 | java/src/main/java/org/lance/namespace/RestNamespace.java:332-337 | java/src/main/java/org/lance/namespace/RestNamespace.java:360-365 | java/src/main/java/org/lance/namespace/RestNamespace.java:368-373 | java/src/main/java/org/lance/namespace/RestNamespace.java:384-389 | java/src/main/java/org/lance/namespace/RestNamespace.java:392-397 | java/src/main/java/org/lance/namespace/RestNamespace.java:401-406 | java/src/main/java/org/lance/namespace/RestNamespace.java:409-414 | java/src/main/java/org/lance/namespace/RestNamespace.java:417-422 | java/src/main/java/org/lance/namespace/RestNamespace.java:425-430 | java/src/main/java/org/lance/namespace/RestNamespace.java:433-438 | java/src/main/java/org/lance/namespace/RestNamespace.java:441-446 | java/src/main/java/org/lance/namespace/RestNamespace.java:450-455 | java/src/main/java/org/lance/namespace/RestNamespace.java:458-463 | java/src/main/java/org/lance/namespace/RestNamespace.java:466-471 | java/src/main/java/org/lance/namespace/RestNamespace.java:474-479 | java/src/main/java/org/lance/namespace/RestNamespace.java:482-487 | java/src/main/java/org/lance/namespace/RestNamespace.java:491-496 | java/src/main/java/org/lance/namespace/RestNamespace.java:499-504 | java/src/main/java/org/lance/namespace/RestNamespace.java:521-526 | java/src/main/java/org/lance/namespace/RestNamespace.java:530-535 | java/src/main/java/org/lance/namespace/RestNamespace.java:538-543 | java/src/main/java/org/lance/namespace/RestNamespace.java:546-551 | java/src/main/java/org/lance/namespace/RestNamespace.java:554-559 | java/src/main/java/org/lance/namespace/RestNamespace.java:562-567 | java/src/main/java/org/lance/namespace/RestNamespace.java:570-575 | java/src/main/java/org/lance/namespace/RestNamespace.java:578-583 | java/src/main/java/org/lance/namespace/RestNamespace.java:587-592 — before extracting anything, compare `java/src/main/java/org/lance/namespace/DirectoryNamespace.java` and `java/src/main/java/org/lance/namespace/RestNamespace.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `java/src/main/java/org/lance/namespace/DirectoryNamespace.java:488` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `ListNamespacesRequest` in one and `DescribeNamespaceRequest` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 6) java/src/main/java/org/lance/namespace/DirectoryNamespace.java:402— java/src/main/java/org/lance/namespace/DirectoryNamespace.java:402-408 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:428-434 | java/src/main/java/org/lance/namespace/DirectoryNamespace.java:438-444 | java/src/main/java/org/lance/namespace/RestNamespace.java:316-321 | java/src/main/java/org/lance/namespace/RestNamespace.java:341-347 | java/src/main/java/org/lance/namespace/RestNamespace.java:351-357 — before extracting anything, compare `java/src/main/java/org/lance/namespace/DirectoryNamespace.java` and `java/src/main/java/org/lance/namespace/RestNamespace.java` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 100 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `java/src/main/java/org/lance/namespace/DirectoryNamespace.java:428` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `request` to `CreateTableRequest` in one and `InsertIntoTableRequest` 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 (74–120 lines × 2) python/python/lance/dataset.py:4903— python/python/lance/dataset.py:4903-5022 | python/python/lance/dataset.py:5106-5179 — both copies are in the same file, so extract the block into 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–39 lines × 2) python/python/lance/vector.py:438— python/python/lance/vector.py:438-476 | python/python/lance/vector.py:644-669 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `python/python/lance/vector.py:438` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 3) python/python/lance/dataset.py:1635— python/python/lance/dataset.py:1635-1757 | python/python/lance/dataset.py:1797-1826 | python/python/lance/dataset.py:2214-2238 — all 3 copies are in the same file, so extract the block into one function there and call 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 `python/python/lance/dataset.py:1635` it does not close everything it opens, so those 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 (21–22 lines × 2) ci/new_contributors.py:159— ci/new_contributors.py:159-180 | ci/review_stats.py:112-132 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The `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 (14 lines × 5) python/python/lance/dataset.py:1744— python/python/lance/dataset.py:1744-1757 | python/python/lance/dataset.py:1813-1826 | python/python/lance/dataset.py:2225-2238 | python/python/lance/fragment.py:707-720 | python/python/lance/fragment.py:745-758 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `python/python/lance/dataset.py:1744` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. 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.
P12 · CI test-gate honesty· Coverage collected but not gated · ×1
Coverage collected but not gated — CI collects a coverage report but no step enforces a minimum — coverage could halve and CI stays green. Add a step that fails the build when coverage drops below a floor (your coverage tool's minimum-threshold flag, or a coverage-gate action) so the number guards something. What was searched, so you can tell an absence from a miss: this repository's CI files AND its coverage configuration — the well-known coverage and test-runner config files, read at the repository root and inside workspace package directories two levels down, so a floor declared beside the tests rather than in the pipeline is credited — matched against the threshold settings this check knows by name. A floor set in your coverage service's web UI rather than in a committed file, or under a setting whose name is not one of those, is not seen here.
Duplicated predicate rust/lance-linalg/src/distance/dot.rs:1221— `!std::is_x86_feature_detected!("avx") || !std::is_x86_feature_detected!("fma")` appears character-identically in 4 files — rust/lance-linalg/src/distance/dot.rs, rust/lance-linalg/src/distance/l2.rs, rust/lance-linalg/src/simd/f32.rs, rust/lance-linalg/src/simd/f64.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate rust/lance-index/src/vector/bq/pairwise.rs:477— `is_x86_feature_detected!("avx512f") && is_x86_feature_detected!("avx512bw") && is_x86_feature_detected!("avx512vnni")` appears character-identically in 4 files — rust/lance-index/src/vector/bq/pairwise.rs, rust/lance-linalg/src/distance/cosine_u8.rs, rust/lance-linalg/src/distance/dot_u8.rs, rust/lance-linalg/src/distance/l2_u8.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate rust/lance/src/index/create.rs:175— `params.index_type.eq_ignore_ascii_case("inverted") || params.index_type.eq_ignore_ascii_case("fts")` appears character-identically in 2 files — rust/lance/src/index/create.rs, rust/lance/src/index/scalar.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate rust/lance-linalg/src/distance/cosine.rs:1662— `std::is_x86_feature_detected!("avx") && std::is_x86_feature_detected!("fma")` appears character-identically in 4 files — rust/lance-linalg/src/distance/cosine.rs, rust/lance-linalg/src/distance/dot.rs, rust/lance-linalg/src/distance/l2.rs, rust/lance-linalg/src/distance/norm_l2.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate rust/lance-index/src/scalar/inverted.rs:195— `value == "0" || value.eq_ignore_ascii_case("off")` appears character-identically in 2 files — rust/lance-index/src/scalar/inverted.rs, rust/lance-index/src/scalar/inverted/index/search.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 26 significant file(s) lose their only recent owner: rust/lance-encoding/src/encodings/logical/primitive/sparse/writer.rs, rust/lance-arrow/src/json.rs, rust/lance-io/src/object_store/read_dir.rs, rust/lance-table/src/transaction/validate.rs, rust/lance-arrow/src/ipc.rs, rust/lance-file/src/versions/mod.rs, ci/format_vote_gate.py, rust/lance-file/src/version.rs (+18 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 8 significant file(s) lose their only recent owner: rust/lance-index/src/vector/bq/ex_dot.rs, rust/compression/bitpacking/src/bitpacker_internal/bitpacker8x.rs, rust/lance-index/src/vector/bq/transform.rs, rust/lance-index/src/vector/bq/prune.rs, rust/lance-index/src/scalar/inverted/compound/should_maxscore.rs, python/src/fts.rs, rust/lance-index/src/scalar/inverted/iter.rs, rust/compression/bitpacking/src/bitpacker_internal/mod.rs. 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: java/src/main/java/org/lance/Branch.java, java/src/main/java/org/lance/util/JsonFields.java, java/src/main/java/org/lance/Tag.java, java/src/main/java/org/lance/Ref.java. Pair on, review, or document these before any departure.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 13 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 (58 single-owned of 809 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 809 of the 1014 production source files in this repository met that bar). They are anonymized user #4 (2 file(s)), anonymized user #5 (2 file(s)), anonymized user #6 (2 file(s)), anonymized user #7 (2 file(s)), anonymized user #8 (1 file(s)), anonymized user #9 (1 file(s)) (+7 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
Documentation: no project overview rust/arrow-stats/README.md— The document begins with a usage example and lists tracked statistics but does not state what the project is or what it does beyond its Arrow-specific purpose. Add an overview paragraph explaining that lance-arrow-stats computes page-level Arrow aggregates for Lance's columnar storage, driving predicate pushdown.
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/`.
Split rust/lance — A catch-all name whose namespaces are dataset/mem_wal/scanner/exec and io/exec scattered across unrelated data layers. Suggested: dataset/mem_wal/scanner/exec
Split rust/lance-encoding — A catch-all name whose namespaces encodings/physical/logical/primitive/sparse are all encoding submodules. Suggested: encodings/physical
Split rust/lance-index — A catch-all name whose namespaces scalar/inverted/index and vector/bq/v3 are all index submodules. Suggested: scalar/inverted/index
D28 · Secrets (history)· Rotate the exposed credentials · ×1
D34 · Knowledge Freshness· Orphaned files with no living knowledge · ×1
Orphaned files with no living knowledge — 26 of 809 analysed file(s) have no living knowledge left — their last meaningful change has decayed away, so if one breaks, no one currently understands it (counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 809 of the 1014 production source files in this repository met that bar). None is large enough to earn a read-through of its own, so this row stands in for the per-file rows rather than raising one each — most significant first: benchmarks/hd-vila/datagen.py, python/python/lance/_arrow/bf16.py, benchmarks/sift/metrics.py, java/src/main/java/org/lance/index/IndexOptions.java, benchmarks/sift/perf.py, python/python/lance/_dataset/sharded_batch_iterator.py, rust/lance-core/src/levenshtein.rs, benchmarks/full_report/vbench/runner.py (and 18 more). 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.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
Logging is not universal — Only 15/17 runnable modules use logging (modules with no entry point or server are excluded — they are libraries a runnable module hosts). Silent: `memtest`, `rust/lance-tools`.
Subsumed condition operand rust/lance-io/src/object_store/throttle.rs:83— `lowercase.contains("429 too many requests")` can never decide this `||` — every value satisfying `lowercase.contains("429 too many requests")` also satisfies `lowercase.contains("too many requests")`, 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.
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.
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 01a0ed9a-4bf4-7a98-9da2-21c78e93d509 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 64 · Warnings: 2592 · Recommendations: 30 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 29-09-2026 @ 14:38 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.