Public report — greptimedb, 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_aad4d350a69845c797f04a629a193a84
Filed 29 September 2026, 16:54 UTC
Public
Very large · 786,612 LoC · 71 projects · rebuild ~6.6 person-years · weakest lens: Security (47%)
Findings by grade
492 critical2178 serious82 minor41 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, 16:29 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 ▸
2651findings with an exact file:lineof 2752 — the remainder are repo-wide signals (a dimension-level measurement, not a single line); open any file:line and verify
57/128dimensions across the health lenses786612 LoC · 71 projects — wide & deep
The system holds an adequate overall standing at 60%, reflecting a large, mature asset that is well-structured but carries significant operational risk. With nearly 800,000 lines of production code and a rebuild cost approaching €1 million, this is a substantial business investment. The high maturity and code health scores indicate that the team has built a solid foundation, yet the low security and readiness scores suggest that while the code is good, the environment it runs in is not yet fully protected or observable. This gap between code quality and operational safety is the primary concern for leadership.
The most critical issue is security exposure. At 47%, the security lens is the weakest point for an asset of this size. This low score implies that sensitive data or infrastructure may be vulnerable to breaches or unauthorized access. For a system with such a high rebuild cost, a security incident could lead to severe financial penalties, reputational damage, and prolonged downtime. The risk is not just theoretical; it represents a tangible threat to business continuity and customer trust that requires immediate attention to mitigate potential losses.
A second theme is operational fragility. Despite strong code health and architecture, the readiness score of 60% indicates that the system lacks robust testing, observability, and disaster recovery capabilities. This means that while the code is maintainable, deploying changes or recovering from failures is risky and potentially slow. The absence of measured event-driven patterns and accessibility metrics further limits our understanding of the full picture, but the existing data suggests that outages or performance issues could go undetected until they impact users, leading to higher support costs and lost revenue.
What is genuinely good is the code quality and domain modeling. The high scores in these areas show that the logic is clean, well-documented, and easy for new engineers to understand. This reduces long-term maintenance costs and accelerates future development. However, these strengths are undermined by the lack of security and operational safeguards. To focus first, the team should codify backups and geo-recovery in infrastructure as code. This single action addresses the highest-leverage risk, ensuring that the massive investment in code is protected against data loss. It is a foundational step that enables safer, faster changes and reduces the cost of potential disasters, providing the most immediate return on effort.
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.
336 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.
D4 · Members sharing a duplicated core (17 members, 50+ identical tokens) src/pipeline/src/etl/processor/cmcd.rs
D4 · Members sharing a duplicated core (11 members, 50+ identical tokens) src/catalog/src/system_schema/information_schema/cluster_info.rs
D4 · Members sharing a duplicated core (8 members, 50+ identical tokens) src/table/src/metadata.rs
D4 · Members sharing a duplicated core (5 members, 50+ identical tokens) src/cmd/src/datanode.rs
D4 · Members sharing a duplicated core (4 members, 50+ identical tokens) src/cmd/src/bin/query_regression_runner/direct.rs
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 — €320,000–€1,600,000
0.8× (at 60% 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 ~6.6 person-years of build effort (about ~€960,000 to rebuild). Its weakest lens is Security at 47% — 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 0.8× 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 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
Value concentrated against a weak lens · Medium · Value at risk
This is a Very large asset (~6.6 person-years to rebuild), and its weakest lens is Security at 47%. 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: Codify backups + geo-recovery in IaC (snapshot/replication/geo-redundant) to back the DR plan. The rest can wait behind it.
Evidence: priority ranking: top of 5 ranked by impact/effort
→ Codify backups + geo-recovery in IaC (snapshot/replication/geo-redundant) to back the DR plan.
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.)
1704 modules, 5209 dependencies. 12 dependency cycles across 340 modules, marked above the diagonal.
Showing the 40 most-connected modules; 1664 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.
pipeline.etl.transform.transformer.greptime uses datatypes.data_type. Changing datatypes.data_type can break pipeline.etl.transform.transformer.greptime, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
15→11 pipeline.etl.transform.transformer.greptime depends on datatypes.value✕
Type pairs
1 distinct (type in pipeline.etl.transform.transformer.greptime → type in datatypes.value) reference.
pipeline.etl.transform.transformer.greptime uses datatypes.value. Changing datatypes.value can break pipeline.etl.transform.transformer.greptime, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
15→12 pipeline.etl.transform.transformer.greptime depends on cmd.bin.query_regression_runner.model✕
Type pairs
2 distinct (type in pipeline.etl.transform.transformer.greptime → type in cmd.bin.query_regression_runner.model) references.
pipeline.etl.transform.transformer.greptime uses cmd.bin.query_regression_runner.model. Changing cmd.bin.query_regression_runner.model can break pipeline.etl.transform.transformer.greptime, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
15→19 pipeline.etl.transform.transformer.greptime depends on datatypes.schema.column_schemacycle✕
Type pairs
3 distinct (type in pipeline.etl.transform.transformer.greptime → type in datatypes.schema.column_schema) references.
pipeline.etl.transform.transformer.greptime uses datatypes.schema.column_schema. Changing datatypes.schema.column_schema can break pipeline.etl.transform.transformer.greptime, not the reverse.
Position
Above the diagonal — a cycle. Neither module can be changed, tested or deployed independently until one of these dependencies goes.
16→12 tests_fuzz.ir.create_expr depends on cmd.bin.query_regression_runner.model✕
Type pairs
1 distinct (type in tests_fuzz.ir.create_expr → type in cmd.bin.query_regression_runner.model) reference.
tests_fuzz.ir.create_expr uses cmd.bin.query_regression_runner.model. Changing cmd.bin.query_regression_runner.model can break tests_fuzz.ir.create_expr, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
17→14 client.inserter depends on common_time.duration✕
Type pairs
1 distinct (type in client.inserter → type in common_time.duration) reference.
datatypes.schema.column_schema uses pipeline.etl.transform.transformer.greptime. Changing pipeline.etl.transform.transformer.greptime can break datatypes.schema.column_schema, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
20→14 client.client depends on common_time.duration✕
Type pairs
3 distinct (type in client.client → type in common_time.duration) references.
store_api.storage.descriptors uses datatypes.schema.column_schema. Changing datatypes.schema.column_schema can break store_api.storage.descriptors, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
24→21 common_meta.ddl.drop_database depends on common_procedure.procedure✕
Type pairs
4 distinct (type in common_meta.ddl.drop_database → type in common_procedure.procedure) references.
common_meta.ddl.drop_database uses common_procedure.procedure. Changing common_procedure.procedure can break common_meta.ddl.drop_database, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
25→1 store_api.metadata depends on common_error.status_code✕
Type pairs
1 distinct (type in store_api.metadata → type in common_error.status_code) reference.
store_api.metadata uses pipeline.etl.transform.transformer.greptime. Changing pipeline.etl.transform.transformer.greptime can break store_api.metadata, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
25→19 store_api.metadata depends on datatypes.schema.column_schema✕
Type pairs
2 distinct (type in store_api.metadata → type in datatypes.schema.column_schema) references.
store_api.region_request uses pipeline.etl.transform.transformer.greptime. Changing pipeline.etl.transform.transformer.greptime can break store_api.region_request, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
29→23 store_api.region_request depends on store_api.storage.descriptors✕
Type pairs
2 distinct (type in store_api.region_request → type in store_api.storage.descriptors) references.
store_api.region_request uses store_api.storage.descriptors. Changing store_api.storage.descriptors can break store_api.region_request, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
29→25 store_api.region_request depends on store_api.metadata✕
Type pairs
4 distinct (type in store_api.region_request → type in store_api.metadata) references.
mito2.request uses pipeline.etl.transform.transformer.greptime. Changing pipeline.etl.transform.transformer.greptime can break mito2.request, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
34→19 mito2.request depends on datatypes.schema.column_schema✕
Type pairs
1 distinct (type in mito2.request → type in datatypes.schema.column_schema) reference.
mito2.sst.parquet.reader uses pipeline.etl.transform.transformer.greptime. Changing pipeline.etl.transform.transformer.greptime can break mito2.sst.parquet.reader, not the reverse.
Position
Below the diagonal — points down the layering, which is what you want.
35→25 mito2.sst.parquet.reader depends on store_api.metadata✕
Type pairs
2 distinct (type in mito2.sst.parquet.reader → type in store_api.metadata) references.
27 distinct (type in mito2.worker → type in mito2.request) references. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
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
418
High / Critical
A05:2021 — Security Misconfiguration
82
High / Critical
A06:2021 — Vulnerable & Outdated Components
48
High / Critical
A02:2021 — Cryptographic Failures
3
High / Critical
Roadmap
First, codify backups and geo-recovery in infrastructure as code to ensure a robust disaster recovery plan. Next, maintain a clear changelog for every release and enable automated dependency review tools to improve security and hygiene. Finally, immediately resolve the identified leaked secret in the action file and address the yanked dependency to eliminate critical risks.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
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 — 492
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 — 2178
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 — 82
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 41
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. 51 of 57 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 6 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 — 57 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, 2651 of 2752 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 Codecov configuration (codecov.yml) and a coverage step in CI (`cargo llvm-cov`) shows that coverage is collected and tracked in your own CI. The built-in collector has no runner for this ecosystem (.py, .rs, .ts), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`, or lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (`coverage run -m pytest` then `coverage xml`, or lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 4 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 197 test source file(s) (.py, .rs) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.py, .rs, .ts) and this repository declares a Cargo test suite (repository root, 1246 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.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `.github/scripts/query-regression-comment.cjs` produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
AX1 Captive dependencies — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads Microsoft.Extensions.DependencyInjection registrations in C# and Spring beans in Java/Kotlin only, and 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.
P8 Schema migrations — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. The schema may be created by a runner, a deploy script or a config file outside what this check reads, so an absence here is our blind spot rather than a missing migration strategy. The card abstains instead of scoring. You can widen what we reach: if the schema is created and evolved by a tool this check does not name, naming it lets us teach the detector to read it.
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 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 (.gitattributes linguist-generated/vendored, .editorconfig generated_code): none declared — every source file was scored.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D7 Architectural Integrity: Layering is checked against detected/declared rules — an architecture whose boundaries live in convention or in code review, not in a rule a scanner can read, is not enforced here.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D19 Documentation Quality: Documentation quality 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.
D25 ADR Conformance: ADR conformance is the LLM-scored fraction of sampled code that follows recorded decisions — it checks the decisions that were written down and the slices it sampled, not unrecorded rules or the whole tree.
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.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
D44 Platform End-of-Life: The support table is FROZEN, so it goes out of date by losing RECALL: a release that ended support after the table was written is missed until the table is refreshed, and this dimension reading 10 is not evidence that a platform is current. Only platforms the repository DECLARES in a place this pass reads are seen — a runtime named only in a REDACTED (D31's subject), in a CI workflow (D29's), or in a file this pass does not parse (go.mod, a Gemfile ruby directive) is invisible here, which is why a repository declaring none of them abstains rather than scoring. Only frameworks with a PUBLISHED support policy are tracked: React, Flask and Express publish none, so their age cannot be judged and their absence from a report is not a statement that they are supported.
AX10 Code composition: Role is inferred from namespace/folder convention, not semantics — a domain concept living in a folder named "Services" reads as application, and the split is lines-of-code, not business value. The business-logic-share score is a SOFT, FLOORED signal: it contributes to the Architecture lens but is floored at the Critical gate, so an infrastructure-heavy design (a gateway, an ETL, a driver) is legitimately low without being nuked to zero.
AX9 CQS / query purity: Handlers are found by interface/name convention — a query handler using neither is not seen. Mutation is a resolved write/publish invocation (SaveChanges/repository/bus), so a write hidden behind a hand-rolled wrapper, reflection, or a string-keyed service locator resolves to a non-persistence type and isn't flagged; it detects that a query writes state, not whether the write is a legitimate read-side cache update. Clean means "no resolved write/publish in a query body", not a proof of CQS purity.
DM4 Rich vs anemic domain model: Behaviour is detected as state mutation inside a method body — a method that enforces an invariant by validating-and-throwing without mutating reads as a query, and mutation delegated through an interface the scan can't resolve isn't credited; entities with zero public properties still drop out of the population. It detects that state changes, not whether the rule is correct.
DM6 Domain ↔ infrastructure boundary: Infrastructure reached through a hand-rolled wrapper, a domain-named facade, reflection, or a string-keyed service locator resolves to a non-infra type and isn't seen; the body scan is symbol resolution over syntax, not full dataflow. A clean result means "no resolved infra reference in a domain body", not a proof of purity.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (6): D19, D20, D21, D22, D25, 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.
135 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was servers::postgres::types::parameters_to_scalar_values at 131. A further 79 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 Error::status_code at 73 — they are counted neither in the figure above nor in this dimension's score. 39 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold functions was excluded, so the exclusion is disclosed nowhere in the file itself: src/mito2/src/error.rs (Error::status_code at 73), src/operator/src/error.rs (Error::status_code at 59), src/sql/src/statements/statement.rs (Statement::fmt at 53), src/catalog/src/system_schema/information_schema.rs (InformationSchemaProvider::system_table at 45), src/meta-srv/src/error.rs (Error::status_code at 42), and 34 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.
+ 79 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 11 servers finding(s) in Cyclomatic Complexity — start with prometheus.rs (3), handler.rs (2), types.rs. — One of this dimension's main actionable groups (11 warning-level).
Resolve the 6 PromPlanner finding(s) in Cyclomatic Complexity — start with planner.rs (5), set_operator.rs. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 5 ParserContext finding(s) in Cyclomatic Complexity — start with show_parser.rs, parser.rs, trigger.rs. — One of this dimension's main actionable groups (5 warning-level).
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.
+ 171 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 21 mito2 finding(s) in Cognitive Complexity — start with run.rs (2), scan_util.rs (2), series_reader.rs (2). — One of this dimension's main actionable groups (21 warning-level).
Resolve the 18 servers finding(s) in Cognitive Complexity — start with metrics.rs (3), pending_worker.rs (2), handler.rs (2). — One of this dimension's main actionable groups (18 warning-level).
Resolve the 11 PromPlanner finding(s) in Cognitive Complexity — start with planner.rs (8), set_operator.rs (2), island.rs. — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.9 / 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 132 FileTooLong finding(s) in God Classes — start with error.rs (6), handler.rs (4), prom_store.rs (3). — One of this dimension's main actionable groups (132 warning-level).
Resolve the 85 MethodTooLong finding(s) in God Classes — start with planner.rs (8), error.rs (6), task.rs (4). — One of this dimension's main actionable groups (85 warning-level).
Resolve the 46 ClassTooLong finding(s) in God Classes — start with error.rs (8), planner.rs (2), engine.rs (2). — One of this dimension's main actionable groups (46 warning-level).
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.
706 duplicated block group(s) detected. A further 35 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 97 of the 741 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.
+ 152 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 47 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with planner.rs (4), binary.rs (4), jaeger.rs (2). — One of this dimension's main actionable groups (47 warning-level).
Resolve the 45 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with executor.rs (2), alter_parser.rs (2), fuzz_failover_metric_regions.rs (2). — One of this dimension's main actionable groups (45 warning-level).
Resolve the 45 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with authorize.rs (3), table_repart.rs (2), fuzz_repartition_metric_table.rs (2). — One of this dimension's main actionable groups (45 warning-level).
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling7.7 / 10Strong✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
68 production modules (Cargo+npm), 0 dependency cycle(s), 14 unstable depended-on module(s). Read from the build's own module declarations; 9 module(s) off the main sequence, with abstractness counted on 60 of the 68 (the rest declare no modelled class or interface, export only macros, or have no source directory of their own).
Off the main sequence: common-version · ×9
Unstable project cli
Unstable project common-grpc-expr
Unstable project datanode
Unstable project flow
+ 10 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 9 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 1 Unstable project cli finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Unstable project common-grpc-expr finding(s) in Coupling. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 10 Low cohesion finding(s) in Cohesion (LCOM4) — start with test_util.rs, cache.rs, builder.rs. — One of this dimension's main actionable groups (10 warning-level).
Enforce Cohesion (LCOM4) in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d6_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the code respects its intended layering / architecture rules.
Method: Enforcement rung (Prevented/Verified/Documented) per checkable ADR via Roslyn, plus dependency cycles via the engine shared with D5/AX3. Deterministic, exact.
All 24 mechanizable ADR(s) are enforced: 22 by analyzers, 2 by tests. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
✓ On the Gold path — maintain.
Detailed fixes: d7_recommendation.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.
8736 test methods: 8411 unit, 325 integration, 0 BDD, 0 e2e. The JavaScript/TypeScript suite contributes 4 `it`/`test` case(s) across 1 test file(s) declaring at least one; its tier split is read from package names and paths only. The Rust suite contributes 8635 `#[test]` function(s) across 1246 file(s) declaring at least one; its unit/integration split is Cargo's own — 59 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 97 test function(s) across 9 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.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
0 skipped, 0 zero-assertion, no mocking-framework packages referenced (hand-written doubles or no mocking) across 4 tests. Measured on the JavaScript/TypeScript suite only — at least 197 test source file(s) (.py, .rs) went unread, so its test quality is unmeasured and is not in these counts.
What it measures: Whether dependencies are current, secure, and not bloated.
Method: Manifest scan via dotnet list package across all projects; worst-signal-per-package deduction (saturating for vulnerabilities, capped-linear for deprecation/outdated) per KLoC. Exhaustive, deterministic.
39 outdated, 1 yanked direct Cargo dependencies. 122 of 124 direct crates were graded against crates.io (0 not published there, 2 not resolved by a committed REDACTED). Only DIRECT edges are graded: a transitive crate cannot be moved past what its parent's requirement admits, so reporting one would be advice its owner cannot take. A newer release is reported only where this repository's OWN requirement already admits it, so the remedy is `cargo update` and never a manifest edit — which means a release outside the declared range is deliberately NOT charged, because a written-down constraint is a decision rather than a defect. Note that a bare requirement is a CARET, and for a 0.x crate its ceiling is the minor. Whether any crate is UNMAINTAINED is not graded — crates.io publishes no maintenance status, and release age does not stand in for one. Known CVEs in this dependency graph are D30's question, read from REDACTED there.
Yanked release: mysql
Outdated: anyhow · ×39
What to do
Resolve the 1 Yanked release finding(s) in Dependency Hygiene. — One of this dimension's main actionable groups (1 warning-level).
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Enforce REDACTED Scanning in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d13_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the licenses of third-party packages are compatible with your policy.
Method: Third-party package licenses resolved from declared package metadata and checked against the configured policy (allow/deny/copyleft). Deterministic; clean = no incompatible license found at metadata depth.
0 of 1281 shipped crate(s) use a banned license. Licences were resolved from crates.io over the crates a consumer compiles — this repository's REDACTED closed over its manifests' `[dependencies]` and `[build-dependencies]`. Crates it asks for ONLY under `[dev-dependencies]` are excluded: they are not compiled by anything that depends on this repository. A further 56 crate(s) in the closure resolve from git, a path or a private registry and publish no licence this pass can read; they are outside this verdict. This repository publishes itself under Apache-2.0, which is its own choice and is not judged here. ★ COVERAGE OF THIS VERDICT: it grades this repository's crate dependencies and nothing else. The repository also declares package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: src/query/src/promql/planner.rs (27×105=2835); src/frontend/src/instance.rs (30×48=1440); src/operator/src/insert.rs (21×46=966) Repeated repair below the complexity floor: src/mito2/src/compaction/twcs.rs (7 of 12 changes were fixes); src/object-store/src/secure_fs.rs (4 of 7 changes were fixes); src/query/src/analyze.rs (4 of 7 changes were fixes)
Resolve the 72 Hotspot finding(s) in Churn × Complexity Hotspots — start with error.rs (8), engine.rs (3), statement.rs (2). — One of this dimension's main actionable groups (72 warning-level).
Resolve the 11 Repeated repair finding(s) in Churn × Complexity Hotspots — start with twcs.rs, secure_fs.rs, analyze.rs. — One of this dimension's main actionable groups (11 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.1 / 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.
139 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/flow/src/batching_mode/task/test.rs. Counted over 1584 of the 1965 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 · ×10
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.
412 deducted task-comment markers across 786612 LoC (0.1/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 395 TodoComment finding(s) in Explicit Debt — start with planner.rs (15), client.rs (8), engine.rs (7). — One of this dimension's main actionable groups (395 warning-level).
Resolve the 12 FixmeComment finding(s) in Explicit Debt — start with datanode_table.rs (2), timestamp.rs, date.rs. — One of this dimension's main actionable groups (12 warning-level).
Resolve the 5 HackComment finding(s) in Explicit Debt — start with lib.rs, txn.rs, chroot.rs. — One of this dimension's main actionable groups (5 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 root README and the four architecture/Docs markdown files give a clear overview of GreptimeDB as an open-core dual-license project with dual licensing, a roadmap, Slack community, release badges, and links to the user guide, API docs, and the Grafana dashboards repo. The READMEs for each directory (agents/, grafana/, licenses/, tests-fuzz/, tests-integration/) document their own directories rather than the repository as a whole but are well-structured with headings, an overview, installation/usage examples, and cross-references to other docs. The repository's READMEs and architecture/Docs files are clear and complete for their respective directories. The tests/perf/README is a focused query-performance harness documenting its directory (direct SST fixtures, Prometheus remote-write scenarios), while the .github/actions/aliyun-ecs-create/README describes an ECS runner workflow for that directory. All visible documents cover what they claim: the docs/benchmarks/log/, -tsbs/, and -memory-profile-scripts/ READMEs are thorough benchmarks/configure/usage guides; the src/common/runtime/README explains a runtime-throttling feature with code, PR links, and test data; the parquet/basic.parquet README shows schema/data. The visible documents show no missing-overview, installation, or usage content for their directories. The repository is well documented: the READMEs of each directory (e.g. src/common/datasource/tests/orc/, src/frontend/src/instance/otlp/) document their own directories rather than the root repo, and a dedicated architecture-invariants.md covers repo-wide design invariants with detailed examples.
Documentation: no project overview · ×3README.md
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR QualityStrong◐ Sampled · advisory
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.
Evaluated 29 ADR(s) individually; mean quality 8.5/10 (consistently complete and clear). 0 flagged with a specific gap.
What to do
Improve ADR Quality — currently 8.5/10. — Evaluated 29 ADR(s) individually; mean quality 8.5/10 (consistently complete and clear). 0 flagged with a specific gap.
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 ConsistencyWeak◐ 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.
6 API inconsistencies across a 400-member sample of 2878 exposed types.
Redundant constructors with different input types. `try_new` takes raw integers (`i32`) while `new` takes the typed enum (`ColumnDataType`). This forces callers to decide between a fallible constructor for raw data and a fallible constructor for typed data, creating confusion about when to use which.
Duplicate intent for splitting a wrapper into its components. `to_parts` implies borrowing/consuming nothing or cloning, while `into_parts` implies consuming the wrapper. However, since the return type is identical and likely involves cloning or moving data, having both creates API bloat. If `to_parts` clones, it's expensive; if it doesn't, it conflicts with `into_parts` semantics.
Confusingly similar method names `authenticate` vs `auth`. They appear to perform similar authentication logic but with different signatures (one includes catalog/schema context). This suggests a split between low-level credential verification and high-level session establishment, but the naming is inconsistent and `auth` is an abbreviation that clashes with the module name `auth`.
Same naming inconsistency as above: `authenticate_bearer_token` vs `auth_bearer_token`. The signatures also differ in parameters (catalog/schema), indicating different scopes of operation, but the prefix difference (`authenticate_` vs `auth_`) is arbitrary and inconsistent with the rest of the API.
Inconsistent naming for similar helper functions. `auth_mysql` takes raw password bytes (`save_pwd`), while `auth_mysql_with_verifier` takes a pre-computed verifier string. The naming convention is not parallel (one uses `_with_verifier`, the other doesn't use a suffix for the raw byte variant).
+ 1 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 Redundant constructors with different input types. `try_new` takes raw… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Duplicate intent for splitting a wrapper into its components. `to_parts`… finding(s) in Internal API Consistency. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 Confusingly similar method names `authenticate` vs `auth`. They appear… 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 the code actually follows the decisions recorded in the project's ADRs.
Method: Judged by language model at low temperature against ADRs plus a deterministic structural code summary; findings linked to repo-rooted ADR paths for traceability. Advisory.
11 of 71 build units (Cargo) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
1 finding(s): 0 critical, 1 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 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 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).
418 finding(s): 0 critical, 409 high, 9 medium, 0 low. 278 unpinned-GitHub-Actions row(s) are reported here but scored by D36 (supply-chain provenance), which measures that posture as `pinned_actions` — one pinning decision is charged once, not once per lens. semgrep hit a parse error in 10 file(s) — `.github/scripts/find-previous-workflow-artifact.sh` (line 137, line 141, line 158), `.github/scripts/query-regression-comment.cjs` (line 52), `REDACTED` (line 28), `scripts/check-builder-rust-version.sh` (line 57), `src/common/meta/src/cache/flow/table_flownode.rs` (line 117, line 151), … (+5 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 26 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
+ 11 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 40 REDACTED finding(s) charged to Static Analysis (SAST) — the other 278 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once. — One of this dimension's main actionable groups (318 issue-level, 40 of them charged here).
Resolve the 38 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (8), REDACTED (5), REDACTED (4). — One of this dimension's main actionable groups (38 issue-level).
Resolve the 32 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (24), REDACTED (4), REDACTED (4). — One of this dimension's main actionable groups (32 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.
Resolve the 15 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (15). — One of this dimension's main actionable groups (15 warning-level).
Resolve the 10 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (10). — One of this dimension's main actionable groups (10 warning-level).
Resolve the 4 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (4 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 43 High IaC finding(s) in IaC & Container Security — start with REDACTED (39), REDACTED (2), REDACTED. — One of this dimension's main actionable groups (43 issue-level).
Resolve the 27 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (19), REDACTED (6), REDACTED. — One of this dimension's main actionable groups (27 warning-level).
Resolve the 12 Low IaC finding(s) in IaC & Container Security — start with REDACTED (6), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (12 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
71 of 1584 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is src/index/src/bitmap.rs. Counted over 1584 of the 1965 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Orphaned knowledgesrc/index/src/bitmap.rs
Further orphaned files (smaller)
What to do
Resolve the 1 Orphaned knowledge finding(s) in Knowledge Freshness — start with bitmap.rs. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 29 Boundary-crossing change coupling finding(s) in Change Coupling — start with engine.rs (2), REDACTED (2), region_request.rs (2). — One of this dimension's main actionable groups (29 issue-level).
Resolve the 32 Change coupling finding(s) in Change Coupling — start with reader.rs (2), export.rs, csv.rs. — One of this dimension's main actionable groups (32 warning-level).
Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with unordered_scan.rs. — One of this dimension's main actionable groups (1 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.
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
Resolve the 1 No seccomp profile finding(s) in Kernel & Syscall Confinement. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 No AppArmor/SELinux confinement finding(s) in Kernel & Syscall Confinement. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d41_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 1 platform declaration(s) and 0 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.
End-of-life runtime: Rust 1.96
What to do
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does. On this repository the split was taken from the source tree on disk rather than from a loaded .NET workspace, so a file's role is decided by its PATH segments alone — no declared namespace was available to add to the evidence — and generated output is excluded from the census entirely rather than counted as a generated share.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether 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 isolation2.5 / 10Weak✓ 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.
`file-engine` (production) references the test project `common-test-util`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`mito2` (production) references the test project `common-test-util`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
`puffin` (production) references the test project `common-test-util`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
What to do
Remove every production → test project reference: extract any shared test helper into a production support library (which the tests reference), or invert the dependency so the test project depends on production — not the reverse.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model8.0 / 10Strong✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
`DroppedTableLifecycle` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside. — src/common/meta/src/key.rs:477
What to do
Move the domain logic onto the entity (invariant-enforcing `&mut self` commands) instead of a foreign service.
Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
Other · Domain Modelling — Whether the domain layer stays free of infrastructure dependencies — a domain aggregate fused to a persistence ORM (diesel/sea-orm/sqlx) on its own declaration (active-record) couples the domain to infrastructure. The clean-architecture dependency rule.
Method: Roslyn (DDD-gated): domain-layer types scanned for infrastructure usage in member SIGNATURES and inside method/accessor BODIES — resolved calls and object-creations into EF/Marten/HTTP/Mongo/Redis/message-bus types (not just a namespace allowlist). Deterministic, symbol-resolved, exhaustive over domain-layer bodies, DDD-native.
Coverage: Domain layer identified by NAMESPACE heuristic; infrastructure then resolved by symbol in member SIGNATURES and method/accessor BODIES — rename the layer and the check evaporates.
Other · Event Sourcing — Whether the recovery-replay fold is deterministic — state derived purely from each event's own fields, no clock/random/IO on the replay path.
Method: Roslyn syntax scan (event-sourcing gated): Apply/When folds checked for forbidden tokens (DateTime.Now, Guid.NewGuid, Random, IO), stripped of comments/strings. Deterministic, hard fact per fold.
Other · Event Sourcing — Whether domain events stay immutable (private fields, set once) rather than carrying mutable state.
Method: Roslyn scan (event-sourcing gated): persisted events checked for public setters; immutability verified per property/field. Deterministic, hard fact.
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 69 of 73 project(s) that lack one — worth up to 1.9 pts.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
What to do
Add an approval/environment gate (required reviewers / protection rules) before production promotion.
Do you agree with this assessment?
P5 · DR & Backup3.0 / 10Weak✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Codify backups + geo-recovery in IaC (snapshot/replication/geo-redundant) to back the DR plan.
Enable purge protection / soft-delete (and prevent_destroy on critical resources) so data stores can't be lost to an accidental or malicious delete.
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
What to do
Keep a changelog (e.g. Keep-a-Changelog) recording what shipped in each release.
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.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether asynchronous code stays responsive — it avoids sync-over-async blocking (a .NET .Wait()/.GetAwaiter().GetResult(), a time.sleep or blocking HTTP call inside a Python coroutine, a *Sync call inside an async JavaScript function, block_on inside a Rust async fn, runBlocking inside a Kotlin suspend function, block() inside a Reactor publisher) that stalls a thread or event loop and risks deadlock, and, where the code is a reusable library on .NET, awaits with ConfigureAwait(false) so it never captures and stalls its caller's context.
Method: Production-source scan: sync-over-async blocking counted everywhere — .Wait()/.GetAwaiter().GetResult() in .NET; off .NET, read from 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?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 2 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X9 Subsumed condition operand — 2 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 3 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — 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.
Not included — 66 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — 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) — etcd Pulling etcd-tls Pulling minio Pulling zookeeper Error Get "https://registry-1.docker.io/v2/": Forbidden etcd Error context canceled postgres Error context canceled mysql Error context canceled postgres15 Error context canceled minio Error context canceled kafka Error context canceled etcd-tls Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: zookeeper Error Get "https://registry-1.docker.io/v2/": Forbidden etcd Error Get "https://registry-1.docker.io/v2/": Forbidden mysql Error Get "https://registry-1.docker.io/v2/": Forbidden kafka Error context canceled minio Error context canceled postgres Error context canceled 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.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
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.
D27 Navigability — symbol resolution incomplete — navigability not assessed
D32 Data Compliance (PII/GDPR) — 1 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
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.
D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
D8 Code Coverage — Coverage not included — suite not readable by the collector
DM1 Aggregate boundaries — this Rust crate declares no domain aggregate (a struct with private state and its own command methods), so DM1's aggregate-boundary read has no population to be taken over
DM2 Strongly-typed ids — the crate defines newtype typed-ids but declares no domain aggregate that could carry an id — so DM2's adoption ratio has no population to be taken over
DM3 Integration-event coupling — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
DM7 Repository granularity — not applicable: no DDD domain layer was detected (no aggregate, entity or value-object structure), so there is no domain model for this card to grade
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — 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.
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
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P8 Schema migrations — sqlx is declared, but the schema-migration mechanism could not be identified. Our limit, not a verdict on this repository.
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures, or wire coverage collection into CI, to enable this cross-layer check
PF2 Allocation hygiene — Not applicable: Rust spells out every heap allocation and makes borrowed slices (&[T], &str) its ordinary parameter types, so the allocation-aware style this card rewards elsewhere is the language's baseline rather than a rung to climb.
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.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
Boundary-crossing change coupling: table_names.rs ↔ consts.rs src/catalog/src/system_schema/information_schema/table_names.rs— `src/catalog/src/system_schema/information_schema/table_names.rs` (context catalog) and `src/common/catalog/src/consts.rs` (context common) sit in DIFFERENT parts of the tree yet change together 100% of the time (22 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) — 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 22 shared commits counted here, the most recent 3 are `7cbd20a0` fix(mysql): strip leading comments before the federated statement fil…; `cabc2f6c` feat(flow): add information_schema.flow_statistics and SHOW FLOW STAT…; `bbf989ac` feat: support soft-drop recycle bin and UNDROP TABLE (#8546) — run `git show` on any of them.
Boundary-crossing change coupling: engine.rs ↔ test_util.rs src/mito2/src/engine.rs— `src/mito2/src/engine.rs` (context mito2) and `src/query/src/optimizer/test_util.rs` (context query) sit in DIFFERENT parts of the tree yet change together 80% of the time (8 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 8 shared commits counted here, the most recent 3 are `294f19fa` feat(metric-engine): support sync logical regions from source region …; `f7d5c87a` feat: introduce `copy_region_from` for mito engine (#7389); `6b6d1ce7` feat: introduce `remap_manifests` for `RegionEngine` (#7265) — run `git show` on any of them.
Boundary-crossing change coupling: engine.rs ↔ test_util.rs src/file-engine/src/engine.rs— `src/file-engine/src/engine.rs` (context file-engine) and `src/query/src/optimizer/test_util.rs` (context query) sit in DIFFERENT parts of the tree yet change together 80% of the time (8 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 8 shared commits counted here, the most recent 3 are `294f19fa` feat(metric-engine): support sync logical regions from source region …; `f7d5c87a` feat: introduce `copy_region_from` for mito engine (#7389); `6b6d1ce7` feat: introduce `remap_manifests` for `RegionEngine` (#7265) — run `git show` on any of them.
Boundary-crossing change coupling: REDACTED ↔ test_util.rs src/datanode/src/tests.rs— `src/datanode/src/tests.rs` (context datanode) and `src/query/src/optimizer/test_util.rs` (context query) sit in DIFFERENT parts of the tree yet change together 80% of the time (8 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 8 shared commits counted here, the most recent 3 are `294f19fa` feat(metric-engine): support sync logical regions from source region …; `f7d5c87a` feat: introduce `copy_region_from` for mito engine (#7389); `6b6d1ce7` feat: introduce `remap_manifests` for `RegionEngine` (#7265) — run `git show` on any of them.
Boundary-crossing change coupling: region_request.rs ↔ expr_helper.rs src/common/meta/src/ddl/alter_table/region_request.rs— `src/common/meta/src/ddl/alter_table/region_request.rs` (context common) and `src/operator/src/expr_helper.rs` (context operator) sit in DIFFERENT parts of the tree yet change together 73% of the time (11 of the 15 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 11 shared commits counted here, the most recent 3 are `045441e3` feat(json2): support altering JSON2 settings (#9029); `b6cef77a` feat: add `SET DEFAULT` syntax (#6421); `71b564b4` refactor: support multiple index operations in single alter region re… — run `git show` on any of them.
Boundary-crossing change coupling: etcd.rs ↔ metasrv.rs src/common/meta/src/election/etcd.rs— `src/common/meta/src/election/etcd.rs` (context common) and `src/meta-srv/src/metasrv.rs` (context meta-srv) sit in DIFFERENT parts of the tree yet change together 71% of the time (15 of the 21 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 15 shared commits counted here, the most recent 3 are `c8c2e09e` refactor: move election trait and implementations to the `common-meta…; `cb0f1afb` fix: improve network failure detection (#7382) (at that commit the file was still `src/meta-srv/src/election/etcd.rs`); `16febbd4` feat: add CPU, memory and node status info to `cluster_info` (#6897) (at that commit the file was still `src/meta-srv/src/election/etcd.rs`) — run `git show` on any of them.
Boundary-crossing change coupling: copy.rs ↔ requests.rs src/sql/src/statements/copy.rs— `src/sql/src/statements/copy.rs` (context sql) and `src/table/src/requests.rs` (context table) sit in DIFFERENT parts of the tree yet change together 67% of the time (8 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) — 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 8 shared commits counted here, the most recent 3 are `2ad50332` feat: impl COPY a query resultset to external file (#5250); `f93b5b19` feat: limit total rows copied in COPY TABLE FROM with LIMIT segment (…; `16c1ee26` feat: incremental database backup (#1240) — run `git show` on any of them.
Boundary-crossing change coupling: memory.rs ↔ backend.rs src/common/meta/src/kv_backend/memory.rs— `src/common/meta/src/kv_backend/memory.rs` (context common) and `src/log-store/src/raft_engine/backend.rs` (context log-store) sit in DIFFERENT parts of the tree yet change together 64% of the time (9 of the 14 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 9 shared commits counted here, the most recent 3 are `3d9df822` refactor: refactor `PgStore` (#5309); `72897a20` chore: minor refactor on etcd kvbackend (#3940); `a260ba3e` feat: use txn to impl cas (#3936) — run `git show` on any of them.
Boundary-crossing change coupling: seq_scan.rs ↔ parallelize_scan.rs src/mito2/src/read/seq_scan.rs— `src/mito2/src/read/seq_scan.rs` (context mito2) and `src/query/src/optimizer/parallelize_scan.rs` (context query) sit in DIFFERENT parts of the tree yet change together 64% of the time (7 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) — 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 `b32ca3ad` perf: parallelize file source region (#7285); `73ca39f3` feat: time series distribution in scanner (#5675); `2fcb95f5` fix!: fix regression caused by unbalanced partitions and splitting ra… — run `git show` on any of them.
Boundary-crossing change coupling: builder.rs ↔ options.rs src/frontend/src/instance/builder.rs— `src/frontend/src/instance/builder.rs` (context instance) and `src/standalone/src/options.rs` (context standalone) sit in DIFFERENT parts of the tree yet change together 64% of the time (7 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) — 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 `953d01ac` feat: support pending rows batching for MySQL and PostgreSQL (#9302); `723da69b` feat: share logical table batching with OTLP metrics (#9288); `263e2291` feat: add experimental Metric export to V2 snapshots (#9233) — run `git show` on any of them.
Boundary-crossing change coupling: REDACTED ↔ engine.rs src/datanode/src/tests.rs— `src/datanode/src/tests.rs` (context datanode) and `src/file-engine/src/engine.rs` (context file-engine) sit in DIFFERENT parts of the tree yet change together 62% of the time (13 of the 21 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 13 shared commits counted here, the most recent 3 are `294f19fa` feat(metric-engine): support sync logical regions from source region …; `f7d5c87a` feat: introduce `copy_region_from` for mito engine (#7389); `6b6d1ce7` feat: introduce `remap_manifests` for `RegionEngine` (#7265) — run `git show` on any of them.
Boundary-crossing change coupling: region_request.rs ↔ alter_parser.rs src/common/meta/src/ddl/alter_table/region_request.rs— `src/common/meta/src/ddl/alter_table/region_request.rs` (context common) and `src/sql/src/parsers/alter_parser.rs` (context sql) sit in DIFFERENT parts of the tree yet change together 60% of the time (9 of the 15 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 9 shared commits counted here, the most recent 3 are `045441e3` feat(json2): support altering JSON2 settings (#9029); `b6cef77a` feat: add `SET DEFAULT` syntax (#6421); `438791b3` feat: Add `DROP DEFAULT` (#6290) — run `git show` on any of them.
Boundary-crossing change coupling: upgrade_region.rs ↔ upgrade_candidate_region.rs src/datanode/src/heartbeat/handler/upgrade_region.rs— `src/datanode/src/heartbeat/handler/upgrade_region.rs` (context datanode) and `src/meta-srv/src/procedure/region_migration/upgrade_candidate_region.rs` (context meta-srv) sit in DIFFERENT parts of the tree yet 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) — 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 6 shared commits counted here, the most recent 3 are `6960a018` refactor: add support for batch region upgrade operations part1 (#7155); `7cf47ccf` fix: initialize remote WAL regions with correct flushed entry IDs (#6…; `5a36fa5e` fix: alway rejects write while downgrading region (#5842) — run `git show` on any of them.
Boundary-crossing change coupling: objbench.rs ↔ write_cache.rs src/cmd/src/datanode/objbench.rs— `src/cmd/src/datanode/objbench.rs` (context cmd) and `src/mito2/src/cache/write_cache.rs` (context mito2) sit in DIFFERENT parts of the tree yet 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) — 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 6 shared commits counted here, the most recent 3 are `f5212d36` feat(mito2): add write cache upload hook (#8992); `abf46234` refactor: store the schema of flat source (#8091); `e215851c` refactor: unify flush and compaction to always use FlatSource (#7799) — run `git show` on any of them.
Boundary-crossing change coupling: test_util.rs ↔ builder.rs src/common/meta/src/test_util.rs— `src/common/meta/src/test_util.rs` (context common) and `src/meta-srv/src/metasrv/builder.rs` (context meta-srv) sit in DIFFERENT parts of the tree yet change together 57% of the time (12 of the 21 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 12 shared commits counted here, the most recent 3 are `5065dfcf` feat: grant creators access to newly created databases (#8566); `4873fc4f` feat(meta): add retention GC for soft-dropped tables (#8526); `3758911a` feat: add soft-drop table recovery procedures (#8061) — run `git show` on any of them.
Boundary-crossing change coupling: scan_region.rs ↔ parallelize_scan.rs src/mito2/src/read/scan_region.rs— `src/mito2/src/read/scan_region.rs` (context mito2) and `src/query/src/optimizer/parallelize_scan.rs` (context query) sit in DIFFERENT parts of the tree yet 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) — 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 6 shared commits counted here, the most recent 3 are `0c30bf1a` feat: add a subcommand to bench scan (#7722); `73ca39f3` feat: time series distribution in scanner (#5675); `2fcb95f5` fix!: fix regression caused by unbalanced partitions and splitting ra… — run `git show` on any of them.
Boundary-crossing change coupling: jaeger.rs ↔ v0.rs src/frontend/src/instance/jaeger.rs— `src/frontend/src/instance/jaeger.rs` (context instance) and `src/servers/src/otlp/trace/v0.rs` (context servers) sit in DIFFERENT parts of the tree yet 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) — 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 6 shared commits counted here, the most recent 3 are `6caff50d` chore: improve search traces and jaeger resp (#7166); `0a396192` refactor!: add a `opentelemetry_traces_operations` table to aggregate…; `ee4fe9d2` refactor: improve performance for Jaeger APIs (#5838) — run `git show` on any of them.
Boundary-crossing change coupling: key_column_usage.rs ↔ sql.rs src/catalog/src/system_schema/information_schema/key_column_usage.rs— `src/catalog/src/system_schema/information_schema/key_column_usage.rs` (context catalog) and `src/query/src/sql.rs` (context query) sit in DIFFERENT parts of the tree yet 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) — 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 6 shared commits counted here, the most recent 3 are `ca21c9f0` fix!: correct information_schema index metadata (#8275); `e403133e` feat: add information_schema statistics table (#8253); `8d485e9b` feat: support altering fulltext backend (#5896) — run `git show` on any of them.
Boundary-crossing change coupling: flush.rs ↔ region.rs src/metric-engine/src/engine/flush.rs— `src/metric-engine/src/engine/flush.rs` (context metric-engine) and `src/mito2/src/region.rs` (context mito2) sit in DIFFERENT parts of the tree yet 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) — 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 6 shared commits counted here, the most recent 3 are `28e2b5ac` feat: expose missing SST manifest fields (#8965); `a6dc55a7` feat: show sst primary key range in information_schema (#8137); `4c70b4c3` feat: store estimated series num in file meta (#7126) — run `git show` on any of them.
Boundary-crossing change coupling: copy_parser.rs ↔ requests.rs src/sql/src/parsers/copy_parser.rs— `src/sql/src/parsers/copy_parser.rs` (context sql) and `src/table/src/requests.rs` (context table) sit in DIFFERENT parts of the tree yet 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) — 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 9 shared commits counted here, the most recent 3 are `2ad50332` feat: impl COPY a query resultset to external file (#5250); `f93b5b19` feat: limit total rows copied in COPY TABLE FROM with LIMIT segment (…; `bba3108e` refactor!: unify sql options into OptionMap (#3792) — run `git show` on any of them.
Boundary-crossing change coupling: metasrv.rs ↔ log_store.rs src/common/wal/src/config/kafka/metasrv.rs— `src/common/wal/src/config/kafka/metasrv.rs` (context common) and `src/log-store/src/kafka/log_store.rs` (context log-store) sit in DIFFERENT parts of the tree yet 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) — 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 9 shared commits counted here, the most recent 3 are `fbdc35a1` ci: add remote WAL logical pruning fuzz (#8307); `2e2eacf3` feat: add SASL and TLS config for Kafka client (#4536); `a0a31c8a` chore(remote_wal): remove topic alias (#3120) (at that commit the file was still `src/common/meta/src/wal/kafka.rs`) — run `git show` on any of them.
Boundary-crossing change coupling: lib.rs ↔ pipeline.rs src/pipeline/src/lib.rs— `src/pipeline/src/lib.rs` (context pipeline) and `src/servers/src/pipeline.rs` (context servers) sit in DIFFERENT parts of the tree yet change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 8 shared commits counted here, the most recent 3 are `fb86f657` feat(pipeline): support table-aware JSON2 transforms (#8964); `7cd6be41` feat(pipeline): introduce pipeline doc version 2 for combine-transfor…; `53c4fd47` chore: add skip error for pipeline skip error log (#6318) — run `git show` on any of them.
Boundary-crossing change coupling: key_values.rs ↔ request.rs src/mito-codec/src/key_values.rs— `src/mito-codec/src/key_values.rs` (context mito-codec) and `src/mito2/src/request.rs` (context mito2) 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 `7341f230` feat: skip filling NULL for put and delete requests (#3364) (at that commit the file was still `src/mito2/src/memtable/key_values.rs`); `d68dd1f3` fix: schema validation is skipped once we need to fill a column (#2548) (at that commit the file was still `src/mito2/src/memtable/key_values.rs`); `21689708` feat: define region server and related requests (#2160) (at that commit the file was still `src/mito2/src/memtable/key_values.rs`) — run `git show` on any of them.
Boundary-crossing change coupling: upgrade_region.rs ↔ handle_catchup.rs src/datanode/src/heartbeat/handler/upgrade_region.rs— `src/datanode/src/heartbeat/handler/upgrade_region.rs` (context datanode) and `src/mito2/src/worker/handle_catchup.rs` (context mito2) 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 `6960a018` refactor: add support for batch region upgrade operations part1 (#7155); `7cf47ccf` fix: initialize remote WAL regions with correct flushed entry IDs (#6…; `163cea81` feat: migrate local WAL regions (#4715) — run `git show` on any of them.
Boundary-crossing change coupling: etcd.rs ↔ cluster.rs src/common/meta/src/election/etcd.rs— `src/common/meta/src/election/etcd.rs` (context common) and `src/meta-srv/src/service/cluster.rs` (context meta-srv) 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 `c8c2e09e` refactor: move election trait and implementations to the `common-meta…; `16febbd4` feat: add CPU, memory and node status info to `cluster_info` (#6897) (at that commit the file was still `src/meta-srv/src/election/etcd.rs`); `7de62ef5` feat: add metasrv start time to node info (#3883) (at that commit the file was still `src/meta-srv/src/election/etcd.rs`) — run `git show` on any of them.
AX8 · Test isolation· Production project references a test project · ×3
Production project references a test project: file-engine → common-test-util — `file-engine` (production) references the test project `common-test-util`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: mito2 → common-test-util — `mito2` (production) references the test project `common-test-util`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Production project references a test project: puffin → common-test-util — `puffin` (production) references the test project `common-test-util`. Production must never depend on test code — it pulls a unit-test framework and test fixtures into the shipped product and inverts the only correct direction (tests depend on production, never the reverse). Move any shared helper into a production support library, or invert the reference.
Orphaned knowledge src/index/src/bitmap.rs— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
DM4 · Rich vs anemic domain model· Anemic domain model · ×1
Anemic domain model: DroppedTableLifecycle src/common/meta/src/key.rs:477— `DroppedTableLifecycle` is a data-only domain entity with `pub` mutable state and no invariant-enforcing behaviour of its own, while the repo holds the logic in a foreign service/manager/use-case — the anemic domain model. Move the behaviour onto the entity so it enforces its own invariants (or make it an immutable value object with private fields) rather than being driven from outside.
TodoComment src/api/src/helper.rs:684— // TODO(sunng87): remove this when we finally sunset legacy jsonb — 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 src/api/src/v1/column_def.rs:102— /// TODO(weny): Add tests for this function. — 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 src/cache/src/lib.rs:153— // TODO(weny): Make the cache configurable. — 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 src/catalog/src/table_source.rs:174— // TODO(dennis): check column names — 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 src/catalog/src/lib.rs:37— // TODO(j0hn50n133): re-export to make it compatible with the legacy code, migrate to the new path later — 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 src/catalog/src/kvbackend/manager.rs:569— // TODO: This struct can hold a static map of all system tables when — 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 src/catalog/src/kvbackend/client.rs:128— // TODO(hl): txn of CachedKvBackend simply pass through to inner backend without invalidating caches. — 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 src/catalog/src/kvbackend/client.rs:287— // TODO(fys): change to moka method when 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 src/catalog/src/system_schema/predicate.rs:26— /// TODO(dennis): supports more predicate types. — 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 src/catalog/src/system_schema/information_schema/tables.rs:261— // TODO(dennis): `region_stats` API is not stable in distributed cluster because of network issue etc. — 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 src/catalog/src/system_schema/information_schema/tables.rs:391— // TODO(sunng87): use real data for these fields — 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 src/catalog/src/system_schema/information_schema/process_list.rs:124— // todo(hl): find a way to extract user catalog to filter queries from other users. — 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 src/catalog/src/system_schema/information_schema/partitions.rs:383— // TODO(dennis): rows and index statistics info — 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 src/catalog/src/system_schema/information_schema/partitions.rs:391— // TODO(dennis): supports update_time — 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 src/catalog/src/system_schema/information_schema/key_column_usage.rs:283— // TODO(dimbtp): Foreign key constraint has not `None` value for last 4 — 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 src/catalog/src/system_schema/information_schema/information_memory_table.rs:50— // TODO(dennis): It must be a JSON type, but we don't support it 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 src/catalog/src/system_schema/information_schema/information_memory_table.rs:290— // TODO: _Must_ reimplement this table when foreign key constraint is supported. — 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 src/catalog/src/system_schema/information_schema/information_memory_table.rs:368— // TODO: Considering store internal metrics in `global_status` and — 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 src/catalog/src/system_schema/information_schema/flows.rs:102— /// TODO(discord9): use a better way to store complex fields like json type — 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 src/catalog/src/system_schema/information_schema/flows.rs:297— // TODO(discord9): use `AsyncIterator` once it's stable-ish — 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 src/cli/src/bench.rs:210— // TODO(niebayes): construct region wal options for benchmark. — 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 src/cli/src/data/import_v2/coordinator.rs:87— // TODO: build a per-chunk schema index if chunk file manifests become large. — 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 src/client/src/database.rs:822— // TODO(Taylor-lagrange): add client grpc 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 src/client/src/client.rs:518— // todo(hl): support compression methods. — 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 src/cmd/src/options.rs:40— // TODO(LFC): Move logging and tracing options into global options, like the runtime options. — 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: promql/planner.rs src/query/src/promql/planner.rs— FileTooLong — 4344 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 96% of them inside a single declaration: PromPlanner (2 blocks, 284-6258). The bar is 500 significant lines; this is 3844 over it, 8.69× 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: statement/ddl.rs src/operator/src/statement/ddl.rs— FileTooLong — 2092 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 70% of them inside a single declaration: StatementExecutor (337-2385). The bar is 500 significant lines; this is 1592 over it, 4.18× 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: functions/native_histogram.rs src/promql/src/functions/native_histogram.rs— FileTooLong — 2064 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 38 free functions. The bar is 500 significant lines; this is 1564 over it, 4.13× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: http/prometheus.rs src/servers/src/http/prometheus.rs— FileTooLong — 1751 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 49 free functions. The bar is 500 significant lines; this is 1251 over it, 3.50× 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: parquet/reader.rs src/mito2/src/sst/parquet/reader.rs— FileTooLong — 1571 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 1071 over it, 3.14× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: batching_mode/task.rs src/flow/src/batching_mode/task.rs— FileTooLong — 1516 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 85% of them inside a single declaration: BatchingTask (2 blocks, 293-2220). The bar is 500 significant lines; this is 1016 over it, 3.03× 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: otlp/trace_ingest.rs src/frontend/src/instance/otlp/trace_ingest.rs— FileTooLong — 1462 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 962 over it, 2.92× 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/insert.rs src/operator/src/insert.rs— FileTooLong — 1429 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 73% of them inside a single declaration: Inserter (3 blocks, 97-1711). The bar is 500 significant lines; this is 929 over it, 2.86× 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: read/scan_region.rs src/mito2/src/read/scan_region.rs— FileTooLong — 1398 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 898 over it, 2.80× 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/region_server.rs src/datanode/src/region_server.rs— FileTooLong — 1379 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 879 over it, 2.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/instance.rs src/frontend/src/instance.rs— FileTooLong — 1304 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 71% of them inside a single declaration: Instance (7 blocks, 126-1583). The bar is 500 significant lines; this is 804 over it, 2.61× 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/cache.rs src/mito2/src/cache.rs— FileTooLong — 1303 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 803 over it, 2.61× 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/region_request.rs src/store-api/src/region_request.rs— FileTooLong — 1295 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 795 over it, 2.59× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: batching_mode/utils.rs src/flow/src/batching_mode/utils.rs— FileTooLong — 1288 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 788 over it, 2.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/error.rs src/mito2/src/error.rs— FileTooLong — 1268 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 98% of them inside a single declaration: Error (3 blocks, 46-1706). The bar is 500 significant lines; this is 768 over it, 2.54× 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: rpc/ddl.rs src/common/meta/src/rpc/ddl.rs— FileTooLong — 1248 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 748 over it, 2.50× 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/key.rs src/common/meta/src/key.rs— FileTooLong — 1214 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 71% of them inside a single declaration: TableMetadataManager (2 blocks, 394-1807). The bar is 500 significant lines; this is 714 over it, 2.43× 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/value.rs src/datatypes/src/value.rs— FileTooLong — 1198 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 698 over it, 2.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: object_store_wal/store.rs src/log-store/src/object_store_wal/store.rs— FileTooLong — 1178 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 678 over it, 2.36× 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/ddl_manager.rs src/common/meta/src/ddl_manager.rs— FileTooLong — 1147 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 647 over it, 2.29× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/native_histogram.rs src/common/query/src/native_histogram.rs— FileTooLong — 1144 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 37 free functions. The bar is 500 significant lines; this is 644 over it, 2.29× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/metadata.rs src/table/src/metadata.rs— FileTooLong — 1139 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 75% of them inside a single declaration: TableMeta (4 blocks, 137-1410). The bar is 500 significant lines; this is 639 over it, 2.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: src/sql.rs src/query/src/sql.rs— FileTooLong — 1136 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 49 free functions. The bar is 500 significant lines; this is 636 over it, 2.27× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: bulk/part.rs src/mito2/src/memtable/bulk/part.rs— FileTooLong — 1125 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 625 over it, 2.25× 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/region.rs src/mito2/src/region.rs— FileTooLong — 1122 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 622 over it, 2.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.
MethodTooLong: PromPlanner.or_operator src/query/src/promql/planner/set_operator.rs:43— MethodTooLong — or_operator runs 468 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 368 over it, 4.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PromPlanner.create_function_expr src/query/src/promql/planner.rs:3278— MethodTooLong — create_function_expr runs 423 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 323 over it, 4.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ScanbenchCommand.run src/cmd/src/datanode/scanbench.rs:771— MethodTooLong — run runs 421 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 321 over it, 4.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PromPlanner.prom_binary_expr_to_plan src/query/src/promql/planner.rs:934— MethodTooLong — prom_binary_expr_to_plan runs 398 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 298 over it, 3.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: MetasrvBuilder.build src/meta-srv/src/metasrv/builder.rs:207— MethodTooLong — build runs 347 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 247 over it, 3.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ParquetbenchCommand.run src/cmd/src/datanode/parquetbench.rs:166— MethodTooLong — run runs 255 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 155 over it, 2.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Inserter.create_or_alter_tables_on_demand src/operator/src/insert.rs:1041— MethodTooLong — create_or_alter_tables_on_demand 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.
MethodTooLong: StartCommand.build_with src/cmd/src/standalone.rs:478— MethodTooLong — build_with 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.
MethodTooLong: MergeScanExec.to_stream src/query/src/dist_plan/merge_scan.rs:620— MethodTooLong — to_stream 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: ParquetReaderBuilder.build_reader_input_inner src/mito2/src/sst/parquet/reader.rs:432— MethodTooLong — build_reader_input_inner 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: ObjbenchCommand.run src/cmd/src/datanode/objbench.rs:70— MethodTooLong — run 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: StatementExecutor.execute_sql src/operator/src/statement.rs:248— MethodTooLong — execute_sql runs 200 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StatementExecutor.repartition_table src/operator/src/statement/ddl.rs:1692— MethodTooLong — repartition_table runs 193 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Inserter.handle_bulk_insert src/operator/src/bulk_insert.rs:126— MethodTooLong — handle_bulk_insert 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.
MethodTooLong: BatchingEngine.create_flow_inner src/flow/src/batching_mode/engine.rs:558— MethodTooLong — create_flow_inner runs 175 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 75 over it, 1.75× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FrontendBuilder.try_build src/frontend/src/instance/builder.rs:188— MethodTooLong — try_build runs 174 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 74 over it, 1.74× 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: Instance.do_query src/frontend/src/instance/grpc.rs:64— MethodTooLong — do_query runs 174 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 74 over it, 1.74× 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: PromPlanner.create_table_scan_plan src/query/src/promql/planner.rs:2762— MethodTooLong — create_table_scan_plan runs 169 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BatchingTask.gen_query_with_time_window_with_values src/flow/src/batching_mode/task.rs:1994— MethodTooLong — gen_query_with_time_window_with_values runs 166 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 66 over it, 1.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MysqlResultWriter.write_recordbatch src/servers/src/mysql/writer.rs:226— MethodTooLong — write_recordbatch runs 163 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 63 over it, 1.63× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: HeartbeatTask.start src/datanode/src/heartbeat.rs:215— MethodTooLong — start runs 160 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 60 over it, 1.60× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RegionOpener.maybe_open src/mito2/src/region/opener.rs:508— MethodTooLong — maybe_open runs 158 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 58 over it, 1.58× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PromPlanner.join_on_non_field_columns src/query/src/promql/planner.rs:5609— MethodTooLong — join_on_non_field_columns 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.
MethodTooLong: Error.status_code src/mito2/src/error.rs:1434— MethodTooLong — status_code runs 153 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PromPlanner.prom_aggr_expr_to_plan src/query/src/promql/planner.rs:532— MethodTooLong — prom_aggr_expr_to_plan runs 153 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Hotspot: src/query/src/promql/planner.rs src/query/src/promql/planner.rs:3278— src/query/src/promql/planner.rs changed 27 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 105 in PromPlanner::create_function_expr at line 3278. 12 of those changes were fix/bug commits, and the other 15 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/query/src/promql/planner.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: src/frontend/src/instance.rs src/frontend/src/instance.rs:1596— src/frontend/src/instance.rs changed 30 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in frontend::instance::check_permission at line 1596. 8 of those changes were fix/bug commits, and the other 22 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/frontend/src/instance.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: src/operator/src/insert.rs src/operator/src/insert.rs:1041— src/operator/src/insert.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 46 in Inserter::create_or_alter_tables_on_demand at line 1041. 2 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/operator/src/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: src/servers/src/postgres/types.rs src/servers/src/postgres/types.rs:556— src/servers/src/postgres/types.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 131 in servers::postgres::types::parameters_to_scalar_values at line 556. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/servers/src/postgres/types.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: src/operator/src/statement.rs src/operator/src/statement.rs:248— src/operator/src/statement.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in StatementExecutor::execute_sql at line 248. 3 of those changes were fix/bug commits, and the other 11 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/operator/src/statement.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: src/operator/src/error.rs src/operator/src/error.rs:980— src/operator/src/error.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 59 in Error::status_code at line 980. 1 of those changes was a fix/bug commit, 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/operator/src/error.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/mito2/src/error.rs src/mito2/src/error.rs:1434— src/mito2/src/error.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 73 in Error::status_code at line 1434. 2 of those changes were fix/bug commits, and the other 7 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/mito2/src/error.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/mito2/src/sst/parquet/reader.rs src/mito2/src/sst/parquet/reader.rs:432— src/mito2/src/sst/parquet/reader.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in ParquetReaderBuilder::build_reader_input_inner at line 432. 3 of those changes were fix/bug commits, and the other 19 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/mito2/src/sst/parquet/reader.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: src/query/src/dist_plan/merge_scan.rs src/query/src/dist_plan/merge_scan.rs:620— src/query/src/dist_plan/merge_scan.rs changed 17 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in MergeScanExec::to_stream at line 620. 10 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/query/src/dist_plan/merge_scan.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: src/operator/src/statement/ddl.rs src/operator/src/statement/ddl.rs:889— src/operator/src/statement/ddl.rs changed 21 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in StatementExecutor::determine_flow_type at line 889. 4 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/operator/src/statement/ddl.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: src/common/query/src/native_histogram.rs src/common/query/src/native_histogram.rs:740— src/common/query/src/native_histogram.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in NativeHistogram::fraction_with_info at line 740. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/common/query/src/native_histogram.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: src/common/meta/src/ddl_manager.rs src/common/meta/src/ddl_manager.rs:933— src/common/meta/src/ddl_manager.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in DdlManager::submit_ddl_task at line 933. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/common/meta/src/ddl_manager.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: src/mito2/src/region/opener.rs src/mito2/src/region/opener.rs:1200— src/mito2/src/region/opener.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in mito2::region::opener::preload_parquet_meta_cache_for_files at line 1200. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/mito2/src/region/opener.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: src/common/meta/src/error.rs src/common/meta/src/error.rs:1174— src/common/meta/src/error.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 36 in Error::status_code at line 1174. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/common/meta/src/error.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/cmd/src/datanode/scanbench.rs src/cmd/src/datanode/scanbench.rs:771— src/cmd/src/datanode/scanbench.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 42 in ScanbenchCommand::run at line 771. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/cmd/src/datanode/scanbench.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: src/mito2/src/worker.rs src/mito2/src/worker.rs:1339— src/mito2/src/worker.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in RegionWorkerLoop::handle_background_notify at line 1339. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/mito2/src/worker.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: src/catalog/src/system_schema/information_schema.rs src/catalog/src/system_schema/information_schema.rs:203— src/catalog/src/system_schema/information_schema.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 45 in InformationSchemaProvider::system_table at line 203. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/catalog/src/system_schema/information_schema.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/meta-srv/src/metasrv/builder.rs src/meta-srv/src/metasrv/builder.rs:207— src/meta-srv/src/metasrv/builder.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in MetasrvBuilder::build at line 207. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/meta-srv/src/metasrv/builder.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/datatypes/src/vectors/json/builder.rs src/datatypes/src/vectors/json/builder.rs:804— src/datatypes/src/vectors/json/builder.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in datatypes::vectors::json::builder::json_variant_into_value at line 804. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/datatypes/src/vectors/json/builder.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/sql/src/statements/statement.rs src/sql/src/statements/statement.rs:239— src/sql/src/statements/statement.rs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 53 in Statement::fmt at line 239. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/sql/src/statements/statement.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: src/promql/src/functions/native_histogram.rs src/promql/src/functions/native_histogram.rs:1568— src/promql/src/functions/native_histogram.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in MixedRangeFunction::parse at line 1568. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/promql/src/functions/native_histogram.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: src/servers/src/error.rs src/servers/src/error.rs:751— src/servers/src/error.rs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in Error::status_code at line 751. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-01..2026-09-29, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-01 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/servers/src/error.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/mito2/src/request.rs src/mito2/src/request.rs:666— src/mito2/src/request.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in WorkerRequest::try_from_region_request at line 666. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/mito2/src/request.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: src/table/src/metadata.rs src/table/src/metadata.rs:357— src/table/src/metadata.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in TableMeta::set_table_options at line 357. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/table/src/metadata.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: src/mito2/src/compaction/compactor.rs src/mito2/src/compaction/compactor.rs:637— src/mito2/src/compaction/compactor.rs changed 11 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in DefaultCompactor::merge_ssts at line 637. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/mito2/src/compaction/compactor.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 (7 lines × 2) src/catalog/src/system_schema/information_schema/flows.rs:164— src/catalog/src/system_schema/information_schema/flows.rs:164-170 | src/query/src/sql.rs:1222-1230 — 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) src/cmd/src/bin/query_regression_runner/remote/ingest.rs:297— src/cmd/src/bin/query_regression_runner/remote/ingest.rs:297-303 | src/cmd/src/bin/query_regression_runner/remote/storage.rs:69-75 — before extracting anything, compare `src/cmd/src/bin/query_regression_runner/remote/ingest.rs` and `src/cmd/src/bin/query_regression_runner/remote/storage.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. If that is what happened, the fix is to keep one copy and have the 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) src/common/function/src/aggrs/vector/avg.rs:89— src/common/function/src/aggrs/vector/avg.rs:89-95 | src/common/function/src/aggrs/vector/product.rs:109-115 — before extracting anything, compare `src/common/function/src/aggrs/vector/avg.rs` and `src/common/function/src/aggrs/vector/product.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) src/common/function/src/scalars/geo/h3.rs:104— src/common/function/src/scalars/geo/h3.rs:104-110 | src/common/function/src/scalars/geo/h3.rs:829-835 — both copies are in the same file, so extract the block into 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) src/common/function/src/scalars/ip/ipv4.rs:86— src/common/function/src/scalars/ip/ipv4.rs:86-92 | src/common/function/src/scalars/ip/ipv6.rs:69-75 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 2) src/common/function/src/scalars/vector.rs:173— src/common/function/src/scalars/vector.rs:173-179 | src/common/function/src/scalars/vector.rs:181-187 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/common/meta/src/cache/flow/table_flownode.rs:113— src/common/meta/src/cache/flow/table_flownode.rs:113-119 | src/common/meta/src/cache/flow/table_flownode.rs:147-153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/common/meta/src/ddl/drop_table.rs:421— src/common/meta/src/ddl/drop_table.rs:421-427 | src/common/meta/src/ddl/truncate_table.rs:97-103 — 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) REDACTED:760— REDACTED:760-766 | REDACTED:802-808 — both copies are in the same file, so extract the block into 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) src/common/meta/src/key/tombstone.rs:418— src/common/meta/src/key/tombstone.rs:418-424 | src/common/meta/src/key/tombstone.rs:470-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 (7 lines × 2) src/flow/src/adapter/flownode_impl.rs:308— src/flow/src/adapter/flownode_impl.rs:308-314 | src/flow/src/server.rs:480-486 — 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) src/flow/src/batching_mode/table_creator.rs:143— src/flow/src/batching_mode/table_creator.rs:143-149 | src/flow/src/batching_mode/table_creator.rs:158-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 (7 lines × 2) src/frontend/src/instance/jaeger.rs:212— src/frontend/src/instance/jaeger.rs:212-218 | src/frontend/src/instance/jaeger.rs:279-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/index/src/fulltext_index/create/tantivy.rs:119— src/index/src/fulltext_index/create/tantivy.rs:119-125 | src/index/src/fulltext_index/create/tantivy.rs:143-149 — both copies are in the same file, so extract the block into 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) src/mito2/src/engine.rs:876— src/mito2/src/engine.rs:876-882 | src/mito2/src/engine.rs:990-996 — both copies are in the same file, so extract the block into 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) src/mito2/src/gc.rs:932— src/mito2/src/gc.rs:932-938 | src/mito2/src/gc.rs:940-946 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/mito2/src/read/seq_scan.rs:288— src/mito2/src/read/seq_scan.rs:288-294 | src/mito2/src/read/series_reader.rs:380-386 — 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) src/mito2/src/region/version.rs:191— src/mito2/src/region/version.rs:191-197 | src/mito2/src/region/version.rs:231-237 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/mito2/src/sst/index/bloom_filter/creator.rs:153— src/mito2/src/sst/index/bloom_filter/creator.rs:153-159 | src/mito2/src/sst/index/inverted_index/creator.rs:148-154 — `src/mito2/src/sst/index/bloom_filter/creator.rs` and `src/mito2/src/sst/index/inverted_index/creator.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 6 separate duplicated blocks between them, totalling at least 63 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 (7 lines × 2) src/mito2/src/sst/index/fulltext_index/applier.rs:631— src/mito2/src/sst/index/fulltext_index/applier.rs:631-637 | src/mito2/src/sst/index/fulltext_index/applier.rs:676-682 — both copies are in the same file, so extract the block into 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) src/mito2/src/sst/parquet/prefilter.rs:118— src/mito2/src/sst/parquet/prefilter.rs:118-124 | src/mito2/src/sst/parquet/prefilter.rs:155-161 — both copies are in the same file, so extract the block into 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) src/query/src/log_query/planner.rs:142— src/query/src/log_query/planner.rs:142-148 | src/query/src/log_query/planner.rs:153-159 — both copies are in the same file, so extract the block into 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) src/query/src/part_sort.rs:1174— src/query/src/part_sort.rs:1174-1180 | src/query/src/part_sort.rs:1190-1196 — both copies are in the same file, so extract the block into 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) src/query/src/promql/planner.rs:1141— src/query/src/promql/planner.rs:1141-1147 | src/query/src/promql/planner.rs:1149-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 (7 lines × 2) src/query/src/sql.rs:954— src/query/src/sql.rs:954-960 | src/query/src/sql.rs:1000-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.
ClassTooLong: PromPlanner src/query/src/promql/planner.rs:284— ClassTooLong — 4160 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 128 methods, 2 blocks, lines 284-6258. The bar is 400 significant lines; this is 3760 over it, 10.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: BatchingTask src/flow/src/batching_mode/task.rs:293— ClassTooLong — 1293 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 54 methods, 2 blocks, lines 293-2220. The bar is 400 significant lines; this is 893 over it, 3.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Error src/mito2/src/error.rs:46— ClassTooLong — 1239 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 3 methods, 3 blocks, lines 46-1706. The bar is 400 significant lines; this is 839 over it, 3.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: Error src/common/meta/src/error.rs:43— ClassTooLong — 1062 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 5 methods, 3 blocks, lines 43-1451. The bar is 400 significant lines; this is 662 over it, 2.66× 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: Error src/meta-srv/src/error.rs:37— ClassTooLong — 1055 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 1 methods, 3 blocks, lines 37-1427. The bar is 400 significant lines; this is 655 over it, 2.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: Inserter src/operator/src/insert.rs:97— ClassTooLong — 1038 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 35 methods, 3 blocks, lines 97-1711. The bar is 400 significant lines; this is 638 over it, 2.60× 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: Instance src/frontend/src/instance.rs:126— ClassTooLong — 929 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 100 methods, 7 blocks, lines 126-1583. The bar is 400 significant lines; this is 529 over it, 2.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Error src/operator/src/error.rs:34— ClassTooLong — 886 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods, 2 blocks, lines 34-1204. The bar is 400 significant lines; this is 486 over it, 2.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TableMetadataManager src/common/meta/src/key.rs:394— ClassTooLong — 863 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 49 methods, 2 blocks, lines 394-1807. The bar is 400 significant lines; this is 463 over it, 2.16× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TableMeta src/table/src/metadata.rs:137— ClassTooLong — 859 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 23 methods, 4 blocks, lines 137-1410. The bar is 400 significant lines; this is 459 over it, 2.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: ParquetReaderBuilder src/mito2/src/sst/parquet/reader.rs:187— ClassTooLong — 856 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 31 methods, 2 blocks, lines 187-1413. The bar is 400 significant lines; this is 456 over it, 2.14× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Error src/pipeline/src/error.rs:27— ClassTooLong — 803 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods, 2 blocks, lines 27-1039. The bar is 400 significant lines; this is 403 over it, 2.01× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Error src/servers/src/error.rs:41— ClassTooLong — 664 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 0 methods, 4 blocks, lines 41-964. The bar is 400 significant lines; this is 264 over it, 1.66× 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: BatchingEngine src/flow/src/batching_mode/engine.rs:67— ClassTooLong — 646 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, 5 blocks, lines 67-1096. The bar is 400 significant lines; this is 246 over it, 1.62× 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: BatchGcProcedure src/meta-srv/src/gc/procedure.rs:219— ClassTooLong — 622 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 3 blocks, lines 219-1155. The bar is 400 significant lines; this is 222 over it, 1.56× 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: LocalGcWorker src/mito2/src/gc.rs:189— ClassTooLong — 608 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 13 methods, 3 blocks, lines 189-1140. The bar is 400 significant lines; this is 208 over it, 1.52× 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: DdlManager src/common/meta/src/ddl_manager.rs:110— ClassTooLong — 591 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 29 methods, 2 blocks, lines 110-1071. The bar is 400 significant lines; this is 191 over it, 1.48× 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: RegionServerInner src/datanode/src/region_server.rs:1041— ClassTooLong — 583 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 1041-1966. The bar is 400 significant lines; this is 183 over it, 1.46× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Value src/datatypes/src/value.rs:52— ClassTooLong — 541 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, 12 blocks, lines 52-1314. The bar is 400 significant lines; this is 141 over it, 1.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: MitoRegion src/mito2/src/region.rs:144— ClassTooLong — 534 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 48 methods, 3 blocks, lines 144-1098. The bar is 400 significant lines; this is 134 over it, 1.34× 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: RegionServer src/datanode/src/region_server.rs:114— ClassTooLong — 533 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, 4 blocks, lines 114-1006. The bar is 400 significant lines; this is 133 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MergeScanExec src/query/src/dist_plan/merge_scan.rs:475— ClassTooLong — 530 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, 6 blocks, lines 475-1372. The bar is 400 significant lines; this is 130 over it, 1.33× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PartSortStream src/query/src/part_sort.rs:350— ClassTooLong — 519 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 24 methods, 5 blocks, lines 350-1239. The bar is 400 significant lines; this is 119 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: HttpServer src/servers/src/http.rs:194— ClassTooLong — 503 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, 4 blocks, lines 194-1705. The bar is 400 significant lines; this is 103 over it, 1.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: MitoEngine src/mito2/src/engine.rs:280— ClassTooLong — 498 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, 5 blocks, lines 280-1664. The bar is 400 significant lines; this is 98 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (10 lines × 2) src/cli/src/data/export_v2/command.rs:565— src/cli/src/data/export_v2/command.rs:565-574 | src/cli/src/data/export_v2/command.rs:641-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 (10 lines × 2) src/common/function/src/scalars/geo/geohash.rs:111— src/common/function/src/scalars/geo/geohash.rs:111-120 | src/common/function/src/scalars/geo/geohash.rs:212-221 — both copies are in the same file, so extract the block into 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) src/common/function/src/scalars/geo/h3.rs:900— src/common/function/src/scalars/geo/h3.rs:900-909 | src/common/function/src/scalars/geo/h3.rs:959-968 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src/common/function/src/scalars/vector/scalar_add.rs:97— src/common/function/src/scalars/vector/scalar_add.rs:97-106 | src/common/function/src/scalars/vector/scalar_mul.rs:97-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 both call sites, so a change lands once.
Duplicated block (10 lines × 2) src/common/function/src/scalars/vector.rs:128— src/common/function/src/scalars/vector.rs:128-137 | src/common/function/src/scalars/vector.rs:160-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src/common/macro/src/row/into_row.rs:47— src/common/macro/src/row/into_row.rs:47-56 | src/common/macro/src/row/to_row.rs:47-56 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10 lines × 2) src/common/macro/src/range_fn.rs:78— src/common/macro/src/range_fn.rs:78-87 | src/common/macro/src/range_fn.rs:195-204 — both copies are in the same file, so extract the block into 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) src/common/meta/src/ddl/alter_logical_tables/executor.rs:59— src/common/meta/src/ddl/alter_logical_tables/executor.rs:59-68 | src/common/meta/src/reconciliation/reconcile_logical_tables/reconcile_regions.rs:57-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 (10 lines × 2) src/common/meta/src/ddl/drop_table/executor.rs:451— src/common/meta/src/ddl/drop_table/executor.rs:451-460 | src/common/meta/src/ddl/drop_table/executor.rs:530-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 (10 lines × 2) src/common/meta/src/ddl/drop_view.rs:205— src/common/meta/src/ddl/drop_view.rs:205-214 | src/common/meta/src/ddl/truncate_table.rs:81-90 — 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) src/common/procedure/src/local/runner.rs:382— src/common/procedure/src/local/runner.rs:382-391 | src/common/procedure/src/local/runner.rs:394-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) src/common/runtime/src/runtime.rs:165— src/common/runtime/src/runtime.rs:165-174 | src/common/runtime/src/runtime.rs:199-208 — both copies are in the same file, so extract the block into 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) src/flow/src/batching_mode/engine.rs:199— src/flow/src/batching_mode/engine.rs:199-208 | src/flow/src/batching_mode/engine.rs:337-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 (10 lines × 2) src/flow/src/batching_mode/state.rs:606— src/flow/src/batching_mode/state.rs:606-615 | src/flow/src/batching_mode/state.rs:754-763 — both copies are in the same file, so extract the block into 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) src/frontend/src/instance/otlp/trace_ingest.rs:482— src/frontend/src/instance/otlp/trace_ingest.rs:482-492 | src/frontend/src/instance/otlp/trace_ingest.rs:1579-1588 — both copies are in the same file, so extract the block into 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) src/index/src/inverted_index/create/sort/intermediate_rw/codec_v1.rs:77— src/index/src/inverted_index/create/sort/intermediate_rw/codec_v1.rs:77-86 | src/index/src/inverted_index/create/sort/intermediate_rw/codec_v1.rs:90-99 — both copies are in the same file, so extract the block into 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) src/meta-srv/src/procedure/region_migration/downgrade_leader_region.rs:225— src/meta-srv/src/procedure/region_migration/downgrade_leader_region.rs:225-234 | src/meta-srv/src/procedure/region_migration/upgrade_candidate_region.rs:253-262 — before extracting anything, compare `src/meta-srv/src/procedure/region_migration/downgrade_leader_region.rs` and `src/meta-srv/src/procedure/region_migration/upgrade_candidate_region.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) src/mito2/src/memtable/simple_bulk_memtable.rs:109— src/mito2/src/memtable/simple_bulk_memtable.rs:109-118 | src/mito2/src/memtable/time_series.rs:287-297 — 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) src/mito2/src/memtable/time_series.rs:1180— src/mito2/src/memtable/time_series.rs:1180-1189 | src/mito2/src/memtable/time_series.rs:1322-1331 — both copies are in the same file, so extract the block into 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) src/mito2/src/read/scan_util.rs:847— src/mito2/src/read/scan_util.rs:847-856 | src/mito2/src/sst/parquet/reader.rs:1584-1593 — 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) src/mito2/src/read/seq_scan.rs:79— src/mito2/src/read/seq_scan.rs:79-88 | src/mito2/src/read/series_scan.rs:150-159 — 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) src/mito2/src/sst/index/fulltext_index/applier.rs:312— src/mito2/src/sst/index/fulltext_index/applier.rs:312-321 | src/mito2/src/sst/index/fulltext_index/applier.rs:333-342 — both copies are in the same file, so extract the block into 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) src/pipeline/src/etl/processor/digest.rs:150— src/pipeline/src/etl/processor/digest.rs:150-159 | src/pipeline/src/etl/processor/digest.rs:165-174 — both copies are in the same file, so extract the block into 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) src/promql/src/extension_plan/instant_manipulate.rs:522— src/promql/src/extension_plan/instant_manipulate.rs:522-531 | src/promql/src/extension_plan/range_manipulate.rs:530-539 — before extracting anything, compare `src/promql/src/extension_plan/instant_manipulate.rs` and `src/promql/src/extension_plan/range_manipulate.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 2) src/servers/src/prom_remote_write/decode.rs:85— src/servers/src/prom_remote_write/decode.rs:85-94 | src/servers/src/prom_remote_write/decode.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 (8 lines × 2) src/common/function/src/aggrs/approximate/uddsketch.rs:72— src/common/function/src/aggrs/approximate/uddsketch.rs:72-79 | src/common/function/src/aggrs/approximate/uddsketch.rs:92-99 — both copies are in the same file, so extract the block into 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) src/common/function/src/scalars/ip/cidr.rs:92— src/common/function/src/scalars/ip/cidr.rs:92-99 | src/common/function/src/scalars/ip/cidr.rs:231-238 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src/common/macro/src/row/schema.rs:130— src/common/macro/src/row/schema.rs:130-137 | src/common/macro/src/row/schema.rs:171-178 — both copies are in the same file, so extract the block into 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) src/common/query/src/request.rs:109— src/common/query/src/request.rs:109-116 | src/common/query/src/request.rs:225-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 (8 lines × 2) src/datatypes/src/vectors/binary.rs:428— src/datatypes/src/vectors/binary.rs:428-435 | src/datatypes/src/vectors/decimal.rs:232-239 — 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) src/frontend/src/instance/otlp/trace_ingest.rs:536— src/frontend/src/instance/otlp/trace_ingest.rs:536-543 | src/frontend/src/instance/otlp/trace_ingest.rs:1993-2000 — both copies are in the same file, so extract the block into 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) src/meta-srv/src/cluster.rs:240— src/meta-srv/src/cluster.rs:240-247 | src/meta-srv/src/cluster.rs:269-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 (8 lines × 2) src/meta-srv/src/metasrv.rs:807— src/meta-srv/src/metasrv.rs:807-814 | src/standalone/src/information_extension.rs:83-90 — 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) src/meta-srv/src/procedure/region_migration/downgrade_leader_region.rs:234— src/meta-srv/src/procedure/region_migration/downgrade_leader_region.rs:234-241 | src/meta-srv/src/procedure/region_migration/open_candidate_region.rs:180-187 — 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) src/mito2/src/cache/index/bloom_filter_index.rs:189— src/mito2/src/cache/index/bloom_filter_index.rs:189-196 | src/mito2/src/cache/index/inverted_index.rs:159-166 — 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) src/mito2/src/memtable/bulk.rs:651— src/mito2/src/memtable/bulk.rs:651-658 | src/mito2/src/memtable/time_series.rs:430-437 — 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) src/mito2/src/read/scan_util.rs:1433— src/mito2/src/read/scan_util.rs:1433-1440 | src/mito2/src/read/series_reader.rs:421-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 (8 lines × 2) src/mito2/src/worker/handle_write.rs:584— src/mito2/src/worker/handle_write.rs:584-591 | src/mito2/src/worker/handle_write.rs:688-695 — both copies are in the same file, so extract the block into 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) src/partition/src/simplify.rs:249— src/partition/src/simplify.rs:249-256 | src/partition/src/simplify.rs:266-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src/promql/src/extension_plan/instant_manipulate.rs:410— src/promql/src/extension_plan/instant_manipulate.rs:410-417 | src/promql/src/extension_plan/range_manipulate.rs:236-243 — before extracting anything, compare `src/promql/src/extension_plan/instant_manipulate.rs` and `src/promql/src/extension_plan/range_manipulate.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 2) src/query/src/promql/planner.rs:1170— src/query/src/promql/planner.rs:1170-1177 | src/query/src/promql/planner.rs:1178-1185 — both copies are in the same file, so extract the block into 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) src/servers/src/http/authorize.rs:233— src/servers/src/http/authorize.rs:233-240 | src/servers/src/http/authorize.rs:275-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src/sql/src/parsers/alter_parser.rs:209— src/sql/src/parsers/alter_parser.rs:209-216 | src/sql/src/parsers/alter_parser.rs:259-266 — both copies are in the same file, so extract the block into 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) src/store-api/src/sst_entry.rs:178— src/store-api/src/sst_entry.rs:178-185 | src/store-api/src/sst_entry.rs:382-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 (8 lines × 2) src/common/function/src/scalars/geo/h3.rs:1350— src/common/function/src/scalars/geo/h3.rs:1350-1357 | src/common/function/src/scalars/geo/s2.rs:269-276 — 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) src/common/function/src/system/database.rs:90— src/common/function/src/system/database.rs:90-97 | src/common/function/src/system/pg_catalog.rs:113-120 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) src/common/time/src/timestamp.rs:650— src/common/time/src/timestamp.rs:650-657 | src/promql/src/extension_plan.rs:62-69 — 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) src/datatypes/src/vectors/list.rs:312— src/datatypes/src/vectors/list.rs:312-319 | src/datatypes/src/vectors/struct_vector.rs:375-382 — 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) src/common/meta/src/ddl/create_database.rs:272— src/common/meta/src/ddl/create_database.rs:272-279 | src/common/meta/src/ddl/drop_database.rs:168-175 — 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) src/common/meta/src/key/table_repart.rs:231— src/common/meta/src/key/table_repart.rs:231-238 | src/common/meta/src/key/table_route.rs:684-691 — before extracting anything, compare `src/common/meta/src/key/table_repart.rs` and `src/common/meta/src/key/table_route.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 (9 lines × 2) src/cli/src/data/export_v2/command.rs:404— src/cli/src/data/export_v2/command.rs:404-412 | src/cli/src/data/import_v2/command.rs:131-139 — 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) src/cmd/src/datanode/parquetbench.rs:309— src/cmd/src/datanode/parquetbench.rs:309-317 | src/cmd/src/datanode/scanbench.rs:919-927 — 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) src/common/function/src/scalars/geo/geohash.rs:95— src/common/function/src/scalars/geo/geohash.rs:95-103 | src/common/function/src/scalars/geo/h3.rs:194-202 — before extracting anything, compare `src/common/function/src/scalars/geo/geohash.rs` and `src/common/function/src/scalars/geo/h3.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) src/common/function/src/scalars/ip/cidr.rs:82— src/common/function/src/scalars/ip/cidr.rs:82-90 | src/common/function/src/scalars/ip/cidr.rs:220-228 — both copies are in the same file, so extract the block into 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) src/common/meta/src/ddl/drop_table/executor.rs:432— src/common/meta/src/ddl/drop_table/executor.rs:432-440 | src/common/meta/src/ddl/undrop_table.rs:518-526 — 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) src/common/meta/src/key/tombstone.rs:446— src/common/meta/src/key/tombstone.rs:446-454 | src/common/meta/src/key/tombstone.rs:506-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 (9 lines × 2) src/common/meta/src/key.rs:1619— src/common/meta/src/key.rs:1619-1627 | src/common/meta/src/key.rs:1788-1796 — both copies are in the same file, so extract the block into 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) src/common/meta/src/state_store.rs:299— src/common/meta/src/state_store.rs:299-307 | src/common/meta/src/state_store.rs:332-340 — both copies are in the same file, so extract the block into 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) src/flow/src/batching_mode/task.rs:928— src/flow/src/batching_mode/task.rs:928-936 | src/flow/src/batching_mode/task.rs:1066-1074 — both copies are in the same file, so extract the block into 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) src/frontend/src/instance/influxdb.rs:196— src/frontend/src/instance/influxdb.rs:196-204 | src/servers/src/otlp/logs.rs:887-895 — 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) src/meta-srv/src/procedure/repartition.rs:921— src/meta-srv/src/procedure/repartition.rs:921-929 | src/meta-srv/src/procedure/repartition.rs:939-947 — both copies are in the same file, so extract the block into 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) src/metric-engine/src/batch_modifier.rs:71— src/metric-engine/src/batch_modifier.rs:71-79 | src/metric-engine/src/batch_modifier.rs:90-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 (9 lines × 2) src/mito-codec/src/key_values.rs:149— src/mito-codec/src/key_values.rs:149-157 | src/mito-codec/src/key_values.rs:162-170 — both copies are in the same file, so extract the block into 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) src/mito2/src/memtable/bulk/part.rs:185— src/mito2/src/memtable/bulk/part.rs:185-193 | src/mito2/src/memtable/bulk/part.rs:1818-1826 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src/mito2/src/memtable/simple_bulk_memtable.rs:78— src/mito2/src/memtable/simple_bulk_memtable.rs:78-86 | src/mito2/src/memtable/time_series.rs:244-252 — 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) src/mito2/src/read/compat.rs:411— src/mito2/src/read/compat.rs:411-419 | src/mito2/src/read/compat.rs:574-582 — both copies are in the same file, so extract the block into 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) src/mito2/src/region/version.rs:130— src/mito2/src/region/version.rs:130-138 | src/mito2/src/region/version.rs:208-217 — both copies are in the same file, so extract the block into 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) src/mito2/src/sst/index/bloom_filter/applier/builder.rs:173— src/mito2/src/sst/index/bloom_filter/applier/builder.rs:173-181 | src/mito2/src/sst/index/bloom_filter/applier/builder.rs:249-257 — both copies are in the same file, so extract the block into 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) src/mito2/src/sst/index/bloom_filter/applier.rs:219— src/mito2/src/sst/index/bloom_filter/applier.rs:219-227 | src/mito2/src/sst/index/fulltext_index/applier.rs:492-500 — `src/mito2/src/sst/index/bloom_filter/applier.rs` and `src/mito2/src/sst/index/fulltext_index/applier.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 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 2) src/mito2/src/sst/index/bloom_filter/creator.rs:241— src/mito2/src/sst/index/bloom_filter/creator.rs:241-249 | src/mito2/src/sst/index/inverted_index/creator.rs:297-305 — `src/mito2/src/sst/index/bloom_filter/creator.rs` and `src/mito2/src/sst/index/inverted_index/creator.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 6 separate duplicated blocks between them, totalling at least 63 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) src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:212— src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:212-220 | src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:414-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src/query/src/part_sort.rs:1037— src/query/src/part_sort.rs:1037-1045 | src/query/src/part_sort.rs:1100-1108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src/servers/src/batcher/logical_table/tables.rs:304— src/servers/src/batcher/logical_table/tables.rs:304-312 | src/servers/src/batcher/logical_table/tables.rs:405-413 — both copies are in the same file, so extract the block into 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) src/servers/src/http/prometheus.rs:749— src/servers/src/http/prometheus.rs:749-757 | src/servers/src/http/prometheus.rs:1828-1836 — both copies are in the same file, so extract the block into 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) src/servers/src/http/result/csv_result.rs:115— src/servers/src/http/result/csv_result.rs:115-123 | src/servers/src/http/result/json_result.rs:76-84 — 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) src/catalog/src/memory/manager.rs:325— src/catalog/src/memory/manager.rs:325-335 | src/catalog/src/memory/manager.rs:368-378 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src/catalog/src/system_schema/information_schema/region_info.rs:63— src/catalog/src/system_schema/information_schema/region_info.rs:63-73 | src/catalog/src/system_schema/information_schema/region_info.rs:89-99 — both copies are in the same file, so extract the block into 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) src/cmd/src/flownode.rs:307— src/cmd/src/flownode.rs:307-317 | tests-integration/src/cluster.rs:500-510 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) src/common/function/src/aggrs/vector/avg.rs:104— src/common/function/src/aggrs/vector/avg.rs:104-114 | src/common/function/src/aggrs/vector/product.rs:124-134 — before extracting anything, compare `src/common/function/src/aggrs/vector/avg.rs` and `src/common/function/src/aggrs/vector/product.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) src/common/function/src/scalars/string/locate.rs:147— src/common/function/src/scalars/string/locate.rs:147-157 | src/common/function/src/scalars/string/regexp_extract.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) src/common/meta/src/cache/container.rs:203— src/common/meta/src/cache/container.rs:203-213 | src/common/meta/src/cache/container.rs:276-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 (11 lines × 2) src/common/meta/src/ddl/drop_table/executor.rs:420— src/common/meta/src/ddl/drop_table/executor.rs:420-430 | src/common/meta/src/ddl/undrop_table.rs:506-516 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) REDACTED:625— REDACTED:625-635 | REDACTED:431-441 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) src/common/meta/src/kv_backend/rds/mysql.rs:85— src/common/meta/src/kv_backend/rds/mysql.rs:85-95 | src/common/meta/src/kv_backend/rds/postgres.rs:117-127 — before extracting anything, compare `src/common/meta/src/kv_backend/rds/mysql.rs` and `src/common/meta/src/kv_backend/rds/postgres.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) src/common/time/src/range.rs:51— src/common/time/src/range.rs:51-61 | src/common/time/src/range.rs:92-102 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src/datatypes/src/vectors/string.rs:401— src/datatypes/src/vectors/string.rs:401-411 | src/datatypes/src/vectors/string.rs:441-451 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src/frontend/src/service_config/pending_rows_batcher.rs:66— src/frontend/src/service_config/pending_rows_batcher.rs:66-76 | src/frontend/src/service_config/prom_store.rs:70-80 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (11 lines × 2) src/meta-client/src/client/cluster.rs:194— src/meta-client/src/client/cluster.rs:194-204 | src/meta-client/src/client/procedure.rs:228-238 — 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) src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:221— src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:221-231 | src/meta-srv/src/procedure/repartition/group/sync_region.rs:202-212 — before extracting anything, compare `src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs` and `src/meta-srv/src/procedure/repartition/group/sync_region.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/metric-engine/src/engine.rs:250— src/metric-engine/src/engine.rs:250-260 | src/metric-engine/src/engine.rs:263-273 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src/mito2/src/request.rs:678— src/mito2/src/request.rs:678-688 | src/mito2/src/request.rs:693-703 — both copies are in the same file, so extract the block into 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) src/mito2/src/series_index/writer.rs:216— src/mito2/src/series_index/writer.rs:216-226 | src/mito2/src/sst/range_index/writer.rs:209-219 — before extracting anything, compare `src/mito2/src/series_index/writer.rs` and `src/mito2/src/sst/range_index/writer.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) src/mito2/src/sst/index/bloom_filter/creator.rs:202— src/mito2/src/sst/index/bloom_filter/creator.rs:202-212 | src/mito2/src/sst/index/inverted_index/creator.rs:260-270 — `src/mito2/src/sst/index/bloom_filter/creator.rs` and `src/mito2/src/sst/index/inverted_index/creator.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 6 separate duplicated blocks between them, totalling at least 63 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 × 2) src/mito2/src/sst/index/fulltext_index/applier.rs:666— src/mito2/src/sst/index/fulltext_index/applier.rs:666-676 | src/mito2/src/sst/index/fulltext_index/applier.rs:683-693 — both copies are in the same file, so extract the block into 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) src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:227— src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:227-237 | src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:429-439 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src/promql/src/extension_plan/instant_manipulate.rs:186— src/promql/src/extension_plan/instant_manipulate.rs:186-196 | src/promql/src/extension_plan/normalize.rs:140-150 — before extracting anything, compare `src/promql/src/extension_plan/instant_manipulate.rs` and `src/promql/src/extension_plan/normalize.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) src/promql/src/extension_plan/instant_manipulate.rs:655— src/promql/src/extension_plan/instant_manipulate.rs:655-665 | src/promql/src/extension_plan/normalize.rs:500-510 — before extracting anything, compare `src/promql/src/extension_plan/instant_manipulate.rs` and `src/promql/src/extension_plan/normalize.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) src/servers/src/mysql/handler.rs:643— src/servers/src/mysql/handler.rs:643-653 | src/servers/src/mysql/handler.rs:659-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.
Duplicated block (11 lines × 2) src/servers/src/postgres/types.rs:1221— src/servers/src/postgres/types.rs:1221-1231 | src/servers/src/postgres/types.rs:1333-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 (11 lines × 2) src/sql/src/parsers/create_parser.rs:953— src/sql/src/parsers/create_parser.rs:953-963 | src/sql/src/parsers/create_parser.rs:1004-1014 — both copies are in the same file, so extract the block into 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) src/cli/src/data/export.rs:169— src/cli/src/data/export.rs:169-180 | src/cli/src/data/import.rs:100-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (12 lines × 2) src/common/function/src/admin/reconcile_catalog.rs:58— src/common/function/src/admin/reconcile_catalog.rs:58-69 | src/common/function/src/admin/reconcile_database.rs:65-76 — 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) src/common/meta/src/ddl/drop_table/executor.rs:295— src/common/meta/src/ddl/drop_table/executor.rs:295-306 | src/common/meta/src/ddl/drop_table/executor.rs:407-418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) src/common/time/src/range.rs:41— src/common/time/src/range.rs:41-52 | src/common/time/src/range.rs:54-65 — both copies are in the same file, so extract the block into 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) src/common/time/src/range.rs:82— src/common/time/src/range.rs:82-93 | src/common/time/src/range.rs:95-106 — both copies are in the same file, so extract the block into 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) src/index/src/fulltext_index/create/bloom_filter.rs:113— src/index/src/fulltext_index/create/bloom_filter.rs:113-124 | src/mito2/src/sst/index/bloom_filter/creator.rs:420-431 — 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) src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:212— src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:212-223 | src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:201-212 — before extracting anything, compare `src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs` and `src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/mito2/src/config.rs:702— src/mito2/src/config.rs:702-713 | src/mito2/src/config.rs:789-800 — both copies are in the same file, so extract the block into 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) src/mito2/src/engine.rs:829— src/mito2/src/engine.rs:829-840 | src/mito2/src/engine.rs:925-936 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) src/mito2/src/engine.rs:902— src/mito2/src/engine.rs:902-913 | src/mito2/src/engine.rs:1018-1029 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) src/mito2/src/series_index/writer.rs:418— src/mito2/src/series_index/writer.rs:418-429 | src/mito2/src/sst/range_index/writer.rs:441-452 — before extracting anything, compare `src/mito2/src/series_index/writer.rs` and `src/mito2/src/sst/range_index/writer.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 2) src/mito2/src/sst/index/bloom_filter/creator.rs:158— src/mito2/src/sst/index/bloom_filter/creator.rs:158-169 | src/mito2/src/sst/index/bloom_filter/creator.rs:181-192 — both copies are in the same file, so extract the block into 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) src/mito2/src/sst/index/fulltext_index/applier.rs:253— src/mito2/src/sst/index/fulltext_index/applier.rs:253-264 | src/mito2/src/sst/index/fulltext_index/applier.rs:317-328 — both copies are in the same file, so extract the block into 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) src/mito2/src/sst/index/fulltext_index/creator.rs:157— src/mito2/src/sst/index/fulltext_index/creator.rs:157-168 | src/mito2/src/sst/index/fulltext_index/creator.rs:179-190 — both copies are in the same file, so extract the block into 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) src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:303— src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:303-314 | src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:363-374 — both copies are in the same file, so extract the block into 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) src/promql/src/extension_plan/scalar_calculate.rs:450— src/promql/src/extension_plan/scalar_calculate.rs:450-461 | src/promql/src/extension_plan/series_divide.rs:438-449 — 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) src/promql/src/functions/quantile.rs:115— src/promql/src/functions/quantile.rs:115-126 | src/promql/src/functions/quantile.rs:162-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) src/query/src/part_sort.rs:638— src/query/src/part_sort.rs:638-649 | src/query/src/part_sort.rs:885-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 (12 lines × 2) src/servers/src/http/prometheus.rs:738— src/servers/src/http/prometheus.rs:738-749 | src/servers/src/http/prometheus.rs:2372-2383 — both copies are in the same file, so extract the block into 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) src/servers/src/otlp/logs.rs:547— src/servers/src/otlp/logs.rs:547-558 | src/servers/src/otlp/logs.rs:683-694 — both copies are in the same file, so extract the block into 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) src/servers/src/elasticsearch.rs:180— src/servers/src/elasticsearch.rs:180-191 | src/servers/src/elasticsearch.rs:204-215 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) src/session/src/session_config.rs:118— src/session/src/session_config.rs:118-129 | src/session/src/session_config.rs:175-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 (12 lines × 2) src/sql/src/parsers/create_parser/trigger.rs:188— src/sql/src/parsers/create_parser/trigger.rs:188-199 | src/sql/src/parsers/create_parser/trigger.rs:343-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) src/mito2/src/series_index/searcher.rs:209— src/mito2/src/series_index/searcher.rs:209-220 | src/mito2/src/sst/range_index/searcher.rs:122-135 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12 lines × 2) src/promql/src/functions/predict_linear.rs:118— src/promql/src/functions/predict_linear.rs:118-129 | src/promql/src/functions/quantile.rs:149-161 — before extracting anything, compare `src/promql/src/functions/predict_linear.rs` and `src/promql/src/functions/quantile.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/catalog/src/system_schema/information_schema/table_semantics.rs:251— src/catalog/src/system_schema/information_schema/table_semantics.rs:251-263 | src/catalog/src/system_schema/information_schema/tables.rs:155-167 — before extracting anything, compare `src/catalog/src/system_schema/information_schema/table_semantics.rs` and `src/catalog/src/system_schema/information_schema/tables.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) src/catalog/src/system_schema/information_schema/table_semantics.rs:419— src/catalog/src/system_schema/information_schema/table_semantics.rs:419-431 | src/catalog/src/system_schema/information_schema/tables.rs:456-468 — before extracting anything, compare `src/catalog/src/system_schema/information_schema/table_semantics.rs` and `src/catalog/src/system_schema/information_schema/tables.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) src/common/datasource/src/file_format/csv.rs:78— src/common/datasource/src/file_format/csv.rs:78-90 | src/common/datasource/src/file_format/json.rs:56-68 — 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) src/common/function/src/aggrs/vector/product.rs:153— src/common/function/src/aggrs/vector/product.rs:153-165 | src/common/function/src/aggrs/vector/sum.rs:152-164 — before extracting anything, compare `src/common/function/src/aggrs/vector/product.rs` and `src/common/function/src/aggrs/vector/sum.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) src/common/meta/src/cache/container.rs:254— src/common/meta/src/cache/container.rs:254-266 | src/common/meta/src/cache/container.rs:330-342 — both copies are in the same file, so extract the block into 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) src/common/meta/src/ddl/create_flow.rs:598— src/common/meta/src/ddl/create_flow.rs:598-610 | src/flow/src/batching_mode/eval_schedule.rs:306-318 — 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) src/common/meta/src/key/flow/flow_route.rs:248— src/common/meta/src/key/flow/flow_route.rs:248-260 | src/common/meta/src/key/flow/table_flow.rs:291-303 — 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) src/common/meta/src/key.rs:796— src/common/meta/src/key.rs:796-808 | src/common/meta/src/key.rs:878-890 — both copies are in the same file, so extract the block into 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) src/common/meta/src/key.rs:790— src/common/meta/src/key.rs:790-802 | src/common/meta/src/key.rs:1732-1744 — both copies are in the same file, so extract the block into 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) src/common/meta/src/kv_backend/rds/mysql.rs:143— src/common/meta/src/kv_backend/rds/mysql.rs:143-155 | src/common/meta/src/kv_backend/rds/postgres.rs:175-187 — before extracting anything, compare `src/common/meta/src/kv_backend/rds/mysql.rs` and `src/common/meta/src/kv_backend/rds/postgres.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) src/common/meta/src/kv_backend/rds/postgres.rs:321— src/common/meta/src/kv_backend/rds/postgres.rs:321-333 | src/common/meta/src/kv_backend/rds/postgres.rs:352-364 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) src/common/version/src/lib.rs:36— src/common/version/src/lib.rs:36-48 | src/common/version/src/lib.rs:79-91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) src/meta-srv/src/cluster.rs:85— src/meta-srv/src/cluster.rs:85-97 | src/meta-srv/src/cluster.rs:134-146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) src/meta-srv/src/gc/procedure.rs:71— src/meta-srv/src/gc/procedure.rs:71-83 | src/meta-srv/src/gc/procedure.rs:123-135 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) src/mito2/src/engine.rs:842— src/mito2/src/engine.rs:842-854 | src/mito2/src/engine.rs:938-950 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) src/mito2/src/read/seq_scan.rs:85— src/mito2/src/read/seq_scan.rs:85-97 | src/mito2/src/read/unordered_scan.rs:70-82 — before extracting anything, compare `src/mito2/src/read/seq_scan.rs` and `src/mito2/src/read/unordered_scan.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 2) src/mito2/src/sst/parquet/reader.rs:1170— src/mito2/src/sst/parquet/reader.rs:1170-1182 | src/mito2/src/sst/parquet/reader.rs:1256-1268 — both copies are in the same file, so extract the block into 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) src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:288— src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:288-300 | src/pipeline/src/etl/transform/transformer/greptime/coerce.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) src/query/src/datafusion.rs:675— src/query/src/datafusion.rs:675-687 | src/query/src/datafusion.rs:710-722 — both copies are in the same file, so extract the block into 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) src/query/src/promql/planner.rs:1030— src/query/src/promql/planner.rs:1030-1042 | src/query/src/promql/planner.rs:1097-1109 — both copies are in the same file, so extract the block into 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) src/servers/src/http/prometheus.rs:759— src/servers/src/http/prometheus.rs:759-771 | src/servers/src/http/prometheus.rs:1838-1850 — both copies are in the same file, so extract the block into 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) src/servers/src/mysql/handler.rs:553— src/servers/src/mysql/handler.rs:553-565 | src/servers/src/mysql/handler.rs:630-642 — both copies are in the same file, so extract the block into 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) src/servers/src/postgres/types.rs:1189— src/servers/src/postgres/types.rs:1189-1201 | src/servers/src/postgres/types.rs:1301-1313 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) src/servers/src/postgres/types.rs:1205— src/servers/src/postgres/types.rs:1205-1217 | src/servers/src/postgres/types.rs:1317-1329 — both copies are in the same file, so extract the block into 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) src/sql/src/statements/copy.rs:78— src/sql/src/statements/copy.rs:78-90 | src/sql/src/statements/copy.rs:109-121 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
FunctionTooLong: servers::postgres::types::parameters_to_scalar_values src/servers/src/postgres/types.rs:556— FunctionTooLong — servers::postgres::types::parameters_to_scalar_values runs 606 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 506 over it, 6.06× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: catalog::system_schema::information_schema::information_memory_table::get_schema_columns src/catalog/src/system_schema/information_schema/information_memory_table.rs:30— FunctionTooLong — catalog::system_schema::information_schema::information_memory_table::get_schema_columns runs 311 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 211 over it, 3.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: flow::batching_mode::utils::rewrite_incremental_aggregate_with_sink_merge src/flow/src/batching_mode/utils.rs:631— FunctionTooLong — flow::batching_mode::utils::rewrite_incremental_aggregate_with_sink_merge runs 200 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 100 over it, 2.00× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: servers::http::jaeger::traces_from_records src/servers/src/http/jaeger.rs:764— FunctionTooLong — servers::http::jaeger::traces_from_records 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: operator::expr_helper::to_alter_table_expr src/operator/src/expr_helper.rs:811— FunctionTooLong — operator::expr_helper::to_alter_table_expr runs 159 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 59 over it, 1.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: servers::http::prometheus::label_values_query src/servers/src/http/prometheus.rs:1683— FunctionTooLong — servers::http::prometheus::label_values_query runs 159 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 59 over it, 1.59× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: common_grpc_expr::alter::alter_expr_to_request src/common/grpc-expr/src/alter.rs:165— FunctionTooLong — common_grpc_expr::alter::alter_expr_to_request runs 150 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 50 over it, 1.50× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: promql::functions::native_histogram::native_extrapolated_rate src/promql/src/functions/native_histogram.rs:2467— FunctionTooLong — promql::functions::native_histogram::native_extrapolated_rate runs 146 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 46 over it, 1.46× 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: common_telemetry::logging::init_global_logging src/common/telemetry/src/logging.rs:450— FunctionTooLong — common_telemetry::logging::init_global_logging runs 142 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 42 over it, 1.42× 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: mito2::flush::memtable_flat_sources src/mito2/src/flush.rs:910— FunctionTooLong — mito2::flush::memtable_flat_sources runs 142 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 42 over it, 1.42× 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: servers::http::handler::sql_analyze_stream src/servers/src/http/handler.rs:293— FunctionTooLong — servers::http::handler::sql_analyze_stream runs 139 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 39 over it, 1.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.
FunctionTooLong: common_macro::admin_fn::build_struct src/common/macro/src/admin_fn.rs:156— FunctionTooLong — common_macro::admin_fn::build_struct runs 138 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 38 over it, 1.38× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: servers::postgres::handler::describe_fields src/servers/src/postgres/handler.rs:566— FunctionTooLong — servers::postgres::handler::describe_fields runs 135 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 35 over it, 1.35× 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: operator::statement::semantic_graph::relationships::calls_branch src/operator/src/statement/semantic_graph/relationships.rs:337— FunctionTooLong — operator::statement::semantic_graph::relationships::calls_branch runs 130 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 30 over it, 1.30× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: common_query::native_histogram::build_histogram_array src/common/query/src/native_histogram.rs:1500— FunctionTooLong — common_query::native_histogram::build_histogram_array runs 129 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 29 over it, 1.29× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: meta_srv::bootstrap::metasrv_builder src/meta-srv/src/bootstrap.rs:286— FunctionTooLong — meta_srv::bootstrap::metasrv_builder runs 126 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 26 over it, 1.26× 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: datanode::utils::build_region_open_requests src/datanode/src/utils.rs:118— FunctionTooLong — datanode::utils::build_region_open_requests runs 124 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 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: servers::otlp::metrics::encode_histogram src/servers/src/otlp/metrics.rs:1216— FunctionTooLong — servers::otlp::metrics::encode_histogram runs 124 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 24 over it, 1.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: cmd::bin::query_regression_runner::remote::read_bench::run_read_bench src/cmd/src/bin/query_regression_runner/remote/read_bench.rs:36— FunctionTooLong — cmd::bin::query_regression_runner::remote::read_bench::run_read_bench runs 122 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 22 over it, 1.22× 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: promql::functions::native_histogram::mixed_range src/promql/src/functions/native_histogram.rs:1735— FunctionTooLong — promql::functions::native_histogram::mixed_range runs 122 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 22 over it, 1.22× 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: servers::pipeline::run_custom_pipeline src/servers/src/pipeline.rs:99— FunctionTooLong — servers::pipeline::run_custom_pipeline runs 119 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 19 over it, 1.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: operator::statement::copy_table_to::stream_to_managed_parquet_with_packed src/operator/src/statement/copy_table_to.rs:262— FunctionTooLong — operator::statement::copy_table_to::stream_to_managed_parquet_with_packed runs 116 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 16 over it, 1.16× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: mito2::memtable::bulk::part::convert_bulk_part src/mito2/src/memtable/bulk/part.rs:991— FunctionTooLong — mito2::memtable::bulk::part::convert_bulk_part runs 115 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 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: sql::util::extract_tables_from_statement src/sql/src/util.rs:211— FunctionTooLong — sql::util::extract_tables_from_statement runs 115 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 15 over it, 1.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pipeline::etl::transform::transformer::greptime::resolve_value src/pipeline/src/etl/transform/transformer/greptime.rs:689— FunctionTooLong — pipeline::etl::transform::transformer::greptime::resolve_value runs 114 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 14 over it, 1.14× 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 (6 lines × 2) src/cmd/src/datanode/objbench.rs:491— src/cmd/src/datanode/objbench.rs:491-496 | src/mito2/src/worker.rs:215-220 — 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) src/cmd/src/datanode/objbench.rs:501— src/cmd/src/datanode/objbench.rs:501-506 | src/mito2/src/worker.rs:225-230 — 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) src/common/function/src/aggrs/vector/avg.rs:97— src/common/function/src/aggrs/vector/avg.rs:97-102 | src/common/function/src/aggrs/vector/product.rs:117-122 — before extracting anything, compare `src/common/function/src/aggrs/vector/avg.rs` and `src/common/function/src/aggrs/vector/product.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (6 lines × 2) src/common/function/src/scalars/vector/scalar_add.rs:90— src/common/function/src/scalars/vector/scalar_add.rs:90-95 | src/common/function/src/scalars/vector/scalar_mul.rs:90-95 — 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) src/common/function/src/flush_flow.rs:81— src/common/function/src/flush_flow.rs:81-86 | src/frontend/src/instance.rs:1792-1797 — 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) src/common/meta/src/key/flow/flow_state.rs:256— src/common/meta/src/key/flow/flow_state.rs:256-261 | src/common/meta/src/key/flow/flow_state.rs:328-333 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src/datatypes/src/value.rs:1247— src/datatypes/src/value.rs:1247-1253 | src/datatypes/src/vectors/helper.rs:149-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 (6 lines × 2) src/mito-codec/src/row_converter/dense.rs:79— src/mito-codec/src/row_converter/dense.rs:79-84 | src/mito-codec/src/row_converter/dense.rs:326-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 (6 lines × 2) src/mito2/src/memtable/simple_bulk_memtable.rs:127— src/mito2/src/memtable/simple_bulk_memtable.rs:127-132 | src/mito2/src/memtable/time_series.rs:261-266 — 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) src/mito2/src/read/flat_merge.rs:829— src/mito2/src/read/flat_merge.rs:829-834 | src/mito2/src/read/flat_merge.rs:984-989 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src/mito2/src/sst/index/bloom_filter/applier/builder.rs:324— src/mito2/src/sst/index/bloom_filter/applier/builder.rs:324-329 | src/mito2/src/sst/index/inverted_index/applier/builder.rs:246-251 — 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) src/promql/src/extension_plan/absent.rs:478— src/promql/src/extension_plan/absent.rs:478-483 | src/promql/src/extension_plan/absent.rs:492-497 — both copies are in the same file, so extract the block into 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) src/query/src/datafusion.rs:220— src/query/src/datafusion.rs:220-225 | src/query/src/datafusion.rs:236-241 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src/query/src/optimizer/count_nest_aggr.rs:291— src/query/src/optimizer/count_nest_aggr.rs:291-296 | src/query/src/optimizer/count_nest_aggr.rs:311-316 — both copies are in the same file, so extract the block into 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) src/servers/src/http/handler.rs:219— src/servers/src/http/handler.rs:219-224 | src/servers/src/http/handler.rs:866-871 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src/servers/src/http/memory_limit.rs:63— src/servers/src/http/memory_limit.rs:63-68 | src/servers/src/http/memory_limit.rs:148-153 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src/sql/src/statements/create.rs:380— src/sql/src/statements/create.rs:380-385 | src/sql/src/statements/create.rs:448-453 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src/cli/src/common/store.rs:129— src/cli/src/common/store.rs:129-134 | src/meta-srv/src/metasrv.rs:421-426 — 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) src/common/batcher/src/flush_limiter.rs:27— src/common/batcher/src/flush_limiter.rs:27-32 | src/common/batcher/src/request_limiter.rs:30-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) src/common/function/src/system/database.rs:58— src/common/function/src/system/database.rs:58-63 | src/common/function/src/system/pg_catalog.rs:89-94 — 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) src/promql/src/functions/aggr_over_time.rs:230— src/promql/src/functions/aggr_over_time.rs:230-235 | src/promql/src/functions/idelta.rs:52-57 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) src/common/function/src/scalars/date/date_add.rs:74— src/common/function/src/scalars/date/date_add.rs:74-79 | src/common/function/src/scalars/date/date_sub.rs:72-77 — 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) src/common/function/src/system/pg_catalog.rs:63— src/common/function/src/system/pg_catalog.rs:63-68 | src/common/function/src/system/timezone.rs:44-49 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) src/common/meta/src/key/catalog_name.rs:101— src/common/meta/src/key/catalog_name.rs:101-106 | src/common/meta/src/key/schema_name.rs:189-194 — 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) src/datatypes/src/vectors/decimal.rs:57— src/datatypes/src/vectors/decimal.rs:57-62 | src/datatypes/src/vectors/primitive.rs:69-74 — 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.
Change coupling: export.rs ↔ import.rs src/cli/src/data/export.rs— `src/cli/src/data/export.rs` and `src/cli/src/data/import.rs` change together 100% of the time (10 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 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 10 shared commits counted here, the most recent 3 are `6adc348f` feat: support parallel table operations in `COPY DATABASE` (#7213); `a049b68c` feat: import backup data from local files (#7180); `11c0381f` chore: set default catalog using build env (#7156) — run `git show` on any of them.
Change coupling: csv.rs ↔ json.rs src/common/datasource/src/file_format/csv.rs— `src/common/datasource/src/file_format/csv.rs` and `src/common/datasource/src/file_format/json.rs` change together 80% of the time (8 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 between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `a35f9d5c` fix: address Windows test failures and run full Windows CI (#9305); `969a64d4` fix(copy): treat null inferred columns as Utf8 to preserve later valu…; `26535f57` feat: enable concurrent write (#3214) — run `git show` on any of them.
Change coupling: reader.rs ↔ REDACTED src/puffin/src/puffin_manager/fs_puffin_manager/reader.rs— `src/puffin/src/puffin_manager/fs_puffin_manager/reader.rs` and `src/puffin/src/puffin_manager/tests.rs` 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) 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 7 shared commits counted here, the most recent 3 are `dce5e35d` feat: apply terms with fulltext tantivy backend (#5869); `7bcb01d2` feat: utilize blob metadata properties (#5767); `8d05fb35` feat: unify puffin name passed to stager (#5564) — run `git show` on any of them.
Change coupling: empty_table.rs ↔ memtable.rs src/table/src/test_util/empty_table.rs— `src/table/src/test_util/empty_table.rs` and `src/table/src/test_util/memtable.rs` 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) 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 7 shared commits counted here, the most recent 3 are `e920f959` refactor: drop Table trait (#3654); `d6c82867` refactor: remove the most Table impls (#2274); `7abe71f3` fix(table): return correct table types (#2131) — run `git show` on any of them.
Change coupling: test_util.rs ↔ handle_create.rs src/mito2/src/test_util.rs— `src/mito2/src/test_util.rs` and `src/mito2/src/worker/handle_create.rs` change together 70% of the time (16 of the 23 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 16 shared commits counted here, the most recent 3 are `1ca29c34` feat: support create region requirements (#8281); `24671b60` feat: tracks index files in another cache and preloads them (#7181); `9fe84f6f` feat(mito): backfill partition expr on region open (#6862) — run `git show` on any of them.
Change coupling: context.rs ↔ reader.rs src/mito2/src/memtable/bulk/context.rs— `src/mito2/src/memtable/bulk/context.rs` and `src/mito2/src/sst/parquet/reader.rs` change together 69% of the time (9 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 9 shared commits counted here, the most recent 3 are `5b1b12d0` fix(mito2): adapt batch size for wide rows (#8543); `6a84393e` feat: support prefiltering any columns in flat format (#7972); `922f9cb3` feat: use dyn filter (#7545) — run `git show` on any of them.
Change coupling: table_flownode.rs ↔ create_flow.rs src/common/meta/src/cache/flow/table_flownode.rs— `src/common/meta/src/cache/flow/table_flownode.rs` and `src/common/meta/src/ddl/create_flow.rs` change together 69% of the time (9 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 9 shared commits counted here, the most recent 3 are `ba15a9c0` feat: support pending flow metadata with defer_on_missing_source (#8124); `8452a9d5` feat(flow): add eval interval option (#6623); `038acda7` fix: flow update use proper update (#6108) — run `git show` on any of them.
Change coupling: close_region.rs ↔ open_region.rs src/datanode/src/heartbeat/handler/close_region.rs— `src/datanode/src/heartbeat/handler/close_region.rs` and `src/datanode/src/heartbeat/handler/open_region.rs` change together 69% of the time (9 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 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 9 shared commits counted here, the most recent 3 are `328ec56b` feat: introduce `OpenRegions` and `CloseRegions` instructions to supp…; `b2f61aa1` fix: format error correctly (#4204); `485a91f4` feat: implement handle upgrade region instruction (#3013) — run `git show` on any of them.
Change coupling: decode.rs ↔ prom_row_builder.rs src/servers/src/prom_remote_write/decode.rs— `src/servers/src/prom_remote_write/decode.rs` and `src/servers/src/prom_row_builder.rs` change together 69% of the time (11 of the 16 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 11 shared commits counted here, the most recent 3 are `2000611e` perf(remote-write): optimize decode prom (#7761) (at that commit the file was still `src/servers/src/proto.rs`); `7ba23a99` perf: prom decode (#7737) (at that commit the file was still `src/servers/src/proto.rs`); `2f9a10ab` refactor: expose bulk symbols (#6467) (at that commit the file was still `src/servers/src/proto.rs`) — run `git show` on any of them.
Change coupling: builder.rs ↔ test_util.rs src/meta-srv/src/metasrv/builder.rs— `src/meta-srv/src/metasrv/builder.rs` and `src/meta-srv/src/test_util.rs` change together 67% of the time (10 of the 15 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 `8cbe7166` refactor: migrate region failover implementation to region migration …; `4c3d4af1` feat: register flow node (#4166); `0afac58e` feat(metasrv): implement maintenance (#3527) — run `git show` on any of them.
Change coupling: create.rs ↔ state.rs src/metric-engine/src/engine/create.rs— `src/metric-engine/src/engine/create.rs` and `src/metric-engine/src/engine/state.rs` change together 67% of the time (8 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 between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `90752f56` feat: persist Prometheus remote write v2 native histograms (#8382); `148d96fc` fix: ensures logical and physical region have the same timestamp unit…; `d363c8ee` fix: check physical region before use (#5612) — run `git show` on any of them.
Change coupling: reader.rs ↔ bounded_stager.rs src/puffin/src/puffin_manager/fs_puffin_manager/reader.rs— `src/puffin/src/puffin_manager/fs_puffin_manager/reader.rs` and `src/puffin/src/puffin_manager/stager/bounded_stager.rs` 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) 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 7 shared commits counted here, the most recent 3 are `8d05fb35` feat: unify puffin name passed to stager (#5564); `96b2a5fb` feat: introduce `ParallelFstValuesMapper` (#5276); `cbf21e53` feat(puffin): apply range reader (#4928) — run `git show` on any of them.
Change coupling: lease_based.rs ↔ load_based.rs src/meta-srv/src/selector/lease_based.rs— `src/meta-srv/src/selector/lease_based.rs` and `src/meta-srv/src/selector/load_based.rs` change together 56% of the time (9 of the 16 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 9 shared commits counted here, the most recent 3 are `6a15e627` feat: expose workload filter to selector options (#6951); `4c2955b8` fix: time unit mismatch in `lookup_frontends` function (#6798); `8dca448b` feat: add datanode workloads support (#6055) — run `git show` on any of them.
Change coupling: prom_store.rs ↔ prom_row_builder.rs src/servers/src/http/prom_store.rs— `src/servers/src/http/prom_store.rs` and `src/servers/src/prom_row_builder.rs` change together 56% of the time (9 of the 16 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 `fedce5c5` feat: support non-millisecond time index units in the logical batcher…; `941193e9` refactor: reorganize logical table batching and isolate encoding (#9210); `2000611e` perf(remote-write): optimize decode prom (#7761) — run `git show` on any of them.
Change coupling: jaeger.rs ↔ v0.rs src/servers/src/http/jaeger.rs— `src/servers/src/http/jaeger.rs` and `src/servers/src/otlp/trace/v0.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 `6caff50d` chore: improve search traces and jaeger resp (#7166); `0a396192` refactor!: add a `opentelemetry_traces_operations` table to aggregate…; `ee4fe9d2` refactor: improve performance for Jaeger APIs (#5838) — run `git show` on any of them.
Change coupling: range.rs ↔ reader.rs src/mito2/src/read/range.rs— `src/mito2/src/read/range.rs` and `src/mito2/src/sst/parquet/reader.rs` change together 54% of the time (7 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 7 shared commits counted here, the most recent 3 are `1451a51e` feat: add tools for development (#8260); `922f9cb3` feat: use dyn filter (#7545); `c34d142e` fix: clear unused range builders eagerly (#7569) — run `git show` on any of them.
Change coupling: metasrv.rs ↔ test_util.rs src/meta-srv/src/metasrv.rs— `src/meta-srv/src/metasrv.rs` and `src/meta-srv/src/test_util.rs` change together 53% of the time (8 of the 15 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 8 shared commits counted here, the most recent 3 are `8cbe7166` refactor: migrate region failover implementation to region migration …; `4c3d4af1` feat: register flow node (#4166); `0afac58e` feat(metasrv): implement maintenance (#3527) — run `git show` on any of them.
Change coupling: datanode.rs ↔ metasrv.rs src/common/wal/src/config/kafka/datanode.rs— `src/common/wal/src/config/kafka/datanode.rs` and `src/common/wal/src/config/kafka/metasrv.rs` change together 53% of the time (8 of the 15 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 8 shared commits counted here, the most recent 3 are `fbdc35a1` ci: add remote WAL logical pruning fuzz (#8307); `021ad09c` refactor: simplify WAL pruning procedure and introduce region flush …; `ee07b9bf` test: update configs to enable auto wal prune (#5938) — run `git show` on any of them.
Change coupling: numbers.rs ↔ memtable.rs src/table/src/table/numbers.rs— `src/table/src/table/numbers.rs` and `src/table/src/test_util/memtable.rs` change together 53% of the time (8 of the 15 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 `3e67c676` refactor: simplify scan projection to root column indices (#8629); `c90e4147` refactor: introduce the ProjectInput structure (#7908); `e375a180` fix: conversion from TableMeta to TableMetaBuilder (#5693) — run `git show` on any of them.
Change coupling: table_info.rs ↔ table_route.rs src/common/meta/src/key/table_info.rs— `src/common/meta/src/key/table_info.rs` and `src/common/meta/src/key/table_route.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 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 9 shared commits counted here, the most recent 3 are `9aa2182c` refactor: make txn easy to use (#3905); `c91132bd` feat: introduce `TableNameCache` & `TableInfoCache` & `TableRouteCach…; `51078226` refactor: avoid unnecessary cloning (#3734) — run `git show` on any of them.
Change coupling: test.rs ↔ commutativity.rs src/query/src/dist_plan/analyzer/test.rs— `src/query/src/dist_plan/analyzer/test.rs` and `src/query/src/dist_plan/commutativity.rs` change together 52% of the time (11 of the 21 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 11 shared commits counted here, the most recent 3 are `def0c2ec` fix: only push down aggregates grouped by the partition columns thems…; `82444635` feat: support quantile and fraction queries on mixed histograms (#8874); `4f5dccf6` fix(query): push down PromQL cast filters (#8407) — run `git show` on any of them.
Change coupling: engine.rs ↔ handle_create.rs src/mito2/src/engine.rs— `src/mito2/src/engine.rs` and `src/mito2/src/worker/handle_create.rs` change together 52% of the time (12 of the 23 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 `9fe84f6f` feat(mito): backfill partition expr on region open (#6862); `f7c8d86e` feat: file ref mgr (#6844); `ff8c10ea` feat: add CatchupRequest to engine (#2939) — run `git show` on any of them.
Change coupling: create_table.rs ↔ drop_table.rs src/common/meta/src/ddl/create_table.rs— `src/common/meta/src/ddl/create_table.rs` and `src/common/meta/src/ddl/drop_table.rs` change together 50% of the time (18 of the 36 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 18 shared commits counted here, the most recent 3 are `8aefcfae` fix(meta): renew operating region leases from keeper roles (#7971); `dca451c4` fix: remap peer addresses during retries (#7933); `981d5178` fix: throw errors instead of ignoring (#5792) — run `git show` on any of them.
Change coupling: twcs.rs ↔ handle_compaction.rs src/mito2/src/compaction/twcs.rs— `src/mito2/src/compaction/twcs.rs` and `src/mito2/src/worker/handle_compaction.rs` change together 50% of the time (11 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 — 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 11 shared commits counted here, the most recent 3 are `9cfbc421` refactor(mito2): prioritize file count in TWCS picker (#8765); `f524a0b5` feat: support time range in manual compaction (#8669); `98612800` perf(mito2): make compaction picker asynchronous to avoid blocking th… — run `git show` on any of them.
Change coupling: columns.rs ↔ tables.rs src/catalog/src/system_schema/information_schema/columns.rs— `src/catalog/src/system_schema/information_schema/columns.rs` and `src/catalog/src/system_schema/information_schema/tables.rs` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `f995f609` chore: avoid double future (#3890) (at that commit the files were still `src/catalog/src/information_schema/columns.rs` and `src/catalog/src/information_schema/tables.rs`); `c6c4ea5e` feat: tables stream with CatalogManager (#3180) (at that commit the files were still `src/catalog/src/information_schema/columns.rs` and `src/catalog/src/information_schema/tables.rs`); `c2db9706` feat: pushdown filters for some information_schema tables (#3091) (at that commit the files were still `src/catalog/src/information_schema/columns.rs` and `src/catalog/src/information_schema/tables.rs`) — run `git show` on any of them.
Duplicated block (5 lines × 2) src/catalog/src/system_schema/information_schema/partitions.rs:269— src/catalog/src/system_schema/information_schema/partitions.rs:269-274 | src/catalog/src/system_schema/information_schema/tables.rs:279-283 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src/common/datasource/src/parquet_writer.rs:148— src/common/datasource/src/parquet_writer.rs:148-152 | src/common/datasource/src/parquet_writer.rs:213-217 — both copies are in the same file, so extract the block into 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) src/common/function/src/aggrs/geo/encoding.rs:173— src/common/function/src/aggrs/geo/encoding.rs:173-177 | src/common/function/src/aggrs/geo/geo_path.rs:202-206 — before extracting anything, compare `src/common/function/src/aggrs/geo/encoding.rs` and `src/common/function/src/aggrs/geo/geo_path.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/common/function/src/scalars/geo/h3.rs:107— src/common/function/src/scalars/geo/h3.rs:107-111 | src/common/function/src/scalars/geo/s2.rs:90-94 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src/common/function/src/scalars/ip/cidr.rs:116— src/common/function/src/scalars/ip/cidr.rs:116-120 | src/common/function/src/scalars/ip/cidr.rs:245-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 (5 lines × 2) src/common/function/src/scalars/primary_key.rs:109— src/common/function/src/scalars/primary_key.rs:109-113 | src/common/function/src/scalars/primary_key.rs:147-151 — both copies are in the same file, so extract the block into 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) src/common/macro/src/admin_fn.rs:50— src/common/macro/src/admin_fn.rs:50-54 | src/common/macro/src/range_fn.rs:39-43 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src/common/meta/src/kv_backend/rds/mysql.rs:130— src/common/meta/src/kv_backend/rds/mysql.rs:130-134 | src/common/meta/src/kv_backend/rds/postgres.rs:162-166 — before extracting anything, compare `src/common/meta/src/kv_backend/rds/mysql.rs` and `src/common/meta/src/kv_backend/rds/postgres.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) src/common/meta/src/kv_backend/rds/mysql.rs:135— src/common/meta/src/kv_backend/rds/mysql.rs:135-139 | src/common/meta/src/kv_backend/rds/postgres.rs:167-171 — before extracting anything, compare `src/common/meta/src/kv_backend/rds/mysql.rs` and `src/common/meta/src/kv_backend/rds/postgres.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) src/common/meta/src/kv_backend/rds.rs:301— src/common/meta/src/kv_backend/rds.rs:301-305 | src/common/meta/src/kv_backend/rds.rs:362-366 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src/meta-srv/src/event/repartition.rs:236— src/meta-srv/src/event/repartition.rs:236-240 | src/meta-srv/src/event/repartition.rs:267-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src/operator/src/insert.rs:523— src/operator/src/insert.rs:523-527 | src/operator/src/insert.rs:775-779 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src/operator/src/statement/show.rs:285— src/operator/src/statement/show.rs:285-289 | src/operator/src/statement/show.rs:334-338 — both copies are in the same file, so extract the block into 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) src/query/src/datafusion.rs:86— src/query/src/datafusion.rs:86-90 | src/query/src/datafusion.rs:115-119 — both copies are in the same file, so extract the block into 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) src/query/src/promql/planner.rs:2036— src/query/src/promql/planner.rs:2036-2040 | src/query/src/promql/planner.rs:3087-3091 — both copies are in the same file, so extract the block into 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) src/common/function/src/aggrs/approximate/avg.rs:80— src/common/function/src/aggrs/approximate/avg.rs:80-84 | src/common/function/src/aggrs/approximate/welford.rs:262-266 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src/common/meta/src/key/schema_name.rs:267— src/common/meta/src/key/schema_name.rs:267-272 | src/common/meta/src/key/topic_region.rs:345-349 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) src/datanode/src/service.rs:52— src/datanode/src/service.rs:52-56 | src/flow/src/server.rs:410-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 (5 lines × 2) src/servers/src/mysql/handler.rs:136— src/servers/src/mysql/handler.rs:136-140 | src/servers/src/postgres/handler.rs:63-67 — 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) src/cmd/src/bin/query_regression_runner/direct.rs:233— src/cmd/src/bin/query_regression_runner/direct.rs:233-237 | src/cmd/src/bin/query_regression_runner/direct.rs:250-254 — both copies are in the same file, so extract the block into 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) src/common/function/src/aggrs/geo/encoding.rs:144— src/common/function/src/aggrs/geo/encoding.rs:144-148 | src/common/function/src/aggrs/geo/geo_path.rs:166-170 — before extracting anything, compare `src/common/function/src/aggrs/geo/encoding.rs` and `src/common/function/src/aggrs/geo/geo_path.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/mito2/src/read/seq_scan.rs:581— src/mito2/src/read/seq_scan.rs:581-585 | src/mito2/src/read/unordered_scan.rs:365-369 — before extracting anything, compare `src/mito2/src/read/seq_scan.rs` and `src/mito2/src/read/unordered_scan.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) src/operator/src/insert.rs:1788— src/operator/src/insert.rs:1788-1792 | src/servers/src/otlp/logs.rs:864-868 — 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) src/partition/src/expr.rs:261— src/partition/src/expr.rs:261-265 | src/partition/src/expr.rs:267-271 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) src/partition/src/overlap.rs:147— src/partition/src/overlap.rs:147-151 | src/partition/src/overlap.rs:162-166 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
TooManyMethods: ParserContext src/sql/src/parser.rs:43— TooManyMethods — 144 methods, declared across 24 files: parsers/create_parser.rs (26), parsers/show_parser.rs (19), src/parser.rs (18), parsers/alter_parser.rs (18), +20 more file(s). The bar is 30 methods; this is 114 over it, 4.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: PromPlanner src/query/src/promql/planner.rs:284— TooManyMethods — 128 methods, declared across 5 files: promql/planner.rs (106), planner/at_modifier.rs (8), planner/function_plans.rs (7), planner/island.rs (5), +1 more file(s). The bar is 30 methods; this is 98 over it, 4.27× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: StatementExecutor src/operator/src/statement.rs:139— TooManyMethods — 120 methods, declared across 18 files: statement/ddl.rs (45), statement/show.rs (22), src/statement.rs (17), statement/copy_table_to.rs (6), +14 more file(s). The bar is 30 methods; this is 90 over it, 4.00× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Instance src/frontend/src/instance.rs:126— TooManyMethods — 100 methods, declared across 12 files: src/instance.rs (40), otlp/trace_ingest.rs (20), instance/grpc.rs (10), instance/dashboard.rs (7), +8 more file(s). The bar is 30 methods; this is 70 over it, 3.33× 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: RegionWorkerLoop src/mito2/src/worker.rs:934— TooManyMethods — 83 methods, declared across 18 files: worker/handle_write.rs (12), src/worker.rs (9), worker/handle_flush.rs (9), worker/handle_manifest.rs (9), +14 more file(s). The bar is 30 methods; this is 53 over it, 2.77× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. 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: MetricEngineInner src/metric-engine/src/engine.rs:584— TooManyMethods — 67 methods, declared across 13 files: engine/put.rs (18), engine/read.rs (12), engine/open.rs (10), engine/create.rs (7), +9 more file(s). The bar is 30 methods; this is 37 over it, 2.23× 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: ConcreteDataType src/datatypes/src/data_type.rs:46— TooManyMethods — 62 methods. The bar is 30 methods; this is 32 over it, 2.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: QueryContext src/session/src/context.rs:63— TooManyMethods — 59 methods. The bar is 30 methods; this is 29 over it, 1.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: BatchingTask src/flow/src/batching_mode/task.rs:293— TooManyMethods — 54 methods, declared across 3 files: batching_mode/task.rs (45), task/ckpt.rs (5), task/inc.rs (4). 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: TableMetadataManager src/common/meta/src/key.rs:394— 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: MitoRegion src/mito2/src/region.rs:144— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× 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: RegionServer src/datanode/src/region_server.rs:114— TooManyMethods — 42 methods, declared across 3 files: src/region_server.rs (32), region_server/remote_dyn_filter.rs (6), region_server/catalog.rs (4). The bar is 30 methods; this is 12 over it, 1.40× 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: Metasrv src/meta-srv/src/metasrv.rs:561— TooManyMethods — 39 methods, declared across 3 files: src/metasrv.rs (33), service/procedure.rs (4), service/cluster.rs (2). The bar is 30 methods; this is 9 over it, 1.30× 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: Timestamp src/common/time/src/timestamp.rs:46— TooManyMethods — 38 methods. The bar is 30 methods; this is 8 over it, 1.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ColumnSchema src/datatypes/src/schema/column_schema.rs:71— TooManyMethods — 36 methods. The bar is 30 methods; this is 6 over it, 1.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: NativeHistogram src/common/query/src/native_histogram.rs:235— TooManyMethods — 35 methods. The bar is 30 methods; this is 5 over it, 1.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: Inserter src/operator/src/insert.rs:97— TooManyMethods — 35 methods, declared across 2 files: src/insert.rs (32), src/bulk_insert.rs (3). The bar is 30 methods; this is 5 over it, 1.17× 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: MitoEngine src/mito2/src/engine.rs:280— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CacheManager src/mito2/src/cache.rs:1020— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Batch src/mito2/src/read.rs:116— TooManyMethods — 32 methods. The bar is 30 methods; this is 2 over it, 1.07× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Indexer src/mito2/src/sst/index.rs:238— TooManyMethods — 32 methods, declared across 4 files: indexer/finish.rs (10), indexer/update.rs (9), sst/index.rs (8), indexer/abort.rs (5). The bar is 30 methods; this is 2 over it, 1.07× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ParquetReaderBuilder src/mito2/src/sst/parquet/reader.rs:187— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
mito2::region::opener::preload_parquet_meta_cache_for_files (cognitive 35) src/mito2/src/region/opener.rs:1200— mito2::region::opener::preload_parquet_meta_cache_for_files has cognitive complexity 35 (threshold 15). Drivers by points: if/else 9 (22 pts), match/switch 3 (9 pts), boolean chains 3, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mito2::sst::parquet::prefilter::build_reader_filter_plan (cognitive 31) src/mito2/src/sst/parquet/prefilter.rs:406— mito2::sst::parquet::prefilter::build_reader_filter_plan has cognitive complexity 31 (threshold 15). Drivers by points: if/else 13 (26 pts), boolean chains 3, loops 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.
mito2::compaction::run::find_sorted_runs (cognitive 28) src/mito2/src/compaction/run.rs:262— mito2::compaction::run::find_sorted_runs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (21 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.
mito2::compaction::run::find_overlapping_items (cognitive 27) src/mito2/src/compaction/run.rs:69— mito2::compaction::run::find_overlapping_items has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mito2::read::seq_scan::build_flat_sources (cognitive 27) src/mito2/src/read/seq_scan.rs:630— mito2::read::seq_scan::build_flat_sources has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mito2::series_index::maintenance::build_index_version (cognitive 25) src/mito2/src/series_index/maintenance.rs:160— mito2::series_index::maintenance::build_index_version has cognitive complexity 25 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 4 (6 pts), boolean chains 3, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mito2::sst::parquet::format::column_values_by_type (cognitive 25) src/mito2/src/sst/parquet/format.rs:150— mito2::sst::parquet::format::column_values_by_type has cognitive complexity 25 (threshold 15). Drivers by points: if/else 16 (24 pts), match/switch 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
mito2::flush::memtable_flat_sources (cognitive 24) src/mito2/src/flush.rs:910— mito2::flush::memtable_flat_sources has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mito2::read::scan_util::build_flat_file_range_scan_stream (cognitive 22) src/mito2/src/read/scan_util.rs:1518— mito2::read::scan_util::build_flat_file_range_scan_stream has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (17 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.
mito2::read::series_reader::scan_series_file_ranges (cognitive 22) src/mito2/src/read/series_reader.rs:495— mito2::read::series_reader::scan_series_file_ranges has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (19 pts), 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.
mito2::read::scan_region::exact_sequence_range (cognitive 21) src/mito2/src/read/scan_region.rs:1868— mito2::read::scan_region::exact_sequence_range has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), boolean chains 6, match/switch 2 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mito2::read::scan_util::should_split_flat_batches_for_merge (cognitive 21) src/mito2/src/read/scan_util.rs:1210— mito2::read::scan_util::should_split_flat_batches_for_merge has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (17 pts), boolean chains 3, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mito2::compaction::find_dynamic_options (cognitive 19) src/mito2/src/compaction.rs:53— mito2::compaction::find_dynamic_options has cognitive complexity 19 (threshold 15). Drivers by points: if/else 12 (19 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.
mito2::read::series_reader::build_series_partition_range (cognitive 19) src/mito2/src/read/series_reader.rs:367— mito2::read::series_reader::build_series_partition_range has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mito2::worker::handle_write::write_wal (cognitive 18) src/mito2/src/worker/handle_write.rs:612— mito2::worker::handle_write::write_wal has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 3 (5 pts), match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mito2::worker::handle_manifest::edit_region (cognitive 18) src/mito2/src/worker/handle_manifest.rs:654— mito2::worker::handle_manifest::edit_region has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mito2::series_index::builder::build_series_index (cognitive 18) src/mito2/src/series_index/builder.rs:127— mito2::series_index::builder::build_series_index has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 4 (7 pts), match/switch 1 (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.
mito2::compaction::window::filter_time_windows (cognitive 18) src/mito2/src/compaction/window.rs:178— mito2::compaction::window::filter_time_windows has cognitive complexity 18 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 3 (8 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.
mito2::memtable::bulk::part::convert_bulk_part (cognitive 16) src/mito2/src/memtable/bulk/part.rs:991— mito2::memtable::bulk::part::convert_bulk_part has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
mito2::sst::parquet::row_selection::intersect_row_selections (cognitive 16) src/mito2/src/sst/parquet/row_selection.rs:519— mito2::sst::parquet::row_selection::intersect_row_selections 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.
mito2::worker::handle_alter::log_time_index_widening_overflow (cognitive 16) src/mito2/src/worker/handle_alter.rs:590— mito2::worker::handle_alter::log_time_index_widening_overflow has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 3 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (15 lines × 2) src/cli/src/data/export.rs:215— src/cli/src/data/export.rs:215-229 | src/cli/src/data/import.rs:197-211 — 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) src/common/function/src/aggrs/geo/encoding.rs:200— src/common/function/src/aggrs/geo/encoding.rs:200-214 | src/common/function/src/aggrs/geo/geo_path.rs:229-243 — before extracting anything, compare `src/common/function/src/aggrs/geo/encoding.rs` and `src/common/function/src/aggrs/geo/geo_path.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/common/function/src/scalars/anomaly/iqr.rs:119— src/common/function/src/scalars/anomaly/iqr.rs:119-133 | src/common/function/src/scalars/anomaly/mad.rs:109-123 — 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) src/common/meta/src/ddl/drop_table/executor.rs:323— src/common/meta/src/ddl/drop_table/executor.rs:323-337 | src/common/meta/src/ddl/drop_table/executor.rs:440-454 — both copies are in the same file, so extract the block into 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) src/common/meta/src/reconciliation/reconcile_database/reconcile_logical_tables.rs:73— src/common/meta/src/reconciliation/reconcile_database/reconcile_logical_tables.rs:73-87 | src/common/meta/src/reconciliation/reconcile_database/reconcile_tables.rs:65-79 — 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) src/common/meta/src/reconciliation/reconcile_table/resolve_column_metadata.rs:139— src/common/meta/src/reconciliation/reconcile_table/resolve_column_metadata.rs:139-153 | src/common/meta/src/reconciliation/reconcile_table/resolve_column_metadata.rs:158-172 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) src/datatypes/src/vectors/list.rs:355— src/datatypes/src/vectors/list.rs:355-369 | src/datatypes/src/vectors/list.rs:381-395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) src/mito2/src/memtable/bulk.rs:692— src/mito2/src/memtable/bulk.rs:692-706 | src/mito2/src/memtable/bulk.rs:1513-1527 — both copies are in the same file, so extract the block into 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) src/mito2/src/read/flat_merge.rs:863— src/mito2/src/read/flat_merge.rs:863-877 | src/mito2/src/read/flat_merge.rs:1040-1054 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) src/pipeline/src/etl/processor/decolorize.rs:116— src/pipeline/src/etl/processor/decolorize.rs:116-130 | src/pipeline/src/etl/processor/digest.rs:212-226 — before extracting anything, compare `src/pipeline/src/etl/processor/decolorize.rs` and `src/pipeline/src/etl/processor/digest.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 (15 lines × 2) src/promql/src/extension_plan/range_manipulate.rs:589— src/promql/src/extension_plan/range_manipulate.rs:589-603 | src/promql/src/extension_plan/scalar_calculate.rs:496-510 — before extracting anything, compare `src/promql/src/extension_plan/range_manipulate.rs` and `src/promql/src/extension_plan/scalar_calculate.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 2) src/query/src/promql/planner.rs:1610— src/query/src/promql/planner.rs:1610-1624 | src/query/src/promql/planner.rs:1633-1647 — both copies are in the same file, so extract the block into 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) src/servers/src/http/prom_store.rs:450— src/servers/src/http/prom_store.rs:450-464 | src/servers/src/http/prom_store.rs:578-592 — both copies are in the same file, so extract the block into 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) src/servers/src/postgres/types.rs:1198— src/servers/src/postgres/types.rs:1198-1212 | src/servers/src/postgres/types.rs:1267-1281 — both copies are in the same file, so extract the block into 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) src/servers/src/postgres/types.rs:1310— src/servers/src/postgres/types.rs:1310-1324 | src/servers/src/postgres/types.rs:1370-1384 — both copies are in the same file, so extract the block into 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) src/sql/src/parsers/alter_parser/trigger.rs:95— src/sql/src/parsers/alter_parser/trigger.rs:95-109 | src/sql/src/parsers/alter_parser/trigger.rs:114-128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) src/sql/src/parsers/create_parser/trigger.rs:297— src/sql/src/parsers/create_parser/trigger.rs:297-311 | src/sql/src/parsers/create_parser/trigger.rs:352-367 — both copies are in the same file, so extract the block into 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) src/frontend/src/instance/otlp/trace_ingest.rs:1210— src/frontend/src/instance/otlp/trace_ingest.rs:1210-1224 | src/frontend/src/instance/otlp/trace_ingest.rs:1292-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 (15 lines × 2) .github/scripts/aliyun-ecs-runner-provision.py:247— .github/scripts/aliyun-ecs-runner-provision.py:247-261 | .github/scripts/aliyun-ecs-runner-teardown.py:108-122 — 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 `.github/scripts/aliyun-ecs-runner-provision.py:247` it does not close everything it opens, so those 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.
servers::postgres::types::parameters_to_scalar_values (cognitive 205) src/servers/src/postgres/types.rs:556— servers::postgres::types::parameters_to_scalar_values has cognitive complexity 205 (threshold 15). Drivers by points: if/else 55 (117 pts), match/switch 23 (85 pts), boolean chains 2, loops 1 (nesting depth added 124). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
servers::http::jaeger::traces_from_records (cognitive 162) src/servers/src/http/jaeger.rs:764— servers::http::jaeger::traces_from_records has cognitive complexity 162 (threshold 15). Drivers by points: if/else 34 (134 pts), loops 6 (17 pts), boolean chains 8, match/switch 1 (3 pts) (nesting depth added 113). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
servers::batcher::table::pending_worker::start_worker (cognitive 48) src/servers/src/batcher/table/pending_worker.rs:64— servers::batcher::table::pending_worker::start_worker has cognitive complexity 48 (threshold 15). Drivers by points: if/else 10 (35 pts), loops 2 (6 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 32). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
servers::http::result::prometheus_resp::merge_batch (cognitive 36) src/servers/src/http/result/prometheus_resp.rs:455— servers::http::result::prometheus_resp::merge_batch has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 3 (7 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.
servers::pipeline::run_custom_pipeline (cognitive 34) src/servers/src/pipeline.rs:99— servers::pipeline::run_custom_pipeline has cognitive complexity 34 (threshold 15). Drivers by points: loops 7 (16 pts), if/else 3 (9 pts), match/switch 4 (9 pts) (nesting depth added 20). 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.
servers::otlp::metrics::encode_histogram (cognitive 29) src/servers/src/otlp/metrics.rs:1216— servers::otlp::metrics::encode_histogram has cognitive complexity 29 (threshold 15). Drivers by points: if/else 12 (22 pts), loops 3 (6 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.
servers::mysql::writer::write_output (cognitive 29) src/servers/src/mysql/writer.rs:60— servers::mysql::writer::write_output has cognitive complexity 29 (threshold 15). Drivers by points: match/switch 6 (18 pts), if/else 2 (6 pts), loops 3 (5 pts) (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
servers::prom_remote_write::v2::decode_series_leaves (cognitive 28) src/servers/src/prom_remote_write/v2.rs:393— servers::prom_remote_write::v2::decode_series_leaves has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (25 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
servers::http::handler::from_output (cognitive 27) src/servers/src/http/handler.rs:710— servers::http::handler::from_output has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 5 (18 pts), if/else 2 (8 pts), loops 1 (nesting depth added 19). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
servers::http::prometheus::label_values_query (cognitive 27) src/servers/src/http/prometheus.rs:1683— servers::http::prometheus::label_values_query has cognitive complexity 27 (threshold 15). Drivers by points: if/else 16 (24 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.
servers::batcher::logical_table::pending_worker::start_worker (cognitive 27) src/servers/src/batcher/logical_table/pending_worker.rs:96— servers::batcher::logical_table::pending_worker::start_worker has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (17 pts), loops 2 (5 pts), match/switch 2 (5 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
servers::http::handler::sql_analyze_stream (cognitive 23) src/servers/src/http/handler.rs:293— servers::http::handler::sql_analyze_stream has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 4 (7 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.
servers::otlp::metrics::to_grpc_insert_requests (cognitive 21) src/servers/src/otlp/metrics.rs:128— servers::otlp::metrics::to_grpc_insert_requests has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (6 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.
servers::otlp::metrics::convert_bucket_range (cognitive 19) src/servers/src/otlp/metrics.rs:838— servers::otlp::metrics::convert_bucket_range has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (5 pts), loops 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.
servers::mysql::federated::has_trailing_statement (cognitive 17) src/servers/src/mysql/federated.rs:449— servers::mysql::federated::has_trailing_statement has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
servers::http::authorize::inner_auth (cognitive 17) src/servers/src/http/authorize.rs:58— servers::http::authorize::inner_auth has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (10 pts), match/switch 4 (7 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.
servers::http::prometheus::update_metric_name_matcher (cognitive 17) src/servers/src/http/prometheus.rs:1619— servers::http::prometheus::update_metric_name_matcher has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (4 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.
servers::otlp::metrics::resource_info::for_each_encoded_time (cognitive 16) src/servers/src/otlp/metrics/resource_info.rs:173— servers::otlp::metrics::resource_info::for_each_encoded_time has cognitive complexity 16 (threshold 15). Drivers by points: loops 4 (8 pts), if/else 1 (5 pts), match/switch 1 (3 pts) (nesting depth added 10). 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, 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 (14 lines × 2) src/catalog/src/kvbackend/client.rs:233— src/catalog/src/kvbackend/client.rs:233-246 | src/catalog/src/kvbackend/client.rs:253-266 — both copies are in the same file, so extract the block into 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) src/common/function/src/scalars/geo/h3.rs:1213— src/common/function/src/scalars/geo/h3.rs:1213-1226 | src/common/function/src/scalars/geo/h3.rs:1279-1292 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) src/common/function/src/scalars/ip/range.rs:220— src/common/function/src/scalars/ip/range.rs:220-233 | src/common/function/src/scalars/ip/range.rs:256-269 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) REDACTED:935— REDACTED:935-948 | REDACTED:784-797 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) src/common/meta/src/key/flow/table_flow.rs:230— src/common/meta/src/key/flow/table_flow.rs:230-243 | src/common/meta/src/key/flow/table_flow.rs:268-281 — both copies are in the same file, so extract the block into 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) src/mito2/src/engine.rs:886— src/mito2/src/engine.rs:886-899 | src/mito2/src/engine.rs:1002-1015 — both copies are in the same file, so extract the block into 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) src/mito2/src/engine.rs:1562— src/mito2/src/engine.rs:1562-1575 | src/mito2/src/engine.rs:1582-1595 — both copies are in the same file, so extract the block into 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) src/mito2/src/sst/index/bloom_filter/creator.rs:311— src/mito2/src/sst/index/bloom_filter/creator.rs:311-324 | src/mito2/src/sst/index/inverted_index/creator.rs:193-206 — `src/mito2/src/sst/index/bloom_filter/creator.rs` and `src/mito2/src/sst/index/inverted_index/creator.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 6 separate duplicated blocks between them, totalling at least 63 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 × 2) src/mito2/src/sst/parquet/file_range.rs:337— src/mito2/src/sst/parquet/file_range.rs:337-350 | src/mito2/src/sst/parquet/file_range.rs:371-384 — both copies are in the same file, so extract the block into 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) src/servers/src/http/prometheus.rs:398— src/servers/src/http/prometheus.rs:398-411 | src/servers/src/http/prometheus.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) src/servers/src/http.rs:1356— src/servers/src/http.rs:1356-1369 | src/servers/src/http.rs:1391-1404 — both copies are in the same file, so extract the block into 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) src/store-api/src/metadata.rs:899— src/store-api/src/metadata.rs:899-912 | src/store-api/src/metadata.rs:940-953 — both copies are in the same file, so extract the block into 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) src/mito2/src/sst/index.rs:515— src/mito2/src/sst/index.rs:515-528 | src/mito2/src/sst/index.rs:566-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 (14 lines × 2) src/promql/src/extension_plan/normalize.rs:144— src/promql/src/extension_plan/normalize.rs:144-157 | src/promql/src/extension_plan/range_manipulate.rs:385-398 — 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) src/common/function/src/scalars/geo/geohash.rs:117— src/common/function/src/scalars/geo/geohash.rs:117-130 | src/common/function/src/scalars/geo/h3.rs:1019-1032 — before extracting anything, compare `src/common/function/src/scalars/geo/geohash.rs` and `src/common/function/src/scalars/geo/h3.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) tests-fuzz/targets/ddl/fuzz_repartition_table.rs:101— tests-fuzz/targets/ddl/fuzz_repartition_table.rs:101-114 | tests-fuzz/targets/ddl/fuzz_repartition_table_chaos.rs:132-145 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_repartition_table.rs` and `tests-fuzz/targets/ddl/fuzz_repartition_table_chaos.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) tests-fuzz/targets/ddl/fuzz_repartition_table.rs:145— tests-fuzz/targets/ddl/fuzz_repartition_table.rs:145-158 | tests-fuzz/targets/ddl/fuzz_repartition_table_chaos.rs:167-180 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_repartition_table.rs` and `tests-fuzz/targets/ddl/fuzz_repartition_table_chaos.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×15
Duplicated block (19 lines × 2) src/cmd/src/frontend.rs:276— src/cmd/src/frontend.rs:276-294 | src/cmd/src/standalone.rs:380-398 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19 lines × 2) src/common/function/src/aggrs/geo/encoding.rs:80— src/common/function/src/aggrs/geo/encoding.rs:80-98 | src/common/function/src/aggrs/geo/geo_path.rs:102-120 — before extracting anything, compare `src/common/function/src/aggrs/geo/encoding.rs` and `src/common/function/src/aggrs/geo/geo_path.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/common/meta/src/reconciliation/reconcile_database/reconcile_logical_tables.rs:47— src/common/meta/src/reconciliation/reconcile_database/reconcile_logical_tables.rs:47-65 | src/common/meta/src/reconciliation/reconcile_database/reconcile_tables.rs:45-63 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19 lines × 2) src/common/recordbatch/src/filter.rs:542— src/common/recordbatch/src/filter.rs:542-560 | src/common/recordbatch/src/filter.rs:593-611 — both copies are in the same file, so extract the block into 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) src/flow/src/batching_mode/frontend_client.rs:385— src/flow/src/batching_mode/frontend_client.rs:385-403 | src/flow/src/batching_mode/frontend_client.rs:542-560 — both copies are in the same file, so extract the block into 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) src/flow/src/batching_mode/frontend_client.rs:466— src/flow/src/batching_mode/frontend_client.rs:466-484 | src/flow/src/batching_mode/frontend_client.rs:711-729 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) src/flow/src/batching_mode/frontend_client.rs:615— src/flow/src/batching_mode/frontend_client.rs:615-633 | src/flow/src/batching_mode/frontend_client.rs:696-714 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) src/frontend/src/instance/otlp/trace_ingest.rs:1151— src/frontend/src/instance/otlp/trace_ingest.rs:1151-1169 | src/frontend/src/instance/otlp/trace_ingest.rs:1329-1347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) src/mito2/src/memtable/bulk/part_reader.rs:121— src/mito2/src/memtable/bulk/part_reader.rs:121-139 | src/mito2/src/memtable/bulk/part_reader.rs:149-167 — both copies are in the same file, so extract the block into 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) src/mito2/src/memtable/bulk/part_reader.rs:194— src/mito2/src/memtable/bulk/part_reader.rs:194-212 | src/mito2/src/memtable/bulk/part_reader.rs:355-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) src/servers/src/http/prometheus.rs:442— src/servers/src/http/prometheus.rs:442-460 | src/servers/src/http/prometheus.rs:573-591 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) src/table/src/metadata.rs:554— src/table/src/metadata.rs:554-572 | src/table/src/metadata.rs:614-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) src/catalog/src/system_schema/information_schema/flow_statistics.rs:80— src/catalog/src/system_schema/information_schema/flow_statistics.rs:80-98 | src/catalog/src/system_schema/information_schema/flows.rs:103-131 — before extracting anything, compare `src/catalog/src/system_schema/information_schema/flow_statistics.rs` and `src/catalog/src/system_schema/information_schema/flows.rs` as WHOLE FILES: this scan already matched 3 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 (19 lines × 2) tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:194— tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:194-212 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:336-354 — before extracting anything, compare `tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs` and `tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs` as WHOLE FILES: this scan already matched 3 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. 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 × 2) src/cli/src/metadata/control/put/table.rs:100— src/cli/src/metadata/control/put/table.rs:100-115 | src/cli/src/metadata/control/put/table.rs:190-205 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) src/common/function/src/scalars/geo/h3.rs:112— src/common/function/src/scalars/geo/h3.rs:112-127 | src/common/function/src/scalars/geo/h3.rs:203-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 (16 lines × 2) src/common/function/src/scalars/string/format.rs:68— src/common/function/src/scalars/string/format.rs:68-83 | src/common/function/src/scalars/string/locate.rs:57-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) src/common/function/src/scalars/uddsketch_calc.rs:86— src/common/function/src/scalars/uddsketch_calc.rs:86-101 | src/common/function/src/scalars/uddsketch_rank.rs:82-97 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) src/common/time/src/date.rs:110— src/common/time/src/date.rs:110-125 | src/common/time/src/timestamp.rs:373-388 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (16 lines × 2) src/datatypes/src/vectors/dictionary.rs:326— src/datatypes/src/vectors/dictionary.rs:326-341 | src/datatypes/src/vectors/dictionary.rs:360-375 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16 lines × 2) src/mito2/src/read/compat.rs:421— src/mito2/src/read/compat.rs:421-436 | src/mito2/src/read/compat.rs:584-599 — both copies are in the same file, so extract the block into 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) src/mito2/src/sst/parquet/row_selection.rs:216— src/mito2/src/sst/parquet/row_selection.rs:216-231 | src/mito2/src/sst/parquet/row_selection.rs:268-283 — both copies are in the same file, so extract the block into 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) src/sql/src/statements/tql.rs:101— src/sql/src/statements/tql.rs:101-116 | src/sql/src/statements/tql.rs:136-151 — both copies are in the same file, so extract the block into 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) src/mito2/src/sst/index/fulltext_index/applier.rs:77— src/mito2/src/sst/index/fulltext_index/applier.rs:77-92 | src/mito2/src/sst/parquet/reader.rs:1634-1649 — 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) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:81— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:81-96 | tests-fuzz/targets/fuzz_insert_logical_table.rs:83-98 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs` and `tests-fuzz/targets/fuzz_insert_logical_table.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 71 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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 × 2) tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:375— tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:375-390 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:346-361 — before extracting anything, compare `tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs` and `tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:218— tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:218-233 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:361-376 — before extracting anything, compare `tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs` and `tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs` as WHOLE FILES: this scan already matched 3 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. 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.
FixmeComment src/common/meta/src/key/datanode_table.rs:246— // FIXME(weny): Before we store all region wal options into table metadata or somewhere, — 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 src/common/meta/src/key/datanode_table.rs:344— // FIXME(weny): add unit tests. — 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 src/common/time/src/timestamp.rs:144— // FIXME(yingwen): remove add/sub intervals later — 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 src/common/time/src/date.rs:137— // FIXME(yingwen): remove add/sub intervals later — 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 src/query/src/dist_plan/analyzer.rs:269— // FIXME(yingwen): Remove the `Limit` plan once we update DataFusion. — 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 src/query/src/dist_plan/analyzer/test.rs:719— /// FIXME(discord9): alias to same name with col req makes it ambiguous — 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 src/query/src/optimizer/json_type_concretize.rs:71— // FIXME: `json_types` is keyed only by unqualified column name. In joins with — 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 src/query/src/promql/planner/function_plans.rs:147— // FIXME(ruihang): support multi fields — 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 src/servers/src/http.rs:1654— // FIXME(yingwen): Support keepalive. — 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 src/store-api/src/storage/descriptors.rs:53— /// FIXME(discord9): workaround for serde issue: https://github.com/serde-rs/json/issues/1254
FixmeComment tests-fuzz/src/ir.rs:111— /// FIXME(weny): Waits for https://github.com/GreptimeTeam/greptimedb/issues/4247
FixmeComment tests-fuzz/targets/unstable/fuzz_create_table_standalone.rs:162— // FIXME(weny): support to retry it later. — 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.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×12
Members sharing a duplicated core (4 members, 50+ identical tokens) src/catalog/src/system_schema/information_schema/columns.rs:257— src/catalog/src/system_schema/information_schema/columns.rs:257-295 | src/catalog/src/system_schema/information_schema/key_column_usage.rs:230-281 | src/catalog/src/system_schema/information_schema/statistics.rs:229-334 | src/catalog/src/system_schema/information_schema/table_constraints.rs:172-212 — 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) src/cmd/src/bin/query_regression_runner/direct.rs:359— src/cmd/src/bin/query_regression_runner/direct.rs:359-408 | src/cmd/src/bin/query_regression_runner/remote/ingest.rs:280-307 | src/cmd/src/bin/query_regression_runner/remote/read_bench.rs:280-306 | src/cmd/src/bin/query_regression_runner/remote/storage.rs:30-82 — 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) src/common/function/src/scalars/geo/measure.rs:64— src/common/function/src/scalars/geo/measure.rs:64-93 | src/common/function/src/scalars/geo/measure.rs:127-166 | src/common/function/src/scalars/geo/s2.rs:82-117 | src/common/function/src/scalars/json/json_path_exists.rs:63-102 — 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) src/common/function/src/scalars/vector/vector_add.rs:62— src/common/function/src/scalars/vector/vector_add.rs:62-89 | src/common/function/src/scalars/vector/vector_div.rs:63-90 | src/common/function/src/scalars/vector/vector_mul.rs:62-89 | src/common/function/src/scalars/vector/vector_sub.rs:61-88 — 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) src/common/meta/src/key/table_info.rs:218— src/common/meta/src/key/table_info.rs:218-244 | src/common/meta/src/key/table_info.rs:250-276 | src/common/meta/src/key/view_info.rs:209-235 | src/common/meta/src/key/view_info.rs:241-267 — 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) src/common/meta/src/reconciliation/reconcile_catalog.rs:180— src/common/meta/src/reconciliation/reconcile_catalog.rs:180-207 | src/common/meta/src/reconciliation/reconcile_database.rs:220-247 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:196-223 | src/common/meta/src/reconciliation/reconcile_table.rs:307-334 — 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) src/pipeline/src/etl/processor/decolorize.rs:108— src/pipeline/src/etl/processor/decolorize.rs:108-130 | src/pipeline/src/etl/processor/digest.rs:204-226 | src/pipeline/src/etl/processor/epoch.rs:184-209 | src/pipeline/src/etl/processor/gsub.rs:122-144 — 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) src/promql/src/functions/double_exponential_smoothing.rs:137— src/promql/src/functions/double_exponential_smoothing.rs:137-213 | src/promql/src/functions/idelta.rs:63-166 | src/promql/src/functions/predict_linear.rs:61-213 | src/promql/src/functions/quantile.rs:56-196 — 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) src/promql/src/functions/native_histogram.rs:1118— src/promql/src/functions/native_histogram.rs:1118-1189 | src/promql/src/functions/native_histogram.rs:1195-1289 | src/promql/src/functions/native_histogram.rs:2472-2655 | src/promql/src/functions/native_histogram.rs:2748-2849 — 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) src/common/meta/src/kv_backend/test.rs:549— src/common/meta/src/kv_backend/test.rs:549-576 | src/common/meta/src/kv_backend/test.rs:578-616 | src/common/meta/src/kv_backend/test.rs:618-656 | src/common/meta/src/kv_backend/test.rs:658-696 — 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) tests-fuzz/src/translator/mysql/alter_expr.rs:89— tests-fuzz/src/translator/mysql/alter_expr.rs:89-99 | tests-fuzz/src/translator/mysql/create_expr.rs:61-71 | tests-fuzz/src/translator/postgres/alter_expr.rs:75-85 | tests-fuzz/src/translator/postgres/create_expr.rs:57-67 — 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) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:118— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:118-238 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:66-188 | tests-fuzz/targets/ddl/fuzz_create_table.rs:91-121 | tests-fuzz/targets/fuzz_insert.rs:126-216 — 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.
servers::postgres::types::parameters_to_scalar_values (cyclomatic 131) src/servers/src/postgres/types.rs:556— servers::postgres::types::parameters_to_scalar_values has cyclomatic complexity 131 (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.
servers::http::jaeger::traces_from_records (cyclomatic 64) src/servers/src/http/jaeger.rs:764— servers::http::jaeger::traces_from_records has cyclomatic complexity 64 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
servers::mysql::helper::convert_value (cyclomatic 49) src/servers/src/mysql/helper.rs:141— servers::mysql::helper::convert_value 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.
servers::batcher::table::pending_worker::start_worker (cyclomatic 19) src/servers/src/batcher/table/pending_worker.rs:64— servers::batcher::table::pending_worker::start_worker 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.
servers::postgres::handler::describe_fields (cyclomatic 18) src/servers/src/postgres/handler.rs:566— servers::postgres::handler::describe_fields 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.
servers::http::prometheus::label_values_query (cyclomatic 18) src/servers/src/http/prometheus.rs:1683— servers::http::prometheus::label_values_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.
servers::pipeline::run_custom_pipeline (cyclomatic 18) src/servers/src/pipeline.rs:99— servers::pipeline::run_custom_pipeline 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.
servers::http::prometheus::update_metric_name_matcher (cyclomatic 17) src/servers/src/http/prometheus.rs:1619— servers::http::prometheus::update_metric_name_matcher 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.
servers::http::handler::sql_analyze_stream (cyclomatic 16) src/servers/src/http/handler.rs:293— servers::http::handler::sql_analyze_stream 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.
servers::otlp::trace::v1::write_attribute_with_schema (cyclomatic 16) src/servers/src/otlp/trace/v1.rs:606— servers::otlp::trace::v1::write_attribute_with_schema 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.
servers::http::prometheus::collect_metric_names (cyclomatic 16) src/servers/src/http/prometheus.rs:1377— servers::http::prometheus::collect_metric_names has cyclomatic complexity 16 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
Repeated repair: src/mito2/src/compaction/twcs.rs src/mito2/src/compaction/twcs.rs:131— src/mito2/src/compaction/twcs.rs changed 12 times in last 90 days and 7 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 TwcsPicker::build_output at line 131), 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(mito2): compare primary key ranges across schema versions (#9205)”; “fix(mito2): preserve last-non-null values across compaction (#9169)”; “fix(mito2): avoid chained L1 rewrites in TWCS (#8981)”; “fix(mito2): keep deletion markers when compacting part of a window (#8872)”. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/mito2/src/compaction/twcs.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: src/object-store/src/secure_fs.rs src/object-store/src/secure_fs.rs:536— src/object-store/src/secure_fs.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 10 (its worst body is SecureFsLister::next at line 536), 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: release completed SST write buffers during compaction (#9243)”; “fix(object-store): fix unused import on Windows after #8735 (#8752)”; “fix(object-store): skip removed-entry lister test on Windows (#8735)”; “test(object-store): fix racy SecureFs abort test (#8720)”. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/object-store/src/secure_fs.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: src/query/src/analyze.rs src/query/src/analyze.rs:357— src/query/src/analyze.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 4 (its worst body is JsonMetrics::from_record_batch_metrics at line 357), 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: postgres describe for more statements (#8974)”; “fix: update tokio-postgres and correct explain/fetch cursor output schema (#8955)”; “fix(query): preserve bare plan names in analyze json (#8519)”; “fix(query): validate DistAnalyzeExec child count (#8510)”. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/query/src/analyze.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: src/auth/src/permission.rs src/auth/src/permission.rs:326— src/auth/src/permission.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 6 (its worst body is DefaultPermissionChecker::check_permission at line 326), 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: harden permission checks and process visibility (#8852)”; “fix: enforce permissions for restricted HTTP endpoints (#8672)”; “fix: enforce table-aware permissions across query and ingest protocols (#8552)”; “fix: close database ACL gaps in permission checks (#8492)”. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/auth/src/permission.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: src/query/src/optimizer/type_conversion.rs src/query/src/optimizer/type_conversion.rs:244— src/query/src/optimizer/type_conversion.rs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is TypeConverter::f_up at line 244), 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(query): keep INSERT timestamp conversion out of the source query (#8911)”; “fix(query): preserve timestamp literal semantics in inserts (#8889)”; “fix(query): respect query timezone in timestamp casts (#8859)”; “fix: convert literals in joins and subqueries (#8501)”. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/query/src/optimizer/type_conversion.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: src/promql/src/extension_plan/range_manipulate.rs src/promql/src/extension_plan/range_manipulate.rs:764— src/promql/src/extension_plan/range_manipulate.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 9 (its worst body is RangeManipulateStream::calculate_range at line 764), 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(promql): resolve dotted column names as unqualified columns (#9391)”; “fix(promql): preserve native timestamps through sample selection (#9070)”; “fix(promql): preserve query-aligned range tail (#8650)”. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/promql/src/extension_plan/range_manipulate.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: src/session/src/lib.rs src/session/src/lib.rs:191— src/session/src/lib.rs changed 5 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 2 (its worst body is Session::add_warning at line 191), 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: postgres describe for more statements (#8974)”; “fix: update tokio-postgres and correct explain/fetch cursor output schema (#8955)”; “fix: enforce table-aware permissions across query and ingest protocols (#8552)”. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/session/src/lib.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/query/src/sql.rs src/query/src/sql.rs:847— src/query/src/sql.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 8 (its worst body is query::sql::show_variable at line 847), 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: postgres describe for more statements (#8974)”; “fix: harden permission checks and process visibility (#8852)”; “fix: sandbox SQL local filesystem access (#8708)”. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/query/src/sql.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: src/common/time/src/timestamp.rs src/common/time/src/timestamp.rs:451— src/common/time/src/timestamp.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 Timestamp::from_str at line 451), 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(mysql): interpret prepared statement datetime params in session timezone (#8923)”; “fix(mysql): fail closed on unrepresentable timestamps (#8580)”; “fix: avoid panic when negating MIN-valued literals (#8484)”. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/common/time/src/timestamp.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: src/meta-srv/src/bootstrap.rs src/meta-srv/src/bootstrap.rs:286— src/meta-srv/src/bootstrap.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 9 (its worst body is meta_srv::bootstrap::metasrv_builder at line 286), 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(repartition): enforce GC across lifecycle (#8678)”; “fix(meta): configure gRPC message limits (#8616)”; “fix(meta): configure heartbeat message size (#8411)”. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/meta-srv/src/bootstrap.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: src/meta-client/src/client/heartbeat.rs src/meta-client/src/client/heartbeat.rs:66— src/meta-client/src/client/heartbeat.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 2 (its worst body is HeartbeatConfig::from_response at line 66), 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(meta): configure gRPC message limits (#8616)”; “fix: reject datanode startup on GC config mismatch (#8509)”; “fix(meta): configure heartbeat message size (#8411)”. 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 13:17:42 +00:00' --until='2026-09-29 13:17:42 +00:00' --full-history --no-merges -- src/meta-client/src/client/heartbeat.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.
PromPlanner::create_function_expr (cognitive 139) src/query/src/promql/planner.rs:3278— PromPlanner::create_function_expr has cognitive complexity 139 (threshold 15). Drivers by points: if/else 70 (118 pts), loops 6 (13 pts), boolean chains 5, match/switch 2 (3 pts) (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PromPlanner::or_operator (cognitive 91) src/query/src/promql/planner/set_operator.rs:43— PromPlanner::or_operator has cognitive complexity 91 (threshold 15). Drivers by points: if/else 45 (59 pts), boolean chains 17, loops 6 (10 pts), match/switch 3 (5 pts) (nesting depth added 20). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
PromPlanner::prom_binary_expr_to_plan (cognitive 81) src/query/src/promql/planner.rs:934— PromPlanner::prom_binary_expr_to_plan has cognitive complexity 81 (threshold 15). Drivers by points: if/else 31 (53 pts), boolean chains 18, match/switch 5 (10 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PromPlanner::selector_to_series_normalize_plan (cognitive 44) src/query/src/promql/planner.rs:2247— PromPlanner::selector_to_series_normalize_plan has cognitive complexity 44 (threshold 15). Drivers by points: if/else 13 (28 pts), loops 4 (12 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PromPlanner::create_table_scan_plan (cognitive 36) src/query/src/promql/planner.rs:2762— PromPlanner::create_table_scan_plan has cognitive complexity 36 (threshold 15). Drivers by points: if/else 15 (24 pts), loops 3 (6 pts), boolean chains 4, 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.
PromPlanner::prom_aggr_expr_to_plan (cognitive 32) src/query/src/promql/planner.rs:532— PromPlanner::prom_aggr_expr_to_plan has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (19 pts), match/switch 4 (10 pts), boolean chains 3 (nesting depth added 14). 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.
PromPlanner::matchers_to_expr (cognitive 27) src/query/src/promql/planner.rs:2524— PromPlanner::matchers_to_expr has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (21 pts), boolean chains 3, 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.
PromPlanner::agg_modifier_to_col (cognitive 26) src/query/src/promql/planner.rs:2419— PromPlanner::agg_modifier_to_col has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 14). 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.
PromPlanner::build_binary_island_field_exprs (cognitive 21) src/query/src/promql/planner/island.rs:364— PromPlanner::build_binary_island_field_exprs has cognitive complexity 21 (threshold 15). Drivers by points: loops 4 (11 pts), match/switch 3 (5 pts), if/else 1 (4 pts), boolean chains 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.
PromPlanner::set_op_on_non_field_columns (cognitive 17) src/query/src/promql/planner/set_operator.rs:637— PromPlanner::set_op_on_non_field_columns has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (11 pts), loops 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PromPlanner::build_time_index_filter (cognitive 16) src/query/src/promql/planner.rs:2662— PromPlanner::build_time_index_filter has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (8 pts), match/switch 4, 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.
operator::req_convert::common::push_column_to_rows (cognitive 187) src/operator/src/req_convert/common.rs:202— operator::req_convert::common::push_column_to_rows has cognitive complexity 187 (threshold 15). Drivers by points: if/else 62 (124 pts), loops 31 (62 pts), match/switch 1 (nesting depth added 93). 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.
operator::statement::semantic_graph::conventions::validate (cognitive 41) src/operator/src/statement/semantic_graph/conventions.rs:173— operator::statement::semantic_graph::conventions::validate has cognitive complexity 41 (threshold 15). Drivers by points: if/else 13 (29 pts), loops 5 (7 pts), match/switch 1 (3 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
operator::statement::export_logical_tables::write_tables (cognitive 29) src/operator/src/statement/export_logical_tables.rs:425— operator::statement::export_logical_tables::write_tables has cognitive complexity 29 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 5 (11 pts), match/switch 1 (2 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.
operator::statement::copy_table_to::stream_to_managed_parquet_with_packed (cognitive 26) src/operator/src/statement/copy_table_to.rs:262— operator::statement::copy_table_to::stream_to_managed_parquet_with_packed has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (18 pts), boolean chains 3, 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.
operator::expr_helper::expr_to_create (cognitive 23) src/operator/src/expr_helper.rs:262— operator::expr_helper::expr_to_create has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), match/switch 1 (3 pts), loops 2, boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
operator::expr_helper::to_alter_table_expr (cognitive 22) src/operator/src/expr_helper.rs:811— operator::expr_helper::to_alter_table_expr has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 7 (16 pts), if/else 3 (6 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
operator::statement::export_database::run_database_export_jobs (cognitive 21) src/operator/src/statement/export_database.rs:321— operator::statement::export_database::run_database_export_jobs has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 3 (5 pts), boolean chains 3, loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
operator::req_convert::common::prepare_rows (cognitive 18) src/operator/src/req_convert/common.rs:74— operator::req_convert::common::prepare_rows has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 3 (7 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
operator::insert::fill_table_options_for_create (cognitive 18) src/operator/src/insert.rs:1860— operator::insert::fill_table_options_for_create has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), loops 2, 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.
operator::statement::semantic_graph::relationships::co_declared_branch (cognitive 17) src/operator/src/statement/semantic_graph/relationships.rs:155— operator::statement::semantic_graph::relationships::co_declared_branch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×10
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium vulnerability · ×10
Low cohesion: MockKvBackend (LCOM4 7) src/common/meta/src/kv_backend/test_util.rs:32— MockKvBackend'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: CacheManager (LCOM4 6) src/mito2/src/cache.rs:1020— CacheManager's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: GrpcServerBuilder (LCOM4 6) src/servers/src/grpc/builder.rs:85— GrpcServerBuilder's methods fall into 6 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 6 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DatanodeTableManager (LCOM4 4) src/common/meta/src/key/datanode_table.rs:151— DatanodeTableManager's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: RegionServerInner (LCOM4 4) src/datanode/src/region_server.rs:1041— RegionServerInner's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DefaultGcSchedulerCtx (LCOM4 4) src/meta-srv/src/gc/ctx.rs:154— DefaultGcSchedulerCtx's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: WriteRequest (LCOM4 4) src/mito2/src/request.rs:69— WriteRequest's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: DfContextProviderAdapter (LCOM4 4) src/query/src/datafusion/planner.rs:47— DfContextProviderAdapter's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: StandaloneInformationExtension (LCOM4 4) src/standalone/src/information_extension.rs:34— StandaloneInformationExtension's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: ScannerProperties (LCOM4 4) src/store-api/src/region_engine.rs:295— ScannerProperties'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.
RegionWorkerLoop::handle_alter_region_options_fast (cognitive 29) src/mito2/src/worker/handle_alter.rs:218— RegionWorkerLoop::handle_alter_region_options_fast has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (26 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegionWorkerLoop::process_write_requests (cognitive 29) src/mito2/src/worker/handle_write.rs:304— RegionWorkerLoop::process_write_requests has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (24 pts), match/switch 1 (3 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.
RegionWorkerLoop::process_bulk_requests (cognitive 26) src/mito2/src/worker/handle_write.rs:460— RegionWorkerLoop::process_bulk_requests has cognitive complexity 26 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 1 (3 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.
RegionWorkerLoop::handle_write_requests (cognitive 23) src/mito2/src/worker/handle_write.rs:43— RegionWorkerLoop::handle_write_requests has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (12 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (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, 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.
RegionWorkerLoop::run (cognitive 22) src/mito2/src/worker.rs:1014— RegionWorkerLoop::run has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 5 (13 pts), if/else 3 (6 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RegionWorkerLoop::handle_alter_request (cognitive 20) src/mito2/src/worker/handle_alter.rs:48— RegionWorkerLoop::handle_alter_request has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 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.
RegionWorkerLoop::handle_truncate_request (cognitive 19) src/mito2/src/worker/handle_truncate.rs:29— RegionWorkerLoop::handle_truncate_request has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 2 (5 pts), match/switch 4, boolean chains 2 (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.
RegionWorkerLoop::handle_region_edit_result (cognitive 18) src/mito2/src/worker/handle_manifest.rs:386— RegionWorkerLoop::handle_region_edit_result has cognitive complexity 18 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 2, 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.
RegionWorkerLoop::handle_flush_finished (cognitive 17) src/mito2/src/worker/handle_flush.rs:381— RegionWorkerLoop::handle_flush_finished has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (6 pts), match/switch 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.
Duplicated block (18 lines × 2) src/catalog/src/system_schema/information_schema/columns.rs:317— src/catalog/src/system_schema/information_schema/columns.rs:317-336 | src/catalog/src/system_schema/information_schema/tables.rs:354-371 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 2) src/cmd/src/flownode.rs:296— src/cmd/src/flownode.rs:296-313 | src/cmd/src/frontend.rs:436-453 — before extracting anything, compare `src/cmd/src/flownode.rs` and `src/cmd/src/frontend.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) src/common/function/src/aggrs/geo/encoding.rs:181— src/common/function/src/aggrs/geo/encoding.rs:181-198 | src/common/function/src/aggrs/geo/geo_path.rs:210-227 — before extracting anything, compare `src/common/function/src/aggrs/geo/encoding.rs` and `src/common/function/src/aggrs/geo/geo_path.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (18 lines × 2) src/datanode/src/datanode.rs:625— src/datanode/src/datanode.rs:625-642 | src/datanode/src/datanode.rs:689-706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) src/datanode/src/datanode.rs:668— src/datanode/src/datanode.rs:668-685 | src/datanode/src/datanode.rs:719-736 — both copies are in the same file, so extract the block into 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) src/flow/src/batching_mode/frontend_client.rs:447— src/flow/src/batching_mode/frontend_client.rs:447-464 | src/flow/src/batching_mode/frontend_client.rs:692-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.
Duplicated block (18 lines × 2) src/flow/src/heartbeat.rs:195— src/flow/src/heartbeat.rs:195-212 | src/frontend/src/heartbeat.rs:582-599 — 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 lines × 2) src/meta-srv/src/gc/handler.rs:345— src/meta-srv/src/gc/handler.rs:345-362 | src/meta-srv/src/gc/handler.rs:378-395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (18 lines × 2) src/operator/src/statement.rs:731— src/operator/src/statement.rs:731-748 | src/operator/src/statement.rs:750-767 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) src/common/datasource/src/file_format/csv.rs:163— src/common/datasource/src/file_format/csv.rs:163-179 | src/common/datasource/src/file_format/json.rs:91-107 — 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) src/common/function/src/scalars/geo/geohash.rs:50— src/common/function/src/scalars/geo/geohash.rs:50-66 | src/common/function/src/scalars/geo/geohash.rs:147-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 (17 lines × 2) src/common/function/src/scalars/geo/h3.rs:62— src/common/function/src/scalars/geo/h3.rs:62-78 | src/common/function/src/scalars/geo/h3.rs:153-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) src/common/meta/src/key/table_info.rs:260— src/common/meta/src/key/table_info.rs:260-276 | src/common/meta/src/key/view_info.rs:251-267 — before extracting anything, compare `src/common/meta/src/key/table_info.rs` and `src/common/meta/src/key/view_info.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17 lines × 2) src/common/time/src/timestamp.rs:78— src/common/time/src/timestamp.rs:78-94 | src/common/time/src/timestamp.rs:114-130 — both copies are in the same file, so extract the block into 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) src/meta-client/src/client/cluster.rs:176— src/meta-client/src/client/cluster.rs:176-192 | src/meta-client/src/client/procedure.rs:210-226 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (17 lines × 2) src/sql/src/parsers/create_parser/trigger.rs:392— src/sql/src/parsers/create_parser/trigger.rs:392-408 | src/sql/src/parsers/create_parser/trigger.rs:433-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) src/datanode/src/datanode.rs:946— src/datanode/src/datanode.rs:946-962 | src/datanode/src/datanode.rs:1008-1025 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:274— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:274-290 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:408-424 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 205 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) src/common/time/src/duration.rs:84— src/common/time/src/duration.rs:84-89 | src/common/time/src/time.rs:98-103 | src/common/time/src/timestamp.rs:299-304 — 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) src/servers/src/http/prometheus.rs:406— src/servers/src/http/prometheus.rs:406-411 | src/servers/src/http/prometheus.rs:537-542 | src/servers/src/http/prometheus.rs:2386-2392 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/sql/src/parsers/alter_parser/trigger.rs:111— src/sql/src/parsers/alter_parser/trigger.rs:111-116 | src/sql/src/parsers/alter_parser/trigger.rs:138-143 | src/sql/src/parsers/alter_parser/trigger.rs:171-176 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/store-api/src/region_info.rs:107— src/store-api/src/region_info.rs:107-112 | src/store-api/src/sst_entry.rs:179-184 | src/store-api/src/sst_entry.rs:383-388 — 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) src/cli/src/metadata/control/del.rs:36— src/cli/src/metadata/control/del.rs:36-41 | src/cli/src/metadata/control/get.rs:41-46 | src/cli/src/metadata/control/put.rs:50-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 3 call sites, so a change lands once.
Duplicated block (6 lines × 3) src/common/meta/src/cache/flow/table_flownode.rs:62— src/common/meta/src/cache/flow/table_flownode.rs:62-67 | src/common/meta/src/cache/table/table_name.rs:40-45 | src/common/meta/src/cache/table/view_info.rs:39-44 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 3) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:82— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:82-87 | tests-fuzz/targets/failover/fuzz_failover_mito_regions.rs:91-96 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:80-85 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 205 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) tests-fuzz/targets/failover/fuzz_failover_mito_regions.rs:88— tests-fuzz/targets/failover/fuzz_failover_mito_regions.rs:88-93 | tests-fuzz/targets/fuzz_insert.rs:71-76 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:84-89 — before extracting anything, compare `tests-fuzz/targets/fuzz_insert.rs` and `tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:86— tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:86-91 | tests-fuzz/targets/ddl/fuzz_create_table.rs:94-99 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:256-262 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_create_logical_table.rs` and `tests-fuzz/targets/ddl/fuzz_create_table.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 59 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Off the main sequence: common-version — common-version: abstractness 0.00, instability 0.00, distance 1.00 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: common-batcher — common-batcher: abstractness 0.11, instability 0.00, distance 0.89 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: common-telemetry — common-telemetry: abstractness 0.06, instability 0.07, distance 0.87 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: api — api: abstractness 0.00, instability 0.16, distance 0.84 — zone of pain — concrete and depended on by 31 project(s), so it's rigid to change.
Off the main sequence: common-time — common-time: abstractness 0.14, instability 0.06, distance 0.80 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: object-store — object-store: abstractness 0.00, instability 0.28, distance 0.72 — zone of pain — concrete and depended on by 13 project(s), so it's rigid to change.
Off the main sequence: common-runtime — common-runtime: abstractness 0.17, instability 0.12, distance 0.72 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: common-decimal — common-decimal: abstractness 0.00, instability 0.29, distance 0.71 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
Off the main sequence: common-base — common-base: abstractness 0.29, instability 0.00, distance 0.71 — the shape a shared-kernel / building-block library has BY DESIGN — concrete and widely depended-on is what makes it useful, and this dimension does not penalise it (the distance is reported for completeness, not as a defect). Worth a look only if it has grown past one coherent kernel into an everything-bucket.
ParserContext::parse_show (cognitive 50) src/sql/src/parsers/show_parser.rs:38— ParserContext::parse_show has cognitive complexity 50 (threshold 15). Drivers by points: if/else 37 (43 pts), boolean chains 7 (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.
ParserContext::parse_one_impl (cognitive 29) src/common/function/src/scalars/matches.rs:561— ParserContext::parse_one_impl has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 4 (7 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParserContext::parse_create_flow (cognitive 27) src/sql/src/parsers/create_parser.rs:301— ParserContext::parse_create_flow has cognitive complexity 27 (threshold 15). Drivers by points: if/else 18 (22 pts), boolean chains 3, match/switch 1 (2 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.
ParserContext::to_rpn (cognitive 22) src/common/function/src/scalars/matches.rs:503— ParserContext::to_rpn has cognitive complexity 22 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 4 (8 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParserContext::accomplish_optional_unary_op (cognitive 17) src/common/function/src/scalars/matches.rs:444— ParserContext::accomplish_optional_unary_op has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParserContext::parse_alter_trigger (cognitive 17) src/sql/src/parsers/alter_parser/trigger.rs:65— ParserContext::parse_alter_trigger has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (14 pts), boolean chains 1, if/else 1, loops 1 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ParserContext::parse_create (cognitive 16) src/sql/src/parsers/create_parser.rs:85— ParserContext::parse_create has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 6 (16 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.
ParserContext::parse_tql_query (cognitive 16) src/sql/src/parsers/tql_parser.rs:363— ParserContext::parse_tql_query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), loops 2, boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×8
Members sharing a duplicated core (5 members, 50+ identical tokens) src/catalog/src/system_schema/information_schema/flow_statistics.rs:123— src/catalog/src/system_schema/information_schema/flow_statistics.rs:123-141 | src/catalog/src/system_schema/information_schema/flows.rs:210-228 | src/catalog/src/system_schema/information_schema/table_semantics.rs:250-268 | src/catalog/src/system_schema/information_schema/tables.rs:154-172 | src/catalog/src/system_schema/information_schema/views.rs:117-135 — 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) src/cmd/src/datanode.rs:306— src/cmd/src/datanode.rs:306-417 | src/cmd/src/flownode.rs:186-245 | src/cmd/src/frontend.rs:261-366 | src/cmd/src/metasrv.rs:230-318 | src/cmd/src/standalone.rs:375-447 — 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) src/common/function/src/scalars/vector/elem_avg.rs:35— src/common/function/src/scalars/vector/elem_avg.rs:35-49 | src/common/function/src/scalars/vector/elem_product.rs:48-62 | src/common/function/src/scalars/vector/elem_sum.rs:35-49 | src/common/function/src/scalars/vector/vector_dim.rs:48-62 | src/common/function/src/scalars/vector/vector_norm.rs:51-65 — 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) src/common/meta/src/key/schema_name.rs:282— src/common/meta/src/key/schema_name.rs:282-293 | src/common/meta/src/key/table_info.rs:181-193 | src/common/meta/src/key/table_repart.rs:212-224 | src/common/meta/src/key/table_route.rs:660-672 | src/common/meta/src/key/view_info.rs:180-192 — 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) src/pipeline/src/etl/processor/csv.rs:196— src/pipeline/src/etl/processor/csv.rs:196-226 | src/pipeline/src/etl/processor/date.rs:196-227 | src/pipeline/src/etl/processor/dissect.rs:612-642 | src/pipeline/src/etl/processor/letter.rs:128-158 | src/pipeline/src/etl/processor/urlencoding.rs:129-158 — 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) src/pipeline/src/etl/processor/dissect.rs:612— src/pipeline/src/etl/processor/dissect.rs:612-642 | src/pipeline/src/etl/processor/join.rs:98-128 | src/pipeline/src/etl/processor/letter.rs:128-158 | src/pipeline/src/etl/processor/regex.rs:200-230 | src/pipeline/src/etl/processor/urlencoding.rs:129-158 — 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) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:101— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:101-116 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:66-188 | tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:125-140 | tests-fuzz/targets/fuzz_insert_logical_table.rs:103-118 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:124-139 — 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) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:118— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:118-238 | tests-fuzz/targets/ddl/fuzz_alter_table.rs:224-325 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:66-188 | tests-fuzz/targets/ddl/fuzz_create_table.rs:91-121 | tests-fuzz/targets/unstable/fuzz_create_table_standalone.rs:198-216 — 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 (12–13 lines × 2) src/common/datasource/src/packed_writer.rs:160— src/common/datasource/src/packed_writer.rs:160-171 | src/common/datasource/src/parquet_writer.rs:249-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 (12–13 lines × 2) src/datanode/src/service.rs:66— src/datanode/src/service.rs:66-78 | src/flow/src/server.rs:417-428 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (12–13 lines × 2) src/flow/src/batching_mode/frontend_client.rs:595— src/flow/src/batching_mode/frontend_client.rs:595-606 | src/flow/src/batching_mode/frontend_client.rs:675-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 (12–13 lines × 2) src/mito2/src/read/seq_scan.rs:605— src/mito2/src/read/seq_scan.rs:605-617 | src/mito2/src/read/unordered_scan.rs:389-400 — before extracting anything, compare `src/mito2/src/read/seq_scan.rs` and `src/mito2/src/read/unordered_scan.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 2) src/mito2/src/read/series_scan.rs:1133— src/mito2/src/read/series_scan.rs:1133-1145 | src/mito2/src/read/series_scan.rs:1149-1160 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–13 lines × 2) src/promql/src/extension_plan/normalize.rs:295— src/promql/src/extension_plan/normalize.rs:295-307 | src/promql/src/extension_plan/series_divide.rs:358-369 — before extracting anything, compare `src/promql/src/extension_plan/normalize.rs` and `src/promql/src/extension_plan/series_divide.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 (12–13 lines × 2) src/query/src/promql/planner.rs:2342— src/query/src/promql/planner.rs:2342-2354 | src/query/src/promql/planner.rs:2977-2988 — both copies are in the same file, so extract the block into 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) src/sql/src/parsers/alter_parser/trigger.rs:350— src/sql/src/parsers/alter_parser/trigger.rs:350-362 | src/sql/src/parsers/create_parser/trigger.rs:424-435 — `src/sql/src/parsers/alter_parser/trigger.rs` and `src/sql/src/parsers/create_parser/trigger.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 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (9 lines × 3) src/client/src/flow.rs:69— src/client/src/flow.rs:69-77 | src/client/src/flow.rs:96-104 | src/client/src/flow.rs:110-118 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/index/src/fulltext_index/create/bloom_filter.rs:119— src/index/src/fulltext_index/create/bloom_filter.rs:119-127 | src/mito2/src/sst/index/bloom_filter/creator.rs:426-434 | src/mito2/src/sst/index/inverted_index/creator.rs:408-416 — `src/mito2/src/sst/index/bloom_filter/creator.rs` and `src/mito2/src/sst/index/inverted_index/creator.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 6 separate duplicated blocks between them, totalling at least 63 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 × 3) src/promql/src/extension_plan/instant_manipulate.rs:149— src/promql/src/extension_plan/instant_manipulate.rs:149-157 | src/promql/src/extension_plan/normalize.rs:102-110 | src/promql/src/extension_plan/series_divide.rs:195-203 — before extracting anything, compare `src/promql/src/extension_plan/instant_manipulate.rs` and `src/promql/src/extension_plan/normalize.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) src/common/meta/src/key/table_info.rs:205— src/common/meta/src/key/table_info.rs:205-213 | src/common/meta/src/key/topic_name.rs:199-207 | src/common/meta/src/key/view_info.rs:198-206 — before extracting anything, compare `src/common/meta/src/key/table_info.rs` and `src/common/meta/src/key/view_info.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) src/promql/src/extension_plan/histogram_fold.rs:222— src/promql/src/extension_plan/histogram_fold.rs:222-230 | src/promql/src/extension_plan/instant_manipulate.rs:185-194 | src/promql/src/extension_plan/normalize.rs:139-148 — before extracting anything, compare `src/promql/src/extension_plan/instant_manipulate.rs` and `src/promql/src/extension_plan/normalize.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) src/common/function/src/aggrs/vector/avg.rs:69— src/common/function/src/aggrs/vector/avg.rs:69-77 | src/common/function/src/aggrs/vector/product.rs:68-76 | src/common/function/src/aggrs/vector/sum.rs:68-76 — before extracting anything, compare `src/common/function/src/aggrs/vector/avg.rs` and `src/common/function/src/aggrs/vector/product.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 33 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) src/common/meta/src/kv_backend/test.rs:273— src/common/meta/src/kv_backend/test.rs:273-281 | src/common/meta/src/kv_backend/test.rs:285-293 | src/common/meta/src/kv_backend/test.rs:297-305 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:164— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:164-172 | tests-fuzz/targets/fuzz_insert_logical_table.rs:208-216 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:163-171 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/fuzz_insert_logical_table.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 3) src/common/function/src/scalars/geo/measure.rs:69— src/common/function/src/scalars/geo/measure.rs:69-76 | src/common/function/src/scalars/geo/measure.rs:132-139 | src/common/function/src/scalars/geo/measure.rs:203-210 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) src/common/function/src/scalars/ip/ipv6.rs:163— src/common/function/src/scalars/ip/ipv6.rs:163-170 | src/common/function/src/scalars/json/parse_json.rs:59-66 | src/common/function/src/scalars/vector/convert/parse_vector.rs:60-67 — 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) src/servers/src/grpc/flight/stream.rs:231— src/servers/src/grpc/flight/stream.rs:231-238 | src/servers/src/grpc/flight/stream.rs:354-361 | src/servers/src/grpc/flight/stream.rs:615-622 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 3) src/meta-srv/src/event/gc.rs:120— src/meta-srv/src/event/gc.rs:120-127 | src/meta-srv/src/event/repartition.rs:121-128 | src/meta-srv/src/event/repartition.rs:330-337 — 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) src/common/function/src/scalars/matches.rs:565— src/common/function/src/scalars/matches.rs:565-572 | src/common/function/src/scalars/matches.rs:588-595 | src/common/function/src/scalars/matches.rs:611-619 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/common/macro/src/row/into_row.rs:28— src/common/macro/src/row/into_row.rs:28-35 | src/common/macro/src/row/schema.rs:30-37 | src/common/macro/src/row/to_row.rs:28-35 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) src/servers/src/http/result/csv_result.rs:42— src/servers/src/http/result/csv_result.rs:42-49 | src/servers/src/http/result/json_result.rs:38-45 | src/servers/src/http/result/table_result.rs:39-46 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (8 lines × 3) src/cmd/src/bin/query_regression_runner/direct.rs:388— src/cmd/src/bin/query_regression_runner/direct.rs:388-395 | src/cmd/src/bin/query_regression_runner/remote/ingest.rs:286-293 | src/cmd/src/bin/query_regression_runner/remote/storage.rs:57-64 — before extracting anything, compare `src/cmd/src/bin/query_regression_runner/remote/ingest.rs` and `src/cmd/src/bin/query_regression_runner/remote/storage.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. If that is what happened, the fix is to keep one copy and have the 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) src/common/function/src/scalars/geo/geohash.rs:99— src/common/function/src/scalars/geo/geohash.rs:99-103 | src/common/function/src/scalars/geo/h3.rs:198-202 | src/common/function/src/scalars/geo/wkt.rs:82-86 — before extracting anything, compare `src/common/function/src/scalars/geo/geohash.rs` and `src/common/function/src/scalars/geo/h3.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 3) src/common/meta/src/ddl/create_table.rs:396— src/common/meta/src/ddl/create_table.rs:396-400 | src/common/meta/src/ddl/create_view.rs:268-272 | src/common/meta/src/reconciliation/reconcile_table.rs:356-360 — 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 (5 lines × 3) src/common/meta/src/ddl/drop_table.rs:404— src/common/meta/src/ddl/drop_table.rs:404-408 | src/common/meta/src/ddl/drop_view.rs:205-209 | src/common/meta/src/ddl/truncate_table.rs:81-85 — 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) src/query/src/sql.rs:651— src/query/src/sql.rs:651-655 | src/query/src/sql.rs:731-735 | src/query/src/sql.rs:1067-1071 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/mito2/src/manifest/action.rs:527— src/mito2/src/manifest/action.rs:527-531 | src/mito2/src/manifest/action.rs:615-619 | src/mito2/src/manifest/storage/checkpoint.rs:52-56 — 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) src/common/meta/src/key/flow/flow_route.rs:56— src/common/meta/src/key/flow/flow_route.rs:56-60 | src/common/meta/src/key/flow/flownode_flow.rs:70-74 | src/common/meta/src/key/flow/table_flow.rs:88-92 — 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) src/meta-srv/src/key.rs:58— src/meta-srv/src/key.rs:58-62 | src/meta-srv/src/key.rs:99-103 | src/meta-srv/src/key/datanode.rs:110-114 — 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) src/store-api/src/region_info.rs:90— src/store-api/src/region_info.rs:90-94 | src/store-api/src/sst_entry.rs:142-146 | src/store-api/src/sst_entry.rs:365-369 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (10 lines × 3) src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:232— src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:232-241 | src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:221-230 | src/meta-srv/src/procedure/repartition/group/sync_region.rs:202-211 — before extracting anything, compare `src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs` and `src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) src/promql/src/extension_plan/instant_manipulate.rs:573— src/promql/src/extension_plan/instant_manipulate.rs:573-582 | src/promql/src/extension_plan/range_manipulate.rs:585-594 | src/promql/src/extension_plan/scalar_calculate.rs:492-501 — before extracting anything, compare `src/promql/src/extension_plan/instant_manipulate.rs` and `src/promql/src/extension_plan/range_manipulate.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 3) src/common/meta/src/cache/table/table_info.rs:72— src/common/meta/src/cache/table/table_info.rs:72-81 | src/common/meta/src/cache/table/table_route.rs:104-113 | src/common/meta/src/cache/table/view_info.rs:64-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (10 lines × 3) src/pipeline/src/etl/processor/decolorize.rs:54— src/pipeline/src/etl/processor/decolorize.rs:54-63 | src/pipeline/src/etl/processor/digest.rs:115-124 | src/pipeline/src/etl/processor/gsub.rs:52-61 — before extracting anything, compare `src/pipeline/src/etl/processor/decolorize.rs` and `src/pipeline/src/etl/processor/digest.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 (10 lines × 3) src/promql/src/functions/idelta.rs:115— src/promql/src/functions/idelta.rs:115-124 | src/promql/src/functions/quantile.rs:117-126 | src/promql/src/functions/quantile.rs:164-173 — before extracting anything, compare `src/promql/src/functions/idelta.rs` and `src/promql/src/functions/quantile.rs` as WHOLE FILES: this scan already matched 3 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 × 3) tests-fuzz/src/ir.rs:266— tests-fuzz/src/ir.rs:266-275 | tests-fuzz/src/ir.rs:279-288 | tests-fuzz/src/ir.rs:292-301 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) tests-integration/src/test_util.rs:1197— tests-integration/src/test_util.rs:1197-1206 | tests-integration/src/test_util.rs:1240-1249 | tests-integration/src/test_util.rs:1295-1304 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) src/common/function/src/scalars/geo/h3.rs:1007— src/common/function/src/scalars/geo/h3.rs:1007-1013 | src/common/function/src/scalars/geo/h3.rs:1218-1224 | src/common/function/src/scalars/geo/h3.rs:1284-1290 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) src/mito2/src/read/seq_scan.rs:77— src/mito2/src/read/seq_scan.rs:77-83 | src/mito2/src/read/series_scan.rs:148-154 | src/mito2/src/read/unordered_scan.rs:62-68 — before extracting anything, compare `src/mito2/src/read/seq_scan.rs` and `src/mito2/src/read/unordered_scan.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) src/pipeline/src/etl/processor/json_parse.rs:102— src/pipeline/src/etl/processor/json_parse.rs:102-108 | src/pipeline/src/etl/processor/json_path.rs:134-140 | src/pipeline/src/etl/processor/simple_extract.rs:105-111 — before extracting anything, compare `src/pipeline/src/etl/processor/json_path.rs` and `src/pipeline/src/etl/processor/simple_extract.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) src/common/meta/src/reconciliation/reconcile_database.rs:249— src/common/meta/src/reconciliation/reconcile_database.rs:249-255 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:225-231 | src/common/meta/src/reconciliation/reconcile_table.rs:336-342 — before extracting anything, compare `src/common/meta/src/reconciliation/reconcile_database.rs` and `src/common/meta/src/reconciliation/reconcile_logical_tables.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) src/common/meta/src/reconciliation/reconcile_catalog.rs:144— src/common/meta/src/reconciliation/reconcile_catalog.rs:144-150 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:172-178 | src/common/meta/src/reconciliation/reconcile_table.rs:267-273 — before extracting anything, compare `src/common/meta/src/reconciliation/reconcile_catalog.rs` and `src/common/meta/src/reconciliation/reconcile_logical_tables.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 56 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) src/common/meta/src/key.rs:794— src/common/meta/src/key.rs:794-802 | src/common/meta/src/key.rs:1524-1530 | src/common/meta/src/key.rs:1736-1744 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 3) tests-fuzz/targets/ddl/fuzz_alter_table.rs:230— tests-fuzz/targets/ddl/fuzz_alter_table.rs:230-236 | tests-fuzz/targets/ddl/fuzz_create_table.rs:94-100 | tests-fuzz/targets/ddl/fuzz_repartition_table.rs:251-257 — 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.
PromPlanner::create_function_expr (cyclomatic 105) src/query/src/promql/planner.rs:3278— PromPlanner::create_function_expr has cyclomatic complexity 105 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PromPlanner::or_operator (cyclomatic 61) src/query/src/promql/planner/set_operator.rs:43— PromPlanner::or_operator has cyclomatic complexity 61 (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.
PromPlanner::prom_binary_expr_to_plan (cyclomatic 49) src/query/src/promql/planner.rs:934— PromPlanner::prom_binary_expr_to_plan 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.
PromPlanner::create_table_scan_plan (cyclomatic 22) src/query/src/promql/planner.rs:2762— PromPlanner::create_table_scan_plan 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.
PromPlanner::build_time_index_filter (cyclomatic 20) src/query/src/promql/planner.rs:2662— PromPlanner::build_time_index_filter 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.
PromPlanner::selector_to_series_normalize_plan (cyclomatic 19) src/query/src/promql/planner.rs:2247— PromPlanner::selector_to_series_normalize_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.
promql::functions::native_histogram::native_extrapolated_rate (cognitive 61) src/promql/src/functions/native_histogram.rs:2467— promql::functions::native_histogram::native_extrapolated_rate has cognitive complexity 61 (threshold 15). Drivers by points: if/else 28 (50 pts), boolean chains 6, loops 3 (5 pts) (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
promql::functions::native_histogram::combined_range_float (cognitive 29) src/promql/src/functions/native_histogram.rs:2101— promql::functions::native_histogram::combined_range_float has cognitive complexity 29 (threshold 15). Drivers by points: if/else 9 (23 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
promql::functions::native_histogram::native_idelta (cognitive 25) src/promql/src/functions/native_histogram.rs:2744— promql::functions::native_histogram::native_idelta has cognitive complexity 25 (threshold 15). Drivers by points: if/else 12 (22 pts), 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.
promql::functions::native_histogram::select_mixed_range_lanes (cognitive 23) src/promql/src/functions/native_histogram.rs:1937— promql::functions::native_histogram::select_mixed_range_lanes has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), boolean chains 3, match/switch 2 (3 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.
promql::functions::native_histogram::native_histogram_range_float (cognitive 22) src/promql/src/functions/native_histogram.rs:1191— promql::functions::native_histogram::native_histogram_range_float has cognitive complexity 22 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
promql::extension_plan::local_offset (cognitive 21) src/promql/src/extension_plan.rs:76— promql::extension_plan::local_offset has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (5 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.
cli::data::import_v2::packed::validate_snapshot (cognitive 45) src/cli/src/data/import_v2/packed.rs:29— cli::data::import_v2::packed::validate_snapshot has cognitive complexity 45 (threshold 15). Drivers by points: if/else 9 (29 pts), loops 4 (8 pts), boolean chains 4, 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.
cli::data::import_v2::command::parse_ddl_statements (cognitive 38) src/cli/src/data/import_v2/command.rs:405— cli::data::import_v2::command::parse_ddl_statements has cognitive complexity 38 (threshold 15). Drivers by points: if/else 14 (34 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli::data::export_v2::coordinator::export_data_concurrent (cognitive 26) src/cli/src/data/export_v2/coordinator.rs:172— cli::data::export_v2::coordinator::export_data_concurrent has cognitive complexity 26 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 4 (8 pts), loops 3 (7 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli::data::export_v2::command::build_verify_plan (cognitive 23) src/cli/src/data/export_v2/command.rs:1312— cli::data::export_v2::command::build_verify_plan has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 3 (6 pts), match/switch 2 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli::data::export_v2::command::verify_snapshot (cognitive 18) src/cli/src/data/export_v2/command.rs:1155— cli::data::export_v2::command::verify_snapshot has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli::data::import_v2::coordinator::import_tasks_concurrent (cognitive 17) src/cli/src/data/import_v2/coordinator.rs:301— cli::data::import_v2::coordinator::import_tasks_concurrent has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (3 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Instance::reconcile_trace_column_types (cognitive 42) src/frontend/src/instance/otlp/trace_ingest.rs:1943— Instance::reconcile_trace_column_types has cognitive complexity 42 (threshold 15). Drivers by points: if/else 11 (32 pts), loops 3 (6 pts), boolean chains 4 (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.
Instance::ingest_trace_spans (cognitive 33) src/frontend/src/instance/otlp/trace_ingest.rs:871— Instance::ingest_trace_spans has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (18 pts), loops 3 (7 pts), match/switch 3 (6 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.
Instance::prevalidate_trace_v1_fixed_columns (cognitive 25) src/frontend/src/instance/otlp/trace_ingest.rs:1568— Instance::prevalidate_trace_v1_fixed_columns has cognitive complexity 25 (threshold 15). Drivers by points: if/else 5 (18 pts), loops 3 (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.
Instance::prepare_trace_v1_request_schema (cognitive 19) src/frontend/src/instance/otlp/trace_ingest.rs:1488— Instance::prepare_trace_v1_request_schema has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (5 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Instance::do_query_inner (cognitive 18) src/frontend/src/instance.rs:786— Instance::do_query_inner has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 3 (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.
Instance::metrics (cognitive 17) src/frontend/src/instance/otlp.rs:91— Instance::metrics has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10, 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.
query::dist_plan::analyzer::utils::get_alias_layer_from_node (cognitive 32) src/query/src/dist_plan/analyzer/utils.rs:340— query::dist_plan::analyzer::utils::get_alias_layer_from_node has cognitive complexity 32 (threshold 15). Drivers by points: loops 5 (18 pts), if/else 7 (13 pts), match/switch 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
query::window_sort::compute_all_working_ranges (cognitive 26) src/query/src/window_sort.rs:1174— query::window_sort::compute_all_working_ranges has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (22 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
query::promql::planner::matching_filters::try_propagate (cognitive 23) src/query/src/promql/planner/matching_filters.rs:96— query::promql::planner::matching_filters::try_propagate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (10 pts), boolean chains 7, loops 2 (3 pts), match/switch 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
query::dist_plan::remote_dyn_filter_registry::run_entry_fanout (cognitive 19) src/query/src/dist_plan/remote_dyn_filter_registry.rs:318— query::dist_plan::remote_dyn_filter_registry::run_entry_fanout has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 2 (5 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.
query::dist_plan::analyzer::utils::aliased_columns_for_inner (cognitive 16) src/query/src/dist_plan/analyzer/utils.rs:284— query::dist_plan::analyzer::utils::aliased_columns_for_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (7 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.
query::sql::show_create_table::create_column (cognitive 16) src/query/src/sql/show_create_table.rs:85— query::sql::show_create_table::create_column has cognitive complexity 16 (threshold 15). Drivers by points: if/else 12 (13 pts), match/switch 1 (2 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.
TooManyFields: ScanMetricsSet src/mito2/src/read/scan_util.rs:110— TooManyFields — 67 stored fields beside 7 methods. The bar is 30 stored fields; this is 37 over it, 2.23× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: MitoConfig src/mito2/src/config.rs:61— TooManyFields — 50 stored fields beside 2 methods. The bar is 30 stored fields; this is 20 over it, 1.67× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RegionWorkerLoop src/mito2/src/worker.rs:934— TooManyFields — 38 stored fields beside 83 methods. The bar is 30 stored fields; this is 8 over it, 1.27× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Metasrv src/meta-srv/src/metasrv.rs:561— TooManyFields — 36 stored fields beside 39 methods. The bar is 30 stored fields; this is 6 over it, 1.20× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: StandaloneOptions src/standalone/src/options.rs:39— TooManyFields — 34 stored fields beside 3 methods. The bar is 30 stored fields; this is 4 over it, 1.13× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ScanInput src/mito2/src/read/scan_region.rs:912— TooManyFields — 33 stored fields beside 25 methods. The bar is 30 stored fields; this is 3 over it, 1.10× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
Duplicated block (15–16 lines × 2) src/common/function/src/scalars/string/insert.rs:56— src/common/function/src/scalars/string/insert.rs:56-70 | src/common/function/src/scalars/string/locate.rs:55-70 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15–16 lines × 2) src/common/meta/src/ddl/truncate_table.rs:199— src/common/meta/src/ddl/truncate_table.rs:199-214 | src/common/meta/src/ddl/utils.rs:406-420 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (15–16 lines × 2) src/frontend/src/instance/prom_store.rs:533— src/frontend/src/instance/prom_store.rs:533-548 | src/frontend/src/instance/prom_store.rs:776-790 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) src/mito2/src/read/seq_scan.rs:349— src/mito2/src/read/seq_scan.rs:349-363 | src/mito2/src/read/unordered_scan.rs:225-240 — before extracting anything, compare `src/mito2/src/read/seq_scan.rs` and `src/mito2/src/read/unordered_scan.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 54 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (15–16 lines × 2) src/servers/src/postgres/handler.rs:592— src/servers/src/postgres/handler.rs:592-607 | src/servers/src/postgres/handler.rs:610-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 (15–16 lines × 2) src/table/src/metadata.rs:911— src/table/src/metadata.rs:911-926 | src/table/src/metadata.rs:1008-1022 — both copies are in the same file, so extract the block into 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) src/catalog/src/system_schema/information_schema/flow_statistics.rs:183— src/catalog/src/system_schema/information_schema/flow_statistics.rs:183-196 | src/catalog/src/system_schema/information_schema/flows.rs:292-306 — before extracting anything, compare `src/catalog/src/system_schema/information_schema/flow_statistics.rs` and `src/catalog/src/system_schema/information_schema/flows.rs` as WHOLE FILES: this scan already matched 3 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 (14–15 lines × 2) src/metric-engine/src/engine.rs:557— src/metric-engine/src/engine.rs:557-570 | src/store-api/src/region_engine.rs:976-990 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14–15 lines × 2) src/mito2/src/cache/index/inverted_index.rs:110— src/mito2/src/cache/index/inverted_index.rs:110-124 | src/mito2/src/cache/index/inverted_index.rs:139-152 — both copies are in the same file, so extract the block into 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) src/query/src/part_sort.rs:1048— src/query/src/part_sort.rs:1048-1061 | src/query/src/part_sort.rs:1111-1125 — both copies are in the same file, so extract the block into 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) src/servers/src/otlp/trace/v0.rs:68— src/servers/src/otlp/trace/v0.rs:68-81 | src/servers/src/otlp/trace/v1.rs:317-331 — 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–15 lines × 2) src/sql/src/parsers/alter_parser/trigger.rs:305— src/sql/src/parsers/alter_parser/trigger.rs:305-319 | src/sql/src/parsers/create_parser/trigger.rs:383-396 — `src/sql/src/parsers/alter_parser/trigger.rs` and `src/sql/src/parsers/create_parser/trigger.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 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (11–12 lines × 2) src/cmd/src/datanode.rs:313— src/cmd/src/datanode.rs:313-323 | src/cmd/src/flownode.rs:201-212 — 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) src/common/meta/src/reconciliation/reconcile_logical_tables/reconcile_regions.rs:50— src/common/meta/src/reconciliation/reconcile_logical_tables/reconcile_regions.rs:50-61 | src/common/meta/src/reconciliation/reconcile_table/reconcile_regions.rs:92-102 — 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) src/frontend/src/instance/promql.rs:113— src/frontend/src/instance/promql.rs:113-124 | src/frontend/src/instance/promql.rs:330-340 — both copies are in the same file, so extract the block into 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) src/operator/src/statement/copy_table_from.rs:335— src/operator/src/statement/copy_table_from.rs:335-345 | src/operator/src/statement/copy_table_from.rs:362-373 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 2) src/query/src/sql.rs:968— src/query/src/sql.rs:968-979 | src/query/src/sql/show_create_table.rs:252-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 (11–12 lines × 2) src/servers/src/http/prometheus.rs:1829— src/servers/src/http/prometheus.rs:1829-1839 | src/servers/src/http/prometheus.rs:2396-2407 — both copies are in the same file, so extract the block into 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) src/datanode/src/service.rs:80— src/datanode/src/service.rs:80-89 | src/flow/src/server.rs:429-437 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (9–10 lines × 2) src/meta-srv/src/handler/collect_stats_handler.rs:187— src/meta-srv/src/handler/collect_stats_handler.rs:187-196 | src/meta-srv/src/handler/remap_flow_peer_handler.rs:74-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (9–10 lines × 2) src/mito2/src/worker.rs:1048— src/mito2/src/worker.rs:1048-1056 | src/mito2/src/worker.rs:1101-1110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–10 lines × 2) src/query/src/promql/planner.rs:1521— src/query/src/promql/planner.rs:1521-1529 | src/query/src/promql/planner.rs:6223-6232 — both copies are in the same file, so extract the block into 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) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:178— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:178-187 | tests-fuzz/targets/ddl/fuzz_alter_table.rs:249-257 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs` and `tests-fuzz/targets/ddl/fuzz_alter_table.rs` as WHOLE FILES: this scan already matched 5 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 × 2) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:81— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:81-89 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:79-88 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 205 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–8 lines × 2) src/cli/src/database.rs:113— src/cli/src/database.rs:113-119 | src/cli/src/database.rs:177-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 (7–8 lines × 2) src/common/procedure/src/error.rs:257— src/common/procedure/src/error.rs:257-264 | src/common/procedure/src/error.rs:301-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 (7–8 lines × 2) src/mito2/src/read/series_reader.rs:344— src/mito2/src/read/series_reader.rs:344-350 | src/mito2/src/read/series_scan.rs:763-770 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7–8 lines × 2) src/query/src/dist_plan/merge_scan.rs:1211— src/query/src/dist_plan/merge_scan.rs:1211-1218 | src/query/src/dist_plan/merge_scan.rs:1225-1231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–8 lines × 2) src/servers/src/mysql/handler.rs:883— src/servers/src/mysql/handler.rs:883-890 | src/servers/src/mysql/handler.rs:914-920 — both copies are in the same file, so extract the block into 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) src/common/meta/src/kv_backend/test.rs:511— src/common/meta/src/kv_backend/test.rs:511-517 | src/common/meta/src/kv_backend/test.rs:540-547 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
ParserContext::parse_show (cyclomatic 39) src/sql/src/parsers/show_parser.rs:38— ParserContext::parse_show has cyclomatic complexity 39 (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.
ParserContext::parse_statement (cyclomatic 30) src/sql/src/parser.rs:142— ParserContext::parse_statement has cyclomatic complexity 30 (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.
ParserContext::parse_alter_trigger (cyclomatic 25) src/sql/src/parsers/alter_parser/trigger.rs:65— ParserContext::parse_alter_trigger has cyclomatic complexity 25 (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.
ParserContext::parse_one_impl (cyclomatic 18) src/common/function/src/scalars/matches.rs:561— ParserContext::parse_one_impl 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.
ParserContext::parse_create_flow (cyclomatic 16) src/sql/src/parsers/create_parser.rs:301— ParserContext::parse_create_flow 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.
mito2::sst::parquet::prefilter::build_reader_filter_plan (cyclomatic 18) src/mito2/src/sst/parquet/prefilter.rs:406— mito2::sst::parquet::prefilter::build_reader_filter_plan 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.
mito2::series_index::maintenance::build_index_version (cyclomatic 18) src/mito2/src/series_index/maintenance.rs:160— mito2::series_index::maintenance::build_index_version 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.
mito2::region::opener::preload_parquet_meta_cache_for_files (cyclomatic 18) src/mito2/src/region/opener.rs:1200— mito2::region::opener::preload_parquet_meta_cache_for_files 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.
mito2::read::seq_scan::build_flat_sources (cyclomatic 16) src/mito2/src/read/seq_scan.rs:630— mito2::read::seq_scan::build_flat_sources 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.
mito2::sst::parquet::format::column_values_by_type (cyclomatic 16) src/mito2/src/sst/parquet/format.rs:150— mito2::sst::parquet::format::column_values_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.
HackComment src/common/error/src/lib.rs:24— // HACK - these headers are here for shared in gRPC services. For common HTTP headers, — 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 src/common/meta/src/kv_backend/txn.rs:132— // HACK - chroot would modify this field — 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 src/common/meta/src/kv_backend/chroot.rs:271— // one-sided range (HACK - b'/' + 1 = b'0') — 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 src/datanode/src/region_server.rs:1053— /// HACK(zhongzc): Direct MitoEngine handle for diagnostics. This couples the — 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 src/mito2/src/region.rs:615— // Hack(zhongzc): If we have just become leader (writable), persist any backfilled metadata. — 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.
partition::simplify::simplify_terms (cognitive 39) src/partition/src/simplify.rs:297— partition::simplify::simplify_terms has cognitive complexity 39 (threshold 15). Drivers by points: if/else 7 (22 pts), loops 7 (15 pts), boolean chains 2 (nesting depth added 23). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
partition::subtask::create_subtasks (cognitive 31) src/partition/src/subtask.rs:32— partition::subtask::create_subtasks has cognitive complexity 31 (threshold 15). Drivers by points: loops 6 (14 pts), if/else 4 (13 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
partition::utils::split::is_empty_and_conjunction (cognitive 23) src/partition/src/utils/split.rs:121— partition::utils::split::is_empty_and_conjunction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
partition::overlap::atomic_exprs_overlap (cognitive 23) src/partition/src/overlap.rs:31— partition::overlap::atomic_exprs_overlap has cognitive complexity 23 (threshold 15). Drivers by points: loops 5 (13 pts), boolean chains 5, if/else 1 (3 pts), match/switch 1 (2 pts) (nesting depth added 11). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
partition::utils::split::collect_conjunction_bounds (cognitive 16) src/partition/src/utils/split.rs:567— partition::utils::split::collect_conjunction_bounds has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (13–14 lines × 2) src/cmd/src/datanode/parquetbench.rs:741— src/cmd/src/datanode/parquetbench.rs:741-753 | src/cmd/src/datanode/parquetbench.rs:811-824 — both copies are in the same file, so extract the block into 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) src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:202— src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:202-214 | src/meta-srv/src/procedure/repartition/group/sync_region.rs:182-195 — before extracting anything, compare `src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs` and `src/meta-srv/src/procedure/repartition/group/sync_region.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–14 lines × 2) src/meta-srv/src/procedure/repartition.rs:763— src/meta-srv/src/procedure/repartition.rs:763-775 | src/meta-srv/src/procedure/repartition/group.rs:223-236 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (13–14 lines × 2) src/mito2/src/cache/index/bloom_filter_index.rs:132— src/mito2/src/cache/index/bloom_filter_index.rs:132-145 | src/mito2/src/cache/index/bloom_filter_index.rs:163-175 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–14 lines × 2) tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:343— tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:343-355 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:327-340 — before extracting anything, compare `tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs` and `tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/cmd/src/datanode.rs:309— src/cmd/src/datanode.rs:309-320 | src/cmd/src/metasrv.rs:233-244 | src/cmd/src/standalone.rs:376-387 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (12 lines × 3) src/common/time/src/duration.rs:203— src/common/time/src/duration.rs:203-214 | src/common/time/src/time.rs:191-202 | src/common/time/src/timestamp.rs:725-736 — 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 (12 lines × 3) src/promql/src/extension_plan/empty_metric.rs:203— src/promql/src/extension_plan/empty_metric.rs:203-214 | src/promql/src/extension_plan/range_manipulate.rs:270-281 | src/promql/src/extension_plan/scalar_calculate.rs:237-248 — before extracting anything, compare `src/promql/src/extension_plan/range_manipulate.rs` and `src/promql/src/extension_plan/scalar_calculate.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12 lines × 3) src/promql/src/extension_plan/normalize.rs:337— src/promql/src/extension_plan/normalize.rs:337-348 | src/promql/src/extension_plan/range_manipulate.rs:526-537 | src/promql/src/extension_plan/series_divide.rs:428-439 — before extracting anything, compare `src/promql/src/extension_plan/normalize.rs` and `src/promql/src/extension_plan/series_divide.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 (12 lines × 3) src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:340— src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:340-351 | src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:323-334 | src/meta-srv/src/procedure/repartition/group/remap_manifest.rs:191-203 — before extracting anything, compare `src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs` and `src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/common/meta/src/ddl_manager.rs:1230— src/common/meta/src/ddl_manager.rs:1230-1240 | src/common/meta/src/ddl_manager.rs:1463-1473 | src/common/meta/src/ddl_manager.rs:1564-1574 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/frontend/src/instance/otlp.rs:96— src/frontend/src/instance/otlp.rs:96-106 | src/frontend/src/instance/otlp.rs:265-275 | src/frontend/src/instance/otlp.rs:303-313 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/meta-client/src/client/procedure.rs:299— src/meta-client/src/client/procedure.rs:299-309 | src/meta-client/src/client/procedure.rs:412-422 | src/meta-client/src/client/procedure.rs:460-470 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/session/src/session_config.rs:119— src/session/src/session_config.rs:119-129 | src/session/src/session_config.rs:176-186 | src/session/src/session_config.rs:233-243 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:110— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:110-120 | tests-fuzz/targets/fuzz_insert_logical_table.rs:141-151 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:109-119 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/fuzz_insert_logical_table.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 93 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–9 lines × 2) src/common/function/src/scalars/hll_count.rs:81— src/common/function/src/scalars/hll_count.rs:81-89 | src/common/function/src/scalars/welford_stddev.rs:75-82 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8–9 lines × 2) src/common/function/src/admin/flush_compact_table.rs:172— src/common/function/src/admin/flush_compact_table.rs:172-180 | src/common/function/src/admin/reconcile_table.rs:64-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 (8–9 lines × 2) src/common/query/src/native_histogram/encoding.rs:101— src/common/query/src/native_histogram/encoding.rs:101-108 | src/common/query/src/native_histogram/encoding.rs:355-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 (8–9 lines × 2) src/operator/src/insert.rs:1239— src/operator/src/insert.rs:1239-1247 | src/operator/src/insert.rs:1290-1297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:191— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:191-198 | tests-fuzz/targets/fuzz_insert_logical_table.rs:237-245 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/fuzz_insert_logical_table.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 93 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) src/common/function/src/scalars/geo/geohash.rs:95— src/common/function/src/scalars/geo/geohash.rs:95-99 | src/common/function/src/scalars/geo/geohash.rs:196-200 | src/common/function/src/scalars/geo/h3.rs:103-107 | src/common/function/src/scalars/geo/h3.rs:194-198 — before extracting anything, compare `src/common/function/src/scalars/geo/geohash.rs` and `src/common/function/src/scalars/geo/h3.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) src/common/function/src/scalars/geo/geohash.rs:102— src/common/function/src/scalars/geo/geohash.rs:102-106 | src/common/function/src/scalars/geo/geohash.rs:203-207 | src/common/function/src/scalars/geo/h3.rs:110-114 | src/common/function/src/scalars/geo/h3.rs:201-205 — before extracting anything, compare `src/common/function/src/scalars/geo/geohash.rs` and `src/common/function/src/scalars/geo/h3.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 4) src/common/meta/src/key/flow/flow_info.rs:366— src/common/meta/src/key/flow/flow_info.rs:366-370 | src/common/meta/src/key/flow/flow_route.rs:162-166 | src/common/meta/src/key/flow/table_flow.rs:181-185 | src/common/meta/src/key/table_repart.rs:146-150 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (5 lines × 4) tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:207— tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:207-213 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:225-229 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:349-355 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:368-372 — before extracting anything, compare `tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs` and `tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs` as WHOLE FILES: this scan already matched 3 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. 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) tests-fuzz/targets/failover/fuzz_failover_mito_regions.rs:89— tests-fuzz/targets/failover/fuzz_failover_mito_regions.rs:89-93 | tests-fuzz/targets/fuzz_insert.rs:72-76 | tests-fuzz/targets/fuzz_insert_logical_table.rs:73-77 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:85-89 — before extracting anything, compare `tests-fuzz/targets/fuzz_insert.rs` and `tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
StatementExecutor::execute_sql (cyclomatic 57) src/operator/src/statement.rs:248— StatementExecutor::execute_sql has cyclomatic complexity 57 (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.
StatementExecutor::determine_flow_type (cyclomatic 19) src/operator/src/statement/ddl.rs:889— StatementExecutor::determine_flow_type 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.
StatementExecutor::set_variables (cyclomatic 19) src/operator/src/statement.rs:529— StatementExecutor::set_variables 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.
StatementExecutor::repartition_table (cyclomatic 16) src/operator/src/statement/ddl.rs:1692— StatementExecutor::repartition_table 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.
RegionWorkerLoop::handle_alter_region_options_fast (cyclomatic 19) src/mito2/src/worker/handle_alter.rs:218— RegionWorkerLoop::handle_alter_region_options_fast 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.
RegionWorkerLoop::handle_write_requests (cyclomatic 17) src/mito2/src/worker/handle_write.rs:43— RegionWorkerLoop::handle_write_requests 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.
RegionWorkerLoop::handle_alter_request (cyclomatic 16) src/mito2/src/worker/handle_alter.rs:48— RegionWorkerLoop::handle_alter_request 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.
RegionWorkerLoop::process_write_requests (cyclomatic 16) src/mito2/src/worker/handle_write.rs:304— RegionWorkerLoop::process_write_requests 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.
BatchingTask::apply_query_result_to_state (cognitive 44) src/flow/src/batching_mode/task/ckpt.rs:91— BatchingTask::apply_query_result_to_state has cognitive complexity 44 (threshold 15). Drivers by points: if/else 20 (42 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.
BatchingTask::start_scheduled_loop (cognitive 33) src/flow/src/batching_mode/task.rs:1620— BatchingTask::start_scheduled_loop has cognitive complexity 33 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 7 (15 pts), loops 2 (3 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatchingTask::execute_plan_unlocked (cognitive 25) src/flow/src/batching_mode/task.rs:1207— BatchingTask::execute_plan_unlocked has cognitive complexity 25 (threshold 15). Drivers by points: if/else 15 (18 pts), match/switch 3 (5 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.
BatchingTask::capture_recovery_windows_since (cognitive 16) src/flow/src/batching_mode/task.rs:730— BatchingTask::capture_recovery_windows_since has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10, loops 2 (4 pts), boolean chains 1, match/switch 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.
HistogramFoldStream::evaluate_fraction (cognitive 38) src/promql/src/extension_plan/histogram_fold.rs:1341— HistogramFoldStream::evaluate_fraction has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (26 pts), boolean chains 9, loops 2, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistogramFoldStream::evaluate_row (cognitive 30) src/promql/src/extension_plan/histogram_fold.rs:1245— HistogramFoldStream::evaluate_row has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (21 pts), boolean chains 4, loops 1 (3 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.
HistogramFoldStream::finalize_safe_group (cognitive 22) src/promql/src/extension_plan/histogram_fold.rs:1052— HistogramFoldStream::finalize_safe_group has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), loops 2 (4 pts), boolean chains 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistogramFoldStream::process_safe_mode_buffer (cognitive 19) src/promql/src/extension_plan/histogram_fold.rs:1119— HistogramFoldStream::process_safe_mode_buffer has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (16 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.
cmd::bin::query_regression_runner::measure::run_target (cognitive 26) src/cmd/src/bin/query_regression_runner/measure.rs:129— cmd::bin::query_regression_runner::measure::run_target has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (16 pts), loops 5 (9 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.
cmd::datanode::parquet_rewrite::build_writer_properties (cognitive 24) src/cmd/src/datanode/parquet_rewrite.rs:265— cmd::datanode::parquet_rewrite::build_writer_properties has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (21 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cmd::bin::query_regression_runner::sql::extract_rows::visit (cognitive 19) src/cmd/src/bin/query_regression_runner/sql.rs:27— cmd::bin::query_regression_runner::sql::extract_rows::visit has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (10 pts), loops 2 (5 pts), boolean chains 3, 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.
cmd::bin::query_regression_runner::remote::storage::enforce_storage_thresholds (cognitive 18) src/cmd/src/bin/query_regression_runner/remote/storage.rs:93— cmd::bin::query_regression_runner::remote::storage::enforce_storage_thresholds has cognitive complexity 18 (threshold 15). Drivers by points: loops 8 (12 pts), if/else 3 (6 pts) (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.
Duplicated block (21 lines × 2) REDACTED:734— REDACTED:734-754 | REDACTED:571-591 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (21 lines × 2) src/common/meta/src/key/table_repart.rs:285— src/common/meta/src/key/table_repart.rs:285-305 | src/common/meta/src/key/table_route.rs:749-769 — before extracting anything, compare `src/common/meta/src/key/table_repart.rs` and `src/common/meta/src/key/table_route.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 (21 lines × 2) src/mito2/src/read/scan_util.rs:825— src/mito2/src/read/scan_util.rs:825-845 | src/mito2/src/sst/parquet/reader.rs:1562-1582 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (21 lines × 2) src/query/src/promql/planner.rs:1051— src/query/src/promql/planner.rs:1051-1071 | src/query/src/promql/planner.rs:1118-1138 — both copies are in the same file, so extract the block into 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 × 3) src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:294— src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:294-307 | src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:278-291 | src/meta-srv/src/procedure/repartition/group/remap_manifest.rs:159-172 — before extracting anything, compare `src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs` and `src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/promql/src/functions/native_histogram.rs:1217— src/promql/src/functions/native_histogram.rs:1217-1230 | src/promql/src/functions/native_histogram.rs:2506-2519 | src/promql/src/functions/native_histogram.rs:2771-2784 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/sql/src/parsers/alter_parser/trigger.rs:321— src/sql/src/parsers/alter_parser/trigger.rs:321-334 | src/sql/src/parsers/alter_parser/trigger.rs:366-379 | src/sql/src/parsers/alter_parser/trigger.rs:411-424 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/common/meta/src/kv_backend/test.rs:603— src/common/meta/src/kv_backend/test.rs:603-616 | src/common/meta/src/kv_backend/test.rs:643-656 | src/common/meta/src/kv_backend/test.rs:683-696 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/catalog/src/system_schema/information_schema/columns.rs:258— src/catalog/src/system_schema/information_schema/columns.rs:258-268 | src/catalog/src/system_schema/information_schema/key_column_usage.rs:231-241 | src/catalog/src/system_schema/information_schema/statistics.rs:230-240 | src/catalog/src/system_schema/information_schema/table_constraints.rs:173-183 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (11 lines × 4) src/servers/src/grpc/flight/stream.rs:252— src/servers/src/grpc/flight/stream.rs:252-262 | src/servers/src/grpc/flight/stream.rs:322-332 | src/servers/src/grpc/flight/stream.rs:340-350 | src/servers/src/grpc/flight/stream.rs:591-601 — 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) src/common/meta/src/region_registry.rs:80— src/common/meta/src/region_registry.rs:80-90 | src/common/meta/src/region_registry.rs:93-103 | src/store-api/src/region_engine.rs:649-659 | src/store-api/src/region_engine.rs:662-672 — there are 4 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (11 lines × 4) src/meta-client/src/client/config.rs:128— src/meta-client/src/client/config.rs:128-138 | src/meta-client/src/client/heartbeat.rs:278-288 | src/meta-client/src/client/procedure.rs:185-195 | src/meta-client/src/client/store.rs:271-281 — 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 (10–11 lines × 2) src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:190— src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:190-199 | src/meta-srv/src/procedure/repartition/group/sync_region.rs:170-180 — before extracting anything, compare `src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs` and `src/meta-srv/src/procedure/repartition/group/sync_region.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/promql/src/functions/native_histogram.rs:1143— src/promql/src/functions/native_histogram.rs:1143-1152 | src/promql/src/functions/native_histogram.rs:2780-2790 — both copies are in the same file, so extract the block into 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) src/puffin/src/puffin_manager/stager/bounded_stager.rs:151— src/puffin/src/puffin_manager/stager/bounded_stager.rs:151-160 | src/puffin/src/puffin_manager/stager/bounded_stager.rs:207-217 — both copies are in the same file, so extract the block into 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) src/servers/src/grpc/flight/stream.rs:229— src/servers/src/grpc/flight/stream.rs:229-238 | src/servers/src/grpc/flight/stream.rs:613-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 lines × 4) src/common/function/src/scalars/vector/vector_add.rs:67— src/common/function/src/scalars/vector/vector_add.rs:67-74 | src/common/function/src/scalars/vector/vector_div.rs:68-75 | src/common/function/src/scalars/vector/vector_mul.rs:67-74 | src/common/function/src/scalars/vector/vector_sub.rs:66-73 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 4 call sites, so a change lands once.
Duplicated block (8 lines × 4) src/common/meta/src/reconciliation/reconcile_catalog.rs:152— src/common/meta/src/reconciliation/reconcile_catalog.rs:152-159 | src/common/meta/src/reconciliation/reconcile_database.rs:192-199 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:180-187 | src/common/meta/src/reconciliation/reconcile_table.rs:279-286 — before extracting anything, compare `src/common/meta/src/reconciliation/reconcile_catalog.rs` and `src/common/meta/src/reconciliation/reconcile_database.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:287— src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:287-294 | src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:271-278 | src/meta-srv/src/procedure/repartition/group/remap_manifest.rs:152-159 | src/meta-srv/src/procedure/repartition/group/sync_region.rs:241-248 — before extracting anything, compare `src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs` and `src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 4) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:283— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:283-294 | tests-fuzz/targets/fuzz_insert_logical_table.rs:284-295 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:417-428 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:367-374 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/fuzz_insert_logical_table.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 93 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.
operator::req_convert::common::push_column_to_rows (cyclomatic 94) src/operator/src/req_convert/common.rs:202— operator::req_convert::common::push_column_to_rows has cyclomatic complexity 94 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
operator::expr_helper::to_alter_table_expr (cyclomatic 24) src/operator/src/expr_helper.rs:811— operator::expr_helper::to_alter_table_expr 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.
operator::statement::semantic_graph::conventions::validate (cyclomatic 22) src/operator/src/statement/semantic_graph/conventions.rs:173— operator::statement::semantic_graph::conventions::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.
promql::functions::native_histogram::native_extrapolated_rate (cyclomatic 31) src/promql/src/functions/native_histogram.rs:2467— promql::functions::native_histogram::native_extrapolated_rate 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.
promql::functions::native_histogram::select_mixed_range_lanes (cyclomatic 20) src/promql/src/functions/native_histogram.rs:1937— promql::functions::native_histogram::select_mixed_range_lanes has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: MixedRangeFunction::parse (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
promql::functions::native_histogram::native_histogram_range_float (cyclomatic 16) src/promql/src/functions/native_histogram.rs:1191— promql::functions::native_histogram::native_histogram_range_float has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: MixedRangeFunction::parse (cyclomatic 26) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
NativeHistogram::fraction_with_info (cyclomatic 30) src/common/query/src/native_histogram.rs:740— NativeHistogram::fraction_with_info 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.
NativeHistogram::quantile_with_info (cyclomatic 27) src/common/query/src/native_histogram.rs:654— NativeHistogram::quantile_with_info 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.
NativeHistogram::detect_reset (cyclomatic 16) src/common/query/src/native_histogram.rs:521— NativeHistogram::detect_reset 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.
pipeline::etl::transform::transformer::greptime::coerce::coerce_u64_value (cyclomatic 29) src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:344— pipeline::etl::transform::transformer::greptime::coerce::coerce_u64_value has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
pipeline::etl::transform::transformer::greptime::coerce::coerce_i64_value (cyclomatic 25) src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:287— pipeline::etl::transform::transformer::greptime::coerce::coerce_i64_value has cyclomatic complexity 25 (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.
pipeline::etl::transform::transformer::greptime::coerce::coerce_bool_value (cyclomatic 19) src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:211— pipeline::etl::transform::transformer::greptime::coerce::coerce_bool_value 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.
StartCommand::merge_with_cli_options (cyclomatic 19) src/cmd/src/datanode.rs:302— StartCommand::merge_with_cli_options has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StartCommand::merge_with_cli_options (cyclomatic 18) src/cmd/src/frontend.rs:257— StartCommand::merge_with_cli_options 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.
StartCommand::merge_with_cli_options (cyclomatic 17) src/cmd/src/metasrv.rs:226— StartCommand::merge_with_cli_options has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
BatchingTask::start_scheduled_loop (cyclomatic 18) src/flow/src/batching_mode/task.rs:1620— BatchingTask::start_scheduled_loop 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.
BatchingTask::apply_query_result_to_state (cyclomatic 17) src/flow/src/batching_mode/task/ckpt.rs:91— BatchingTask::apply_query_result_to_state has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BatchingTask::execute_plan_unlocked (cyclomatic 16) src/flow/src/batching_mode/task.rs:1207— BatchingTask::execute_plan_unlocked 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.
Inserter::create_or_alter_tables_on_demand (cognitive 96) src/operator/src/insert.rs:1041— Inserter::create_or_alter_tables_on_demand has cognitive complexity 96 (threshold 15). Drivers by points: if/else 25 (62 pts), loops 9 (19 pts), boolean chains 9, match/switch 3 (6 pts) (nesting depth added 50). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Inserter::get_alter_table_expr_on_demand (cognitive 40) src/operator/src/insert.rs:1522— Inserter::get_alter_table_expr_on_demand has cognitive complexity 40 (threshold 15). Drivers by points: if/else 13 (28 pts), boolean chains 5, match/switch 1 (4 pts), loops 1 (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.
Inserter::handle_bulk_insert (cognitive 25) src/operator/src/bulk_insert.rs:126— Inserter::handle_bulk_insert has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (19 pts), loops 5 (6 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.
NativeHistogram::quantile_with_info (cognitive 41) src/common/query/src/native_histogram.rs:654— NativeHistogram::quantile_with_info has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (32 pts), boolean chains 8, 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.
NativeHistogram::fraction_with_info (cognitive 39) src/common/query/src/native_histogram.rs:740— NativeHistogram::fraction_with_info has cognitive complexity 39 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 13, 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.
NativeHistogram::detect_reset (cognitive 21) src/common/query/src/native_histogram.rs:521— NativeHistogram::detect_reset has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), boolean chains 4, match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatchGcProcedure::get_file_references (cognitive 38) src/meta-srv/src/gc/procedure.rs:648— BatchGcProcedure::get_file_references has cognitive complexity 38 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 9 (15 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatchGcProcedure::send_gc_instructions (cognitive 20) src/meta-srv/src/gc/procedure.rs:824— BatchGcProcedure::send_gc_instructions has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (13 pts), match/switch 2 (4 pts), loops 3 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatchGcProcedure::cleanup_region_repartition (cognitive 16) src/meta-srv/src/gc/procedure.rs:465— BatchGcProcedure::cleanup_region_repartition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatchingEngine::handle_mark_dirty_time_window (cognitive 34) src/flow/src/batching_mode/engine.rs:185— BatchingEngine::handle_mark_dirty_time_window has cognitive complexity 34 (threshold 15). Drivers by points: if/else 6 (17 pts), loops 8 (17 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.
BatchingEngine::handle_inserts_inner (cognitive 22) src/flow/src/batching_mode/engine.rs:322— BatchingEngine::handle_inserts_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 4 (5 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.
BatchingEngine::create_flow_inner (cognitive 16) src/flow/src/batching_mode/engine.rs:558— BatchingEngine::create_flow_inner has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11, match/switch 3, boolean chains 1, loops 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StatementExecutor::copy_table_from (cognitive 27) src/operator/src/statement/copy_table_from.rs:477— StatementExecutor::copy_table_from has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatementExecutor::determine_flow_type (cognitive 24) src/operator/src/statement/ddl.rs:889— StatementExecutor::determine_flow_type has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (20 pts), match/switch 2, boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StatementExecutor::repartition_table (cognitive 20) src/operator/src/statement/ddl.rs:1692— StatementExecutor::repartition_table has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 5 (7 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StartCommand::merge_with_cli_options (cognitive 21) src/cmd/src/frontend.rs:257— StartCommand::merge_with_cli_options has cognitive complexity 21 (threshold 15). Drivers by points: if/else 19 (21 pts) (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.
StartCommand::merge_with_cli_options (cognitive 19) src/cmd/src/datanode.rs:302— StartCommand::merge_with_cli_options has cognitive complexity 19 (threshold 15). Drivers by points: if/else 17 (18 pts), boolean chains 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.
StartCommand::merge_with_cli_options (cognitive 16) src/cmd/src/metasrv.rs:226— StartCommand::merge_with_cli_options has cognitive complexity 16 (threshold 15). Drivers by points: if/else 16. 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.
RegionServerInner::get_engine (cognitive 21) src/datanode/src/region_server.rs:1207— RegionServerInner::get_engine has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 9 (21 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RegionServerInner::handle_batch_open_requests_inner (cognitive 21) src/datanode/src/region_server.rs:1282— RegionServerInner::handle_batch_open_requests_inner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegionServerInner::handle_read (cognitive 17) src/datanode/src/region_server.rs:1842— RegionServerInner::handle_read has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (4 pts), match/switch 1 (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.
common_meta::ddl::alter_database::build_new_schema_value (cognitive 20) src/common/meta/src/ddl/alter_database.rs:51— common_meta::ddl::alter_database::build_new_schema_value has cognitive complexity 20 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 3 (7 pts), loops 2 (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.
common_meta::kv_backend::util::skip_value (cognitive 16) src/common/meta/src/kv_backend/util.rs:175— common_meta::kv_backend::util::skip_value has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
common_meta::ddl::utils::handle_multiple_results (cognitive 16) src/common/meta/src/ddl/utils.rs:246— common_meta::ddl::utils::handle_multiple_results has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (4 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
pipeline::etl::transform::transformer::greptime::coerce::coerce_u64_value (cognitive 19) src/pipeline/src/etl/transform/transformer/greptime/coerce.rs:344— pipeline::etl::transform::transformer::greptime::coerce::coerce_u64_value has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 12 (19 pts) (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
pipeline::etl::parse (cognitive 19) src/pipeline/src/etl.rs:62— pipeline::etl::parse has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2 (4 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.
pipeline::etl::transform::transformer::greptime::values_to_rows (cognitive 16) src/pipeline/src/etl/transform/transformer/greptime.rs:574— pipeline::etl::transform::transformer::greptime::values_to_rows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 2 (4 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (30 lines × 2) src/common/meta/src/key/flow.rs:237— src/common/meta/src/key/flow.rs:237-266 | src/common/meta/src/key/flow.rs:333-362 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (30 lines × 2) src/table/src/metadata.rs:578— src/table/src/metadata.rs:578-607 | src/table/src/metadata.rs:638-667 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (30 lines × 2) tests-fuzz/targets/fuzz_insert.rs:166— tests-fuzz/targets/fuzz_insert.rs:166-195 | tests-fuzz/targets/fuzz_insert_logical_table.rs:160-189 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (22 lines × 2) src/cmd/src/bin/query_regression_runner/otlp.rs:330— src/cmd/src/bin/query_regression_runner/otlp.rs:330-351 | src/cmd/src/bin/query_regression_runner/remote/ingest.rs:427-448 — 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 (22 lines × 2) src/cmd/src/flownode.rs:187— src/cmd/src/flownode.rs:187-208 | src/cmd/src/frontend.rs:262-283 — before extracting anything, compare `src/cmd/src/flownode.rs` and `src/cmd/src/frontend.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 50 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (22 lines × 2) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:165— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:165-186 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:164-185 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 205 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) src/pipeline/src/etl/processor/json_path.rs:136— src/pipeline/src/etl/processor/json_path.rs:136-155 | src/pipeline/src/etl/processor/simple_extract.rs:107-126 — before extracting anything, compare `src/pipeline/src/etl/processor/json_path.rs` and `src/pipeline/src/etl/processor/simple_extract.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 2) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:215— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:215-234 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:164-183 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs` and `tests-fuzz/targets/ddl/fuzz_create_logical_table.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) tests-integration/src/test_util.rs:1101— tests-integration/src/test_util.rs:1101-1120 | tests-integration/src/test_util.rs:1151-1170 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 2) src/common/meta/src/key.rs:957— src/common/meta/src/key.rs:957-970 | src/common/meta/src/key.rs:1673-1684 — both copies are in the same file, so extract the block into 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) src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:82— src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:82-93 | src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:83-96 — before extracting anything, compare `src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs` and `src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–14 lines × 2) src/pipeline/src/etl/processor/simple_extract.rs:51— src/pipeline/src/etl/processor/simple_extract.rs:51-62 | src/pipeline/src/etl/processor/urlencoding.rs:90-103 — 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–13 lines × 2) src/frontend/src/instance/otlp/trace_ingest.rs:1325— src/frontend/src/instance/otlp/trace_ingest.rs:1325-1337 | src/frontend/src/instance/otlp/trace_ingest.rs:1408-1418 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 2) src/query/src/dist_plan/analyzer.rs:1014— src/query/src/dist_plan/analyzer.rs:1014-1024 | src/query/src/dist_plan/analyzer.rs:1034-1046 — both copies are in the same file, so extract the block into 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) src/query/src/sql.rs:729— src/query/src/sql.rs:729-741 | src/query/src/sql.rs:1067-1077 — both copies are in the same file, so extract the block into 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) src/catalog/src/system_schema/information_schema/region_peers.rs:181— src/catalog/src/system_schema/information_schema/region_peers.rs:181-192 | src/catalog/src/system_schema/information_schema/tables.rs:248-257 — 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–12 lines × 2) src/query/src/part_sort.rs:1134— src/query/src/part_sort.rs:1134-1143 | src/query/src/part_sort.rs:1152-1163 — both copies are in the same file, so extract the block into 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) src/sql/src/statements/alter.rs:284— src/sql/src/statements/alter.rs:284-295 | src/sql/src/statements/alter.rs:422-431 — both copies are in the same file, so extract the block into 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 × 3) src/common/function/src/scalars/geo/h3.rs:889— src/common/function/src/scalars/geo/h3.rs:889-895 | src/common/function/src/scalars/geo/h3.rs:948-954 | src/common/function/src/scalars/geo/h3.rs:1071-1079 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–9 lines × 3) src/common/function/src/scalars/ip/range.rs:74— src/common/function/src/scalars/ip/range.rs:74-82 | src/common/function/src/scalars/ip/range.rs:162-168 | src/common/function/src/scalars/json/json_path_match.rs:66-73 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7–9 lines × 3) src/common/function/src/admin/build_index_table.rs:95— src/common/function/src/admin/build_index_table.rs:95-101 | src/common/function/src/admin/flush_compact_table.rs:68-74 | src/common/function/src/admin/purge_table.rs:54-62 — before extracting anything, compare `src/common/function/src/admin/flush_compact_table.rs` and `src/common/function/src/admin/purge_table.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 × 4) src/common/meta/src/reconciliation/reconcile_catalog.rs:56— src/common/meta/src/reconciliation/reconcile_catalog.rs:56-64 | src/common/meta/src/reconciliation/reconcile_database.rs:63-71 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:61-69 | src/common/meta/src/reconciliation/reconcile_table.rs:162-170 — before extracting anything, compare `src/common/meta/src/reconciliation/reconcile_catalog.rs` and `src/common/meta/src/reconciliation/reconcile_database.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:165— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:165-174 | tests-fuzz/targets/fuzz_insert.rs:140-149 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:164-173 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:286-294 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 4) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:227— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:227-238 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:176-188 | tests-fuzz/targets/ddl/fuzz_create_table.rs:113-121 | tests-fuzz/targets/fuzz_insert.rs:205-216 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs` and `tests-fuzz/targets/ddl/fuzz_create_logical_table.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
frontend::instance::check_permission (cyclomatic 48) src/frontend/src/instance.rs:1596— frontend::instance::check_permission has cyclomatic complexity 48 (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.
frontend::instance::grpc::fill_catalog_and_schema_from_context (cyclomatic 28) src/frontend/src/instance/grpc.rs:308— frontend::instance::grpc::fill_catalog_and_schema_from_context 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.
Inserter::create_or_alter_tables_on_demand (cyclomatic 46) src/operator/src/insert.rs:1041— Inserter::create_or_alter_tables_on_demand has cyclomatic complexity 46 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Inserter::get_alter_table_expr_on_demand (cyclomatic 21) src/operator/src/insert.rs:1522— Inserter::get_alter_table_expr_on_demand 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.
ConcreteDataType::from (cyclomatic 41) src/api/src/helper.rs:113— ConcreteDataType::from 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.
ConcreteDataType::fmt (cyclomatic 36) src/datatypes/src/data_type.rs:93— ConcreteDataType::fmt has cyclomatic complexity 36 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
HistogramFoldStream::evaluate_fraction (cyclomatic 27) src/promql/src/extension_plan/histogram_fold.rs:1341— HistogramFoldStream::evaluate_fraction 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.
HistogramFoldStream::evaluate_row (cyclomatic 19) src/promql/src/extension_plan/histogram_fold.rs:1245— HistogramFoldStream::evaluate_row has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Predicate::eval (cyclomatic 24) src/catalog/src/system_schema/predicate.rs:43— Predicate::eval 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.
Predicate::from_expr (cyclomatic 20) src/catalog/src/system_schema/predicate.rs:120— Predicate::from_expr 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.
common_function::scalars::math::clamp::clamp_impl (cyclomatic 23) src/common/function/src/scalars/math/clamp.rs:75— common_function::scalars::math::clamp::clamp_impl 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.
common_function::admin::flush_compact_table::parse_compact_options (cyclomatic 16) src/common/function/src/admin/flush_compact_table.rs:194— common_function::admin::flush_compact_table::parse_compact_options 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.
query::promql::planner::matching_filters::try_propagate (cyclomatic 22) src/query/src/promql/planner/matching_filters.rs:96— query::promql::planner::matching_filters::try_propagate has cyclomatic complexity 22 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions.
query::range_select::plan_rewrite::evaluate_expr_to_millisecond (cyclomatic 16) src/query/src/range_select/plan_rewrite.rs:157— query::range_select::plan_rewrite::evaluate_expr_to_millisecond 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.
cli::data::import_v2::packed::validate_snapshot (cyclomatic 21) src/cli/src/data/import_v2/packed.rs:29— cli::data::import_v2::packed::validate_snapshot 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.
cli::data::import_v2::command::parse_ddl_statements (cyclomatic 20) src/cli/src/data/import_v2/command.rs:405— cli::data::import_v2::command::parse_ddl_statements 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.
Instance::ingest_trace_spans (cyclomatic 21) src/frontend/src/instance/otlp/trace_ingest.rs:871— Instance::ingest_trace_spans 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.
Instance::reconcile_trace_column_types (cyclomatic 19) src/frontend/src/instance/otlp/trace_ingest.rs:1943— Instance::reconcile_trace_column_types 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.
common_sql::convert::sql_value_to_value (cyclomatic 17) src/common/sql/src/convert.rs:127— common_sql::convert::sql_value_to_value has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
common_sql::convert::parse_string_to_value (cyclomatic 16) src/common/sql/src/convert.rs:244— common_sql::convert::parse_string_to_value 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.
MergeScanExec::to_stream (cognitive 57) src/query/src/dist_plan/merge_scan.rs:620— MergeScanExec::to_stream has cognitive complexity 57 (threshold 15). Drivers by points: if/else 22 (49 pts), match/switch 1 (4 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MergeScanExec::fmt_as (cognitive 20) src/query/src/dist_plan/merge_scan.rs:1287— MergeScanExec::fmt_as has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (8 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.
BoundedStager::delete_routine (cognitive 41) src/puffin/src/puffin_manager/stager/bounded_stager.rs:475— BoundedStager::delete_routine has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (35 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BoundedStager::recover (cognitive 18) src/puffin/src/puffin_manager/stager/bounded_stager.rs:372— BoundedStager::recover has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 1 (3 pts), loops 2, 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.
RangeSelectStream::generate_output (cognitive 36) src/query/src/range_select/plan.rs:1095— RangeSelectStream::generate_output has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (21 pts), loops 7 (15 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RangeSelectStream::poll_next (cognitive 17) src/query/src/range_select/plan.rs:1242— RangeSelectStream::poll_next has cognitive complexity 17 (threshold 15). Drivers by points: if/else 2 (8 pts), match/switch 3 (8 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
common_recordbatch::adapter::convert_map_to_json_binary (cognitive 35) src/common/recordbatch/src/adapter.rs:831— common_recordbatch::adapter::convert_map_to_json_binary has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (16 pts), match/switch 4 (15 pts), loops 2 (4 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.
common_recordbatch::map_json_type_to_string (cognitive 17) src/common/recordbatch/src/lib.rs:102— common_recordbatch::map_json_type_to_string has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (5 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PartitionChecker::remap_checkpoint (cognitive 35) REDACTED:148— PartitionChecker::remap_checkpoint has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (32 pts), boolean chains 2, 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.
PartitionChecker::run (cognitive 29) REDACTED:48— PartitionChecker::run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 8 (14 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.
Predicate::eval (cognitive 34) src/catalog/src/system_schema/predicate.rs:43— Predicate::eval has cognitive complexity 34 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 4 (8 pts), match/switch 3 (5 pts), boolean chains 2 (nesting depth added 18). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Predicate::from_expr (cognitive 34) src/catalog/src/system_schema/predicate.rs:120— Predicate::from_expr has cognitive complexity 34 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 3 (5 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 19). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SeriesDivideStream::poll_next (cognitive 32) src/promql/src/extension_plan/series_divide.rs:585— SeriesDivideStream::poll_next has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (25 pts), match/switch 2 (6 pts), loops 1 (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.
SeriesDivideStream::find_first_diff_row (cognitive 17) src/promql/src/extension_plan/series_divide.rs:668— SeriesDivideStream::find_first_diff_row has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
common_telemetry::metric::convert_metric_to_write_request (cognitive 30) src/common/telemetry/src/metric.rs:48— common_telemetry::metric::convert_metric_to_write_request has cognitive complexity 30 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 4 (11 pts), match/switch 1 (3 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.
common_telemetry::logging::init_global_logging (cognitive 21) src/common/telemetry/src/logging.rs:450— common_telemetry::logging::init_global_logging has cognitive complexity 21 (threshold 15). Drivers by points: if/else 17 (20 pts), boolean chains 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
datatypes::vectors::json::builder::count_dynamic_paths (cognitive 30) src/datatypes/src/vectors/json/builder.rs:492— datatypes::vectors::json::builder::count_dynamic_paths has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, match/switch 1 (4 pts), loops 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.
datatypes::json::coerce_json_value_to_type (cognitive 17) src/datatypes/src/json.rs:484— datatypes::json::coerce_json_value_to_type has cognitive complexity 17 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 2 (3 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Pattern::from_str (cognitive 30) src/pipeline/src/etl/processor/dissect.rs:206— Pattern::from_str has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (23 pts), loops 2 (4 pts), match/switch 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pattern::check (cognitive 21) src/pipeline/src/etl/processor/dissect.rs:328— Pattern::check has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), match/switch 2 (5 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.
InvertedIndexer::do_update_flat (cognitive 28) src/mito2/src/sst/index/inverted_index/creator.rs:177— InvertedIndexer::do_update_flat has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (18 pts), loops 4 (9 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.
InvertedIndexer::do_update (cognitive 27) src/mito2/src/sst/index/inverted_index/creator.rs:290— InvertedIndexer::do_update has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExportCreate::run (cognitive 27) src/cli/src/data/export_v2/command.rs:517— ExportCreate::run has cognitive complexity 27 (threshold 15). Drivers by points: if/else 11 (23 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
ExportCreate::get_schema_objects (cognitive 17) src/cli/src/data/export_v2/command.rs:703— ExportCreate::get_schema_objects has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 2 (6 pts), loops 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.
HeartbeatTask::start (cognitive 27) src/datanode/src/heartbeat.rs:215— HeartbeatTask::start has cognitive complexity 27 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 3 (10 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.
HeartbeatTask::create_streams (cognitive 17) src/datanode/src/heartbeat.rs:123— HeartbeatTask::create_streams has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 2 (4 pts), match/switch 1 (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.
TableMeta::set_table_options (cognitive 26) src/table/src/metadata.rs:357— TableMeta::set_table_options has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (23 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TableMeta::add_columns (cognitive 19) src/table/src/metadata.rs:772— TableMeta::add_columns has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (15 pts), loops 3, 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.
RangePlanRewriter::get_index_by (cognitive 25) src/query/src/range_select/plan_rewrite.rs:559— RangePlanRewriter::get_index_by has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (18 pts), boolean chains 3, match/switch 1 (3 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.
RangePlanRewriter::rewrite_logical_plan (cognitive 22) src/query/src/range_select/plan_rewrite.rs:410— RangePlanRewriter::rewrite_logical_plan has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PostgresServerHandlerInner::authenticate_password_message (cognitive 25) src/servers/src/postgres/auth_handler.rs:363— PostgresServerHandlerInner::authenticate_password_message has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (22 pts), match/switch 2 (3 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.
PostgresServerHandlerInner::on_startup (cognitive 22) src/servers/src/postgres/auth_handler.rs:229— PostgresServerHandlerInner::on_startup has cognitive complexity 22 (threshold 15). Drivers by points: match/switch 6 (14 pts), if/else 4 (7 pts), boolean chains 1 (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.
RepairPartitionColumnTool::do_work (cognitive 23) src/cli/src/metadata/repair/partition_column.rs:194— RepairPartitionColumnTool::do_work has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (20 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RepairPartitionColumnTool::do_repair (cognitive 20) src/cli/src/metadata/repair/partition_column.rs:68— RepairPartitionColumnTool::do_repair has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts), match/switch 1 (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.
PlanRewriter::should_expand (cognitive 23) src/query/src/dist_plan/analyzer.rs:478— PlanRewriter::should_expand has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (17 pts), boolean chains 3, match/switch 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PlanRewriter::maybe_set_partitions (cognitive 18) src/query/src/dist_plan/analyzer.rs:647— PlanRewriter::maybe_set_partitions has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MysqlInstanceShim::authenticate_with_database (cognitive 23) src/servers/src/mysql/handler.rs:425— MysqlInstanceShim::authenticate_with_database has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 2 (5 pts) (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
MysqlInstanceShim::on_query (cognitive 16) src/servers/src/mysql/handler.rs:581— MysqlInstanceShim::on_query has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (12 pts), if/else 4 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
flow::batching_mode::time_window::find_time_window_expr (cognitive 22) src/flow/src/batching_mode/time_window.rs:431— flow::batching_mode::time_window::find_time_window_expr has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 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.
flow::batching_mode::table_creator::create_table_with_expr (cognitive 22) src/flow/src/batching_mode/table_creator.rs:39— flow::batching_mode::table_creator::create_table_with_expr has cognitive complexity 22 (threshold 15). Drivers by points: if/else 12 (17 pts), match/switch 2 (3 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanRegion::build_read_col_ids (cognitive 21) src/mito2/src/read/scan_region.rs:635— ScanRegion::build_read_col_ids has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanRegion::scan_input (cognitive 16) src/mito2/src/read/scan_region.rs:472— ScanRegion::scan_input has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), boolean chains 2, loops 1 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
TombstoneManager::move_values_inner (cognitive 20) src/common/meta/src/key/tombstone.rs:210— TombstoneManager::move_values_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (16 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.
TombstoneManager::move_values_with_extra (cognitive 20) src/common/meta/src/key/tombstone.rs:323— TombstoneManager::move_values_with_extra has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 3, loops 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimpleFilterEvaluator::cast_timestamp_unit (cognitive 18) src/common/recordbatch/src/filter.rs:357— SimpleFilterEvaluator::cast_timestamp_unit has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 1 (2 pts), match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SimpleFilterEvaluator::try_new (cognitive 17) src/common/recordbatch/src/filter.rs:97— SimpleFilterEvaluator::try_new has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ColumnMatcherRewriter::modify_project_exprs (cognitive 17) src/flow/src/batching_mode/utils.rs:1395— ColumnMatcherRewriter::modify_project_exprs has cognitive complexity 17 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
ColumnMatcherRewriter::modify_project_exprs_with_partial (cognitive 16) src/flow/src/batching_mode/utils.rs:1578— ColumnMatcherRewriter::modify_project_exprs_with_partial has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 2, loops 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Inner::with_retry (cognitive 17) src/meta-client/src/client/cluster.rs:168— Inner::with_retry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Inner::with_retry (cognitive 17) src/meta-client/src/client/procedure.rs:202— Inner::with_retry has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (28 lines × 2) src/operator/src/expr_helper.rs:325— src/operator/src/expr_helper.rs:325-352 | src/query/src/sql/show_create_table.rs:118-145 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (28 lines × 2) src/operator/src/req_convert/common.rs:375— src/operator/src/req_convert/common.rs:375-402 | src/operator/src/req_convert/insert.rs:38-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (25 lines × 2) src/common/function/src/aggrs/geo/encoding.rs:221— src/common/function/src/aggrs/geo/encoding.rs:221-245 | src/common/function/src/aggrs/geo/geo_path.rs:250-274 — before extracting anything, compare `src/common/function/src/aggrs/geo/encoding.rs` and `src/common/function/src/aggrs/geo/geo_path.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/flow/src/adapter.rs:579— src/flow/src/adapter.rs:579-603 | src/flow/src/adapter.rs:608-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) src/cmd/src/datanode/objbench.rs:219— src/cmd/src/datanode/objbench.rs:219-242 | src/cmd/src/datanode/parquetbench.rs:311-334 — 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) src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:352— src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:352-375 | src/meta-srv/src/procedure/repartition/group/sync_region.rs:311-334 — before extracting anything, compare `src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs` and `src/meta-srv/src/procedure/repartition/group/sync_region.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 135 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–20 lines × 2) src/common/function/src/scalars/anomaly/mad.rs:101— src/common/function/src/scalars/anomaly/mad.rs:101-120 | src/common/function/src/scalars/anomaly/zscore.rs:93-111 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (19–20 lines × 2) src/partition/src/utils/split.rs:274— src/partition/src/utils/split.rs:274-293 | src/partition/src/utils/split.rs:314-332 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–19 lines × 2) src/mito2/src/flush.rs:1023— src/mito2/src/flush.rs:1023-1041 | src/mito2/src/flush.rs:1066-1081 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–19 lines × 2) src/servers/src/otlp/metrics.rs:1495— src/servers/src/otlp/metrics.rs:1495-1513 | src/servers/src/otlp/metrics.rs:1521-1536 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 2) REDACTED:706— REDACTED:706-722 | REDACTED:539-556 — before extracting anything, compare `REDACTED` and `REDACTED` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 64 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (17–18 lines × 2) src/servers/src/otlp/trace/v1.rs:65— src/servers/src/otlp/trace/v1.rs:65-82 | src/servers/src/otlp/trace/v2.rs:61-77 — 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 × 3) src/mito2/src/sst/index/bloom_filter/applier.rs:70— src/mito2/src/sst/index/bloom_filter/applier.rs:70-86 | src/mito2/src/sst/index/fulltext_index/applier.rs:79-95 | src/mito2/src/sst/index/inverted_index/applier.rs:68-84 — `src/mito2/src/sst/index/bloom_filter/applier.rs` and `src/mito2/src/sst/index/fulltext_index/applier.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 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (17 lines × 3) src/servers/src/otlp/metrics.rs:1128— src/servers/src/otlp/metrics.rs:1128-1144 | src/servers/src/otlp/metrics.rs:1167-1183 | src/servers/src/otlp/metrics.rs:1426-1442 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15–17 lines × 2) src/frontend/src/instance.rs:324— src/frontend/src/instance.rs:324-340 | src/frontend/src/instance.rs:943-957 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–17 lines × 2) tests-fuzz/targets/ddl/fuzz_repartition_metric_table.rs:442— tests-fuzz/targets/ddl/fuzz_repartition_metric_table.rs:442-456 | tests-fuzz/targets/ddl/fuzz_repartition_table.rs:398-414 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_repartition_metric_table.rs` and `tests-fuzz/targets/ddl/fuzz_repartition_table.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 4) src/common/meta/src/key/table_info.rs:222— src/common/meta/src/key/table_info.rs:222-237 | src/common/meta/src/key/table_info.rs:254-269 | src/common/meta/src/key/view_info.rs:213-228 | src/common/meta/src/key/view_info.rs:245-260 — before extracting anything, compare `src/common/meta/src/key/table_info.rs` and `src/common/meta/src/key/view_info.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 4) src/promql/src/functions/native_histogram.rs:1121— src/promql/src/functions/native_histogram.rs:1121-1136 | src/promql/src/functions/native_histogram.rs:1198-1213 | src/promql/src/functions/native_histogram.rs:2475-2490 | src/promql/src/functions/native_histogram.rs:2751-2766 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 4) src/catalog/src/system_schema/information_schema/region_info.rs:72— src/catalog/src/system_schema/information_schema/region_info.rs:72-86 | src/catalog/src/system_schema/information_schema/ssts.rs:95-109 | src/catalog/src/system_schema/information_schema/ssts.rs:155-169 | src/catalog/src/system_schema/information_schema/ssts.rs:215-229 — 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 (15 lines × 4) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:102— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:102-116 | tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:126-140 | tests-fuzz/targets/fuzz_insert_logical_table.rs:104-118 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:125-139 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs` and `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (13–15 lines × 2) src/operator/src/statement/ddl.rs:2427— src/operator/src/statement/ddl.rs:2427-2439 | src/operator/src/statement/ddl.rs:2717-2731 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13–15 lines × 2) src/promql/src/extension_plan/instant_manipulate.rs:487— src/promql/src/extension_plan/instant_manipulate.rs:487-501 | src/promql/src/extension_plan/range_manipulate.rs:496-508 — before extracting anything, compare `src/promql/src/extension_plan/instant_manipulate.rs` and `src/promql/src/extension_plan/range_manipulate.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 4) src/pipeline/src/etl/processor/decolorize.rs:109— src/pipeline/src/etl/processor/decolorize.rs:109-122 | src/pipeline/src/etl/processor/digest.rs:205-218 | src/pipeline/src/etl/processor/epoch.rs:185-198 | src/pipeline/src/etl/processor/gsub.rs:123-136 — before extracting anything, compare `src/pipeline/src/etl/processor/decolorize.rs` and `src/pipeline/src/etl/processor/digest.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 (14 lines × 4) src/promql/src/functions/double_exponential_smoothing.rs:165— src/promql/src/functions/double_exponential_smoothing.rs:165-178 | src/promql/src/functions/idelta.rs:82-95 | src/promql/src/functions/predict_linear.rs:83-96 | src/promql/src/functions/quantile.rs:81-94 — before extracting anything, compare `src/promql/src/functions/idelta.rs` and `src/promql/src/functions/quantile.rs` as WHOLE FILES: this scan already matched 3 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 (13–14 lines × 3) src/common/meta/src/ddl/drop_table/executor.rs:320— src/common/meta/src/ddl/drop_table/executor.rs:320-332 | src/common/meta/src/ddl/drop_table/executor.rs:361-374 | src/common/meta/src/ddl/drop_table/executor.rs:437-449 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–14 lines × 3) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:81— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:81-93 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:71-84 | tests-fuzz/targets/fuzz_insert_logical_table.rs:83-95 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs` and `tests-fuzz/targets/ddl/fuzz_create_logical_table.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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) src/mito2/src/manifest/manager.rs:309— src/mito2/src/manifest/manager.rs:309-321 | src/mito2/src/manifest/manager.rs:470-482 | src/mito2/src/manifest/manager.rs:601-613 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:180— src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:180-193 | src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:172-184 | src/meta-srv/src/procedure/repartition/group/sync_region.rs:152-165 — before extracting anything, compare `src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs` and `src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–12 lines × 2) src/flow/src/batching_mode/task.rs:805— src/flow/src/batching_mode/task.rs:805-813 | src/flow/src/batching_mode/task.rs:1221-1232 — both copies are in the same file, so extract the block into 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–12 lines × 2) src/meta-srv/src/procedure/region_migration/close_downgraded_region.rs:101— src/meta-srv/src/procedure/region_migration/close_downgraded_region.rs:101-112 | src/meta-srv/src/procedure/utils.rs:155-163 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8–11 lines × 2) src/mito2/src/read/flat_dedup.rs:215— src/mito2/src/read/flat_dedup.rs:215-222 | src/mito2/src/read/flat_dedup.rs:448-458 — both copies are in the same file, so extract the block into 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–11 lines × 2) src/mito2/src/series_index/writer.rs:329— src/mito2/src/series_index/writer.rs:329-339 | src/mito2/src/sst/range_index/writer.rs:350-357 — before extracting anything, compare `src/mito2/src/series_index/writer.rs` and `src/mito2/src/sst/range_index/writer.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9–11 lines × 2) src/mito2/src/sst/index/fulltext_index/applier/builder.rs:204— src/mito2/src/sst/index/fulltext_index/applier/builder.rs:204-212 | src/mito2/src/sst/index/fulltext_index/applier/builder.rs:246-256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9–11 lines × 2) tests-fuzz/targets/ddl/fuzz_repartition_table.rs:279— tests-fuzz/targets/ddl/fuzz_repartition_table.rs:279-287 | tests-fuzz/targets/ddl/fuzz_repartition_table.rs:314-324 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7–10 lines × 2) src/mito2/src/series_index/writer.rs:297— src/mito2/src/series_index/writer.rs:297-306 | src/mito2/src/sst/range_index/writer.rs:320-326 — before extracting anything, compare `src/mito2/src/series_index/writer.rs` and `src/mito2/src/sst/range_index/writer.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7–10 lines × 2) tests-fuzz/targets/ddl/fuzz_create_table.rs:94— tests-fuzz/targets/ddl/fuzz_create_table.rs:94-103 | tests-fuzz/targets/ddl/fuzz_repartition_table.rs:251-257 — 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 × 5) src/catalog/src/system_schema/information_schema/flow_statistics.rs:133— src/catalog/src/system_schema/information_schema/flow_statistics.rs:133-141 | src/catalog/src/system_schema/information_schema/flows.rs:220-228 | src/catalog/src/system_schema/information_schema/table_semantics.rs:260-268 | src/catalog/src/system_schema/information_schema/tables.rs:164-172 | src/catalog/src/system_schema/information_schema/views.rs:127-135 — before extracting anything, compare `src/catalog/src/system_schema/information_schema/flow_statistics.rs` and `src/catalog/src/system_schema/information_schema/flows.rs` as WHOLE FILES: this scan already matched 3 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 (9 lines × 5) src/common/function/src/admin/flush_compact_table.rs:61— src/common/function/src/admin/flush_compact_table.rs:61-69 | src/common/function/src/admin/gc.rs:137-145 | src/common/function/src/admin/purge_table.rs:48-58 | src/common/function/src/flush_flow.rs:66-74 | src/common/function/src/system/procedure_state.rs:57-65 — before extracting anything, compare `src/common/function/src/admin/flush_compact_table.rs` and `src/common/function/src/admin/purge_table.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 (8 lines × 6) src/meta-srv/src/procedure/region_migration/downgrade_leader_region.rs:225— src/meta-srv/src/procedure/region_migration/downgrade_leader_region.rs:225-232 | src/meta-srv/src/procedure/region_migration/upgrade_candidate_region.rs:253-260 | src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:277-284 | src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:262-269 | src/meta-srv/src/procedure/repartition/group/remap_manifest.rs:143-150 | src/meta-srv/src/procedure/repartition/group/sync_region.rs:231-238 — before extracting anything, compare `src/meta-srv/src/procedure/region_migration/downgrade_leader_region.rs` and `src/meta-srv/src/procedure/region_migration/upgrade_candidate_region.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8 lines × 6) src/sql/src/parsers/alter_parser/trigger.rs:309— src/sql/src/parsers/alter_parser/trigger.rs:309-317 | src/sql/src/parsers/alter_parser/trigger.rs:354-362 | src/sql/src/parsers/alter_parser/trigger.rs:399-407 | src/sql/src/parsers/create_parser/trigger.rs:166-174 | src/sql/src/parsers/create_parser/trigger.rs:387-394 | src/sql/src/parsers/create_parser/trigger.rs:428-435 — `src/sql/src/parsers/alter_parser/trigger.rs` and `src/sql/src/parsers/create_parser/trigger.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 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (7 lines × 4) src/datatypes/src/vectors/binary.rs:169— src/datatypes/src/vectors/binary.rs:169-175 | src/datatypes/src/vectors/binary.rs:201-207 | src/datatypes/src/vectors/binary.rs:209-215 | src/datatypes/src/vectors/string.rs:154-160 — before extracting anything, compare `src/datatypes/src/vectors/binary.rs` and `src/datatypes/src/vectors/string.rs` as WHOLE FILES: this scan already matched 5 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 × 4) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:124— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:124-130 | tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:111-117 | tests-fuzz/targets/fuzz_insert_logical_table.rs:142-148 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:110-116 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs` and `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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.
ScanMetricsSet::fmt (cyclomatic 60) src/mito2/src/read/scan_util.rs:288— ScanMetricsSet::fmt has cyclomatic complexity 60 (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.
Helper::try_into_vector (cyclomatic 46) src/datatypes/src/vectors/helper.rs:180— Helper::try_into_vector has cyclomatic complexity 46 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ColumnDataTypeWrapper::try_from (cyclomatic 45) src/api/src/helper.rs:412— ColumnDataTypeWrapper::try_from has cyclomatic complexity 45 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ScanbenchCommand::run (cyclomatic 42) src/cmd/src/datanode/scanbench.rs:771— ScanbenchCommand::run has cyclomatic complexity 42 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Categorizer::check_plan (cyclomatic 40) src/query/src/dist_plan/commutativity.rs:94— Categorizer::check_plan has cyclomatic complexity 40 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
sql::util::extract_tables_from_statement (cyclomatic 34) src/sql/src/util.rs:211— sql::util::extract_tables_from_statement has cyclomatic complexity 34 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
api::helper::pb_value_to_value_ref (cyclomatic 33) src/api/src/helper.rs:764— api::helper::pb_value_to_value_ref has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ci-slash.main (cyclomatic 32) .github/scripts/ci-slash.py:46— ci-slash.main 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.
MysqlResultWriter::write_recordbatch (cyclomatic 31) src/servers/src/mysql/writer.rs:226— MysqlResultWriter::write_recordbatch has cyclomatic complexity 31 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
RowWriter::write (cyclomatic 29) src/servers/src/http/prometheus.rs:1062— RowWriter::write has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
HttpOutputWriter::write (cyclomatic 29) src/servers/src/http/result.rs:101— HttpOutputWriter::write has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
datatypes::vectors::eq::equal (cyclomatic 26) src/datatypes/src/vectors/eq.rs:55— datatypes::vectors::eq::equal has cyclomatic complexity 26 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
ParquetbenchCommand::run (cyclomatic 25) src/cmd/src/datanode/parquetbench.rs:166— ParquetbenchCommand::run 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.
MergeScanExec::to_stream (cyclomatic 25) src/query/src/dist_plan/merge_scan.rs:620— MergeScanExec::to_stream 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.
Value::try_negative (cyclomatic 24) src/datatypes/src/value.rs:515— Value::try_negative 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. This is NOT this file's highest cyclomatic complexity: Value::try_from (cyclomatic 37) 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.
CoalescingBatcher::run (cyclomatic 24) src/servers/src/grpc/flight/stream.rs:214— CoalescingBatcher::run 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.
PartitionExpr::try_as_logical_expr (cyclomatic 23) src/partition/src/expr.rs:280— PartitionExpr::try_as_logical_expr has cyclomatic complexity 23 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: Operand::try_as_logical_expr (cyclomatic 25) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
flow::batching_mode::utils::merge_op_for_aggregate_expr (cyclomatic 22) src/flow/src/batching_mode/utils.rs:329— flow::batching_mode::utils::merge_op_for_aggregate_expr 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.
MetricEngine::handle_request (cyclomatic 22) src/metric-engine/src/engine.rs:210— MetricEngine::handle_request 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.
MitoRegion::set_role_state_gracefully (cyclomatic 22) src/mito2/src/region.rs:490— MitoRegion::set_role_state_gracefully 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.
ParquetReaderBuilder::build_reader_input_inner (cyclomatic 22) src/mito2/src/sst/parquet/reader.rs:432— ParquetReaderBuilder::build_reader_input_inner 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.
Runner::execute_once (cyclomatic 21) src/common/procedure/src/local/runner.rs:342— Runner::execute_once 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.
BatchGcProcedure::get_file_references (cyclomatic 21) src/meta-srv/src/gc/procedure.rs:648— BatchGcProcedure::get_file_references 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.
Pattern::from_str (cyclomatic 21) src/pipeline/src/etl/processor/dissect.rs:206— Pattern::from_str 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.
ExtrapolatedRate::calc (cyclomatic 21) src/promql/src/functions/extrapolate_rate.rs:132— ExtrapolatedRate::calc 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.
WindowedSortStream::poll_next_inner (cyclomatic 21) src/query/src/window_sort.rs:444— WindowedSortStream::poll_next_inner 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.
AlterTableOperation::fmt (cyclomatic 21) src/sql/src/statements/alter.rs:248— AlterTableOperation::fmt has cyclomatic complexity 21 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
aws-ec2-runner-teardown.teardown (cyclomatic 21) .github/scripts/aws-ec2-runner-teardown.py:86— aws-ec2-runner-teardown.teardown 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.
SimpleFilterEvaluator::cast_timestamp_unit (cyclomatic 20) src/common/recordbatch/src/filter.rs:357— SimpleFilterEvaluator::cast_timestamp_unit 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.
LogQueryPlanner::build_content_filter_with_expr (cyclomatic 20) src/query/src/log_query/planner.rs:206— LogQueryPlanner::build_content_filter_with_expr 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.
ExportCreateCommand::build (cyclomatic 19) src/cli/src/data/export_v2/command.rs:346— ExportCreateCommand::build has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
cmd::datanode::parquet_rewrite::build_writer_properties (cyclomatic 19) src/cmd/src/datanode/parquet_rewrite.rs:265— cmd::datanode::parquet_rewrite::build_writer_properties has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
BatchingEngine::create_flow_inner (cyclomatic 19) src/flow/src/batching_mode/engine.rs:558— BatchingEngine::create_flow_inner has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Batch::merge_last_non_null (cyclomatic 19) src/mito2/src/read.rs:507— Batch::merge_last_non_null 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.
PlanRewriter::should_expand (cyclomatic 19) src/query/src/dist_plan/analyzer.rs:478— PlanRewriter::should_expand 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.
CountNestAggrRule::try_rewrite_sort (cyclomatic 19) src/query/src/optimizer/count_nest_aggr.rs:66— CountNestAggrRule::try_rewrite_sort has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
collect_context.collect_report (cyclomatic 19) .agents/skills/greptimedb-development-docker-image/scripts/collect_context.py:146— collect_context.collect_report has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
PackIndex::validate (cyclomatic 18) src/common/datasource/src/packed_snapshot.rs:63— PackIndex::validate 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.
TraceColumnRequestSchema::incompatible_schema_batches (cyclomatic 18) src/frontend/src/instance/otlp/trace_ingest.rs:762— TraceColumnRequestSchema::incompatible_schema_batches 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.
agent-observability-summary.benchmark (cyclomatic 18) .github/scripts/agent-observability-summary.py:83— agent-observability-summary.benchmark 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.
Manifest::validate_layout (cyclomatic 17) src/cli/src/data/export_v2/manifest.rs:286— Manifest::validate_layout has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
FulltextOptions::try_from (cyclomatic 17) src/datatypes/src/schema/column_schema.rs:742— FulltextOptions::try_from 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.
EntityGraphProviderImpl::enumerate (cyclomatic 17) src/frontend/src/instance/entity_graph.rs:386— EntityGraphProviderImpl::enumerate 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.
Metasrv::try_start_after_gc_check (cyclomatic 17) src/meta-srv/src/metasrv.rs:617— Metasrv::try_start_after_gc_check 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.
DefaultCompactor::merge_ssts (cyclomatic 17) src/mito2/src/compaction/compactor.rs:637— DefaultCompactor::merge_ssts has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
LocalGcWorker::do_region_gc (cyclomatic 17) src/mito2/src/gc.rs:413— LocalGcWorker::do_region_gc 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.
Collider::try_create_nucleon (cyclomatic 17) src/partition/src/collider.rs:345— Collider::try_create_nucleon 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::simplify::simplify_terms (cyclomatic 17) src/partition/src/simplify.rs:297— partition::simplify::simplify_terms 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.
AlterKind::validate (cyclomatic 17) src/store-api/src/region_request.rs:969— AlterKind::validate has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This is NOT this file's highest cyclomatic complexity: RegionRequest::try_from_request_body (cyclomatic 20) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
query-regression-run.run_direct_case (cyclomatic 17) .github/scripts/query-regression-run.py:305— query-regression-run.run_direct_case 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.
Import::run (cyclomatic 16) src/cli/src/data/import_v2/command.rs:209— Import::run 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.
MetasrvBuilder::build (cyclomatic 16) src/meta-srv/src/metasrv/builder.rs:207— MetasrvBuilder::build 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.
ParquetFetchMetrics::fmt (cyclomatic 16) src/mito2/src/sst/parquet/row_group.rs:71— ParquetFetchMetrics::fmt 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.
PartitionChecker::run (cyclomatic 16) REDACTED:48— PartitionChecker::run 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.
DissectProcessor::process_pattern (cyclomatic 16) src/pipeline/src/etl/processor/dissect.rs:448— DissectProcessor::process_pattern 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.
DataFusionExprConverter::convert (cyclomatic 16) src/query/src/dist_plan/predicate_extractor.rs:256— DataFusionExprConverter::convert has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function so the top-level body reads as a short sequence of named decisions. This is NOT this file's highest cyclomatic complexity: DataFusionExprConverter::is_safe_cast_for_partition_pruning (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
RangeSelectStream::generate_output (cyclomatic 16) src/query/src/range_select/plan.rs:1095— RangeSelectStream::generate_output 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.
PostgresServerHandlerInner::authenticate_password_message (cyclomatic 16) src/servers/src/postgres/auth_handler.rs:363— PostgresServerHandlerInner::authenticate_password_message 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.
TableMeta::set_table_options (cyclomatic 16) src/table/src/metadata.rs:357— TableMeta::set_table_options 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.
agent-observability-summary.lifecycle (cyclomatic 16) .github/scripts/agent-observability-summary.py:134— agent-observability-summary.lifecycle 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.
query-regression-slash.admit_pull (cyclomatic 16) .github/scripts/query-regression-slash.py:353— query-regression-slash.admit_pull 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.
query-regression-summary.build_markdown (cyclomatic 16) .github/scripts/query-regression-summary.py:171— query-regression-summary.build_markdown 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.
Yanked release: mysql — `mysql` resolves to 28.0.0 in the committed REDACTED, and crates.io reports that release as YANKED. A yanked release is one the publisher has withdrawn and asked you to stop using; it keeps resolving only so existing locks do not break. The current stable release is 28.0.3. Run `cargo update -p mysql` and commit the updated lock.
ScanbenchCommand::run (cognitive 77) src/cmd/src/datanode/scanbench.rs:771— ScanbenchCommand::run has cognitive complexity 77 (threshold 15). Drivers by points: if/else 30 (48 pts), loops 7 (16 pts), match/switch 5 (10 pts), boolean chains 3 (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.
ScanMetricsSet::fmt (cognitive 70) src/mito2/src/read/scan_util.rs:288— ScanMetricsSet::fmt has cognitive complexity 70 (threshold 15). Drivers by points: if/else 50 (59 pts), boolean chains 7, loops 2 (4 pts) (nesting depth added 11). 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.
Batch::merge_last_non_null (cognitive 54) src/mito2/src/read.rs:507— Batch::merge_last_non_null has cognitive complexity 54 (threshold 15). Drivers by points: if/else 11 (36 pts), loops 7 (17 pts), boolean chains 1 (nesting depth added 35). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
CoalescingBatcher::run (cognitive 49) src/servers/src/grpc/flight/stream.rs:214— CoalescingBatcher::run has cognitive complexity 49 (threshold 15). Drivers by points: if/else 14 (37 pts), loops 3 (5 pts), match/switch 2 (5 pts), boolean chains 2 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Runner::execute_once (cognitive 46) src/common/procedure/src/local/runner.rs:342— Runner::execute_once has cognitive complexity 46 (threshold 15). Drivers by points: if/else 12 (38 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 29). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WindowedSortStream::poll_next_inner (cognitive 46) src/query/src/window_sort.rs:444— WindowedSortStream::poll_next_inner has cognitive complexity 46 (threshold 15). Drivers by points: if/else 14 (38 pts), match/switch 3 (5 pts), loops 2 (3 pts) (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ci-slash.main (cognitive 46) .github/scripts/ci-slash.py:46— ci-slash.main has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (30 pts), boolean chains 9, loops 2 (4 pts), ternaries 1 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DefaultCompactor::merge_ssts (cognitive 42) src/mito2/src/compaction/compactor.rs:637— DefaultCompactor::merge_ssts has cognitive complexity 42 (threshold 15). Drivers by points: loops 8 (24 pts), if/else 5 (15 pts), match/switch 1 (3 pts) (nesting depth added 28). 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.
ExtrapolatedRate::calc (cognitive 41) src/promql/src/functions/extrapolate_rate.rs:132— ExtrapolatedRate::calc has cognitive complexity 41 (threshold 15). Drivers by points: if/else 19 (31 pts), match/switch 2 (7 pts), boolean chains 2, loops 1 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Pruner::worker_loop (cognitive 37) src/mito2/src/read/pruner.rs:601— Pruner::worker_loop has cognitive complexity 37 (threshold 15). Drivers by points: if/else 11 (26 pts), loops 3 (7 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
aws-ec2-runner-teardown.teardown (cognitive 36) .github/scripts/aws-ec2-runner-teardown.py:86— aws-ec2-runner-teardown.teardown has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (19 pts), boolean chains 5, error handling 2 (5 pts), ternaries 2 (4 pts), loops 2 (3 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InformationSchemaStatisticsBuilder::make_statistics (cognitive 35) src/catalog/src/system_schema/information_schema/statistics.rs:229— InformationSchemaStatisticsBuilder::make_statistics has cognitive complexity 35 (threshold 15). Drivers by points: if/else 5 (20 pts), loops 4 (9 pts), match/switch 1 (5 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParquetbenchCommand::run (cognitive 35) src/cmd/src/datanode/parquetbench.rs:166— ParquetbenchCommand::run has cognitive complexity 35 (threshold 15). Drivers by points: if/else 19 (23 pts), boolean chains 4, loops 2 (4 pts), match/switch 3 (4 pts) (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.
FlowDualEngine::check_flow_consistent (cognitive 35) src/flow/src/adapter/flownode_impl.rs:275— FlowDualEngine::check_flow_consistent has cognitive complexity 35 (threshold 15). Drivers by points: if/else 11 (21 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.
frontend::instance::grpc::fill_catalog_and_schema_from_context (cognitive 35) src/frontend/src/instance/grpc.rs:308— frontend::instance::grpc::fill_catalog_and_schema_from_context has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (34 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.
sql::statements::insert::sql_exprs_to_values (cognitive 33) src/sql/src/statements/insert.rs:150— sql::statements::insert::sql_exprs_to_values has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (22 pts), match/switch 2 (8 pts), loops 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.
EntityGraphProviderImpl::enumerate (cognitive 32) src/frontend/src/instance/entity_graph.rs:386— EntityGraphProviderImpl::enumerate 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.
update-compat-versions.published_release_tags (cognitive 32) .github/scripts/update-compat-versions.py:203— update-compat-versions.published_release_tags has cognitive complexity 32 (threshold 15). Drivers by points: if/else 9 (25 pts), loops 2 (3 pts), boolean chains 2, error handling 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.
ColumnDataTypeWrapper::try_from (cognitive 31) src/api/src/helper.rs:412— ColumnDataTypeWrapper::try_from has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (17 pts), match/switch 6 (11 pts), loops 1 (3 pts) (nesting depth added 14). 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.
TwcsPicker::build_output (cognitive 31) src/mito2/src/compaction/twcs.rs:131— TwcsPicker::build_output has cognitive complexity 31 (threshold 15). Drivers by points: if/else 5 (20 pts), loops 4 (9 pts), boolean chains 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent-observability-summary.benchmark (cognitive 31) .github/scripts/agent-observability-summary.py:83— agent-observability-summary.benchmark has cognitive complexity 31 (threshold 15). Drivers by points: ternaries 5 (11 pts), loops 6 (10 pts), if/else 3 (7 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.
Manifest::validate_layout (cognitive 30) src/cli/src/data/export_v2/manifest.rs:286— Manifest::validate_layout has cognitive complexity 30 (threshold 15). Drivers by points: if/else 7 (19 pts), boolean chains 5, loops 2 (5 pts), 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.
Metasrv::try_start_after_gc_check (cognitive 30) src/meta-srv/src/metasrv.rs:617— Metasrv::try_start_after_gc_check has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (17 pts), match/switch 2 (7 pts), loops 3 (6 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CountdownTask::run (cognitive 29) src/datanode/src/alive_keeper.rs:411— CountdownTask::run has cognitive complexity 29 (threshold 15). Drivers by points: if/else 7 (22 pts), match/switch 2 (5 pts), boolean chains 1, 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.
TraceColumnRequestSchema::incompatible_schema_batches (cognitive 29) src/frontend/src/instance/otlp/trace_ingest.rs:762— TraceColumnRequestSchema::incompatible_schema_batches has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 6 (9 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.
DissectProcessor::process_pattern (cognitive 29) src/pipeline/src/etl/processor/dissect.rs:448— DissectProcessor::process_pattern has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 4 (10 pts), match/switch 2 (4 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.
GreptimeTransformer::transform_mut_with_schema (cognitive 29) src/pipeline/src/etl/transform/transformer/greptime.rs:233— GreptimeTransformer::transform_mut_with_schema has cognitive complexity 29 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 3 (12 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Categorizer::check_plan (cognitive 29) src/query/src/dist_plan/commutativity.rs:94— Categorizer::check_plan has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (20 pts), boolean chains 4, loops 2 (4 pts), 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.
FlightRecordBatchStream::verbose_metrics_stream (cognitive 29) src/servers/src/grpc/flight/stream.rs:544— FlightRecordBatchStream::verbose_metrics_stream has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (21 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DirtyTimeWindows::gen_filter_exprs (cognitive 28) src/flow/src/batching_mode/state.rs:630— DirtyTimeWindows::gen_filter_exprs has cognitive complexity 28 (threshold 15). Drivers by points: if/else 16 (26 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.
PageRangeCache::lookup (cognitive 28) src/mito2/src/cache.rs:1848— PageRangeCache::lookup has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 4 (7 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.
ManifestContext::set_role (cognitive 28) src/mito2/src/region.rs:1560— ManifestContext::set_role has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (21 pts), match/switch 4 (7 pts) (nesting depth added 14). 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.
ParquetReaderBuilder::build_reader_input_inner (cognitive 28) src/mito2/src/sst/parquet/reader.rs:432— ParquetReaderBuilder::build_reader_input_inner has cognitive complexity 28 (threshold 15). Drivers by points: if/else 20 (21 pts), boolean chains 7 (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.
ManifestObjectStore::delete_until (cognitive 27) src/mito2/src/manifest/storage.rs:266— ManifestObjectStore::delete_until has cognitive complexity 27 (threshold 15). Drivers by points: if/else 14 (21 pts), loops 3 (4 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.
PutRecordBatchRequestStream::poll_next (cognitive 27) src/servers/src/grpc/flight.rs:432— PutRecordBatchRequestStream::poll_next has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 6 (21 pts), if/else 2 (5 pts), loops 1 (nesting depth added 18). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MysqlResultWriter::write_recordbatch (cognitive 27) src/servers/src/mysql/writer.rs:226— MysqlResultWriter::write_recordbatch has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (15 pts), match/switch 2 (7 pts), loops 3 (5 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AlterTrigger::fmt (cognitive 27) src/sql/src/statements/alter/trigger.rs:37— AlterTrigger::fmt has cognitive complexity 27 (threshold 15). Drivers by points: loops 4 (13 pts), if/else 6 (8 pts), match/switch 3 (6 pts) (nesting depth added 14). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
table::requests::validate_and_normalize_annotation (cognitive 27) src/table/src/requests.rs:562— table::requests::validate_and_normalize_annotation has cognitive complexity 27 (threshold 15). Drivers by points: if/else 9 (22 pts), loops 1 (3 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.
PackIndex::validate (cognitive 26) src/common/datasource/src/packed_snapshot.rs:63— PackIndex::validate has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 5, loops 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
metric_engine::batch_modifier::compute_tsid_array (cognitive 26) src/metric-engine/src/batch_modifier.rs:50— metric_engine::batch_modifier::compute_tsid_array has cognitive complexity 26 (threshold 15). Drivers by points: if/else 5 (15 pts), loops 5 (11 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.
LocalGcWorker::do_region_gc (cognitive 25) src/mito2/src/gc.rs:413— LocalGcWorker::do_region_gc has cognitive complexity 25 (threshold 15). Drivers by points: if/else 18 (20 pts), boolean chains 5 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
query-regression-run.run_direct_case (cognitive 25) .github/scripts/query-regression-run.py:305— query-regression-run.run_direct_case has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 7 (9 pts), ternaries 1 (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.
Import::run (cognitive 24) src/cli/src/data/import_v2/command.rs:209— Import::run has cognitive complexity 24 (threshold 15). Drivers by points: if/else 14 (16 pts), loops 2 (5 pts), boolean chains 2, 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.
MetasrvBuilder::build (cognitive 24) src/meta-srv/src/metasrv/builder.rs:207— MetasrvBuilder::build has cognitive complexity 24 (threshold 15). Drivers by points: if/else 18 (19 pts), match/switch 3, boolean chains 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.
AccessLayer::write_sst (cognitive 24) src/mito2/src/access_layer.rs:346— AccessLayer::write_sst has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (13 pts), match/switch 3 (8 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ManifestCache::remove_empty_dirs_recursive_sync (cognitive 24) src/mito2/src/cache/manifest_cache.rs:400— ManifestCache::remove_empty_dirs_recursive_sync has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 1, loops 1, match/switch 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.
PartSortStream::poll_next_inner (cognitive 24) src/query/src/part_sort.rs:1168— PartSortStream::poll_next_inner has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent-observability-summary.lifecycle (cognitive 24) .github/scripts/agent-observability-summary.py:134— agent-observability-summary.lifecycle has cognitive complexity 24 (threshold 15). Drivers by points: ternaries 6 (13 pts), loops 4 (5 pts), boolean chains 4, if/else 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.
common_config::file_watcher::resolve_one (cognitive 23) src/common/config/src/file_watcher.rs:268— common_config::file_watcher::resolve_one has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (5 pts), match/switch 2 (5 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.
Ipv4ToCidr::invoke_with_args (cognitive 23) src/common/function/src/scalars/ip/cidr.rs:78— Ipv4ToCidr::invoke_with_args has cognitive complexity 23 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegexpExtractFunction::invoke_with_args (cognitive 23) src/common/function/src/scalars/string/regexp_extract.rs:94— RegexpExtractFunction::invoke_with_args has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (19 pts), boolean chains 2, loops 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KafkaLogStore::read (cognitive 23) src/log-store/src/kafka/log_store.rs:317— KafkaLogStore::read has cognitive complexity 23 (threshold 15). Drivers by points: if/else 11 (22 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.
CompactionScheduler::submit_prepared_compaction (cognitive 23) src/mito2/src/compaction/scheduler/planning.rs:433— CompactionScheduler::submit_prepared_compaction has cognitive complexity 23 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 2 (4 pts), loops 1 (2 pts) (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.
ExportCreateCommand::build (cognitive 22) src/cli/src/data/export_v2/command.rs:346— ExportCreateCommand::build has cognitive complexity 22 (threshold 15). Drivers by points: if/else 16 (19 pts), boolean chains 3 (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
common_datasource::file_format::csv::tolerant_csv_stream_from_reader (cognitive 22) src/common/datasource/src/file_format/csv.rs:276— common_datasource::file_format::csv::tolerant_csv_stream_from_reader has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (12 pts), match/switch 2 (6 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StreamingEngine::handle_inserts_inner (cognitive 22) src/flow/src/adapter.rs:1052— StreamingEngine::handle_inserts_inner has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 2 (3 pts), boolean chains 2, 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.
FindGroupByFinalName::f_up (cognitive 22) src/flow/src/batching_mode/utils.rs:1234— FindGroupByFinalName::f_up has cognitive complexity 22 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (6 pts) (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegionSupervisor::handle_region_failures (cognitive 22) src/meta-srv/src/region/supervisor.rs:544— RegionSupervisor::handle_region_failures has cognitive complexity 22 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 5 (9 pts), match/switch 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.
InstantManipulateStream::manipulate (cognitive 22) src/promql/src/extension_plan/instant_manipulate.rs:675— InstantManipulateStream::manipulate has cognitive complexity 22 (threshold 15). Drivers by points: if/else 11 (15 pts), boolean chains 4, loops 2 (3 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PromWriteRequest::decode (cognitive 22) src/servers/src/prom_remote_write/decode.rs:196— PromWriteRequest::decode has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (4 pts), match/switch 1 (2 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
build-ecs-image.main (cognitive 22) .github/runner-scale-sets/query-regression/ecs-image/build-ecs-image.py:303— build-ecs-image.main has cognitive complexity 22 (threshold 15). Drivers by points: if/else 7 (13 pts), error handling 2 (3 pts), loops 3, ternaries 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.
Ipv6NumToString::invoke_with_args (cognitive 21) src/common/function/src/scalars/ip/ipv6.rs:61— Ipv6NumToString::invoke_with_args has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConcreteDataType::from (cognitive 21) src/api/src/helper.rs:113— ConcreteDataType::from has cognitive complexity 21 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 2 (3 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.
TimePartitions::find_partitions_by_time_range (cognitive 21) src/mito2/src/memtable/time_partition.rs:545— TimePartitions::find_partitions_by_time_range has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 2 (5 pts), boolean chains 1, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegionLoadCacheTask::fill_cache (cognitive 21) src/mito2/src/region/opener.rs:1048— RegionLoadCacheTask::fill_cache has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 3 (4 pts), match/switch 1 (2 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParquetWriter::write_all_flat_inner (cognitive 21) src/mito2/src/sst/parquet/writer.rs:414— ParquetWriter::write_all_flat_inner has cognitive complexity 21 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 3 (8 pts), boolean chains 1, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanHintRewriter::extract_last_value_selector (cognitive 21) src/query/src/optimizer/scan_hint.rs:401— ScanHintRewriter::extract_last_value_selector has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 3, 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.
collect_context.collect_report (cognitive 21) .agents/skills/greptimedb-development-docker-image/scripts/collect_context.py:146— collect_context.collect_report has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (8 pts), ternaries 6, boolean chains 5, error handling 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition.
OpenDalStorage::prepare_export_chunk (cognitive 20) src/cli/src/data/snapshot_storage.rs:729— OpenDalStorage::prepare_export_chunk has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), match/switch 2 (4 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.
AbsentStream::poll_next (cognitive 20) src/promql/src/extension_plan/absent.rs:473— AbsentStream::poll_next has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 3 (6 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.
Export::get_table_list (cognitive 19) src/cli/src/data/export.rs:256— Export::get_table_list has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 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.
CountHashGroupAccumulator::update_batch (cognitive 19) src/common/function/src/aggrs/count_hash.rs:194— CountHashGroupAccumulator::update_batch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 3 (9 pts), loops 4 (8 pts), boolean chains 1, match/switch 1 (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
common_sql::convert::parse_string_to_value (cognitive 19) src/common/sql/src/convert.rs:244— common_sql::convert::parse_string_to_value has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TraceChunkRetry::try_new (cognitive 19) src/frontend/src/instance/otlp/trace_ingest.rs:213— TraceChunkRetry::try_new has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
log_store::kafka::util::record::maybe_emit_entry (cognitive 19) src/log-store/src/kafka/util/record.rs:241— log_store::kafka::util::record::maybe_emit_entry has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
EngineInner::scan_region (cognitive 19) src/mito2/src/engine.rs:1054— EngineInner::scan_region has cognitive complexity 19 (threshold 15). Drivers by points: if/else 15, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MitoRegion::set_role_state_gracefully (cognitive 19) src/mito2/src/region.rs:490— MitoRegion::set_role_state_gracefully has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 7 (13 pts), if/else 4 (5 pts), boolean chains 1 (nesting depth added 7). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SeriesNormalizeStream::normalize (cognitive 19) src/promql/src/extension_plan/normalize.rs:408— SeriesNormalizeStream::normalize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FallbackPlanRewriter::f_down (cognitive 19) src/query/src/dist_plan/analyzer/fallback.rs:43— FallbackPlanRewriter::f_down has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (19 pts) (nesting depth added 10). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
InfluxdbV1Response::from_output (cognitive 19) src/servers/src/http/result/influxdb_result_v1.rs:136— InfluxdbV1Response::from_output has cognitive complexity 19 (threshold 15). Drivers by points: match/switch 5 (18 pts), loops 1 (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.
update-compat-versions.main (cognitive 19) .github/scripts/update-compat-versions.py:406— update-compat-versions.main has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (12 pts), error handling 2 (3 pts), boolean chains 2, ternaries 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorSum::update_batch (cognitive 18) src/common/function/src/aggrs/vector/sum.rs:102— VectorSum::update_batch has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ErrorVariant::from_enum_variant (cognitive 18) src/common/macro/src/stack_trace_debug.rs:127— ErrorVariant::from_enum_variant has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (16 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.
ProcedureStore::load_messages (cognitive 18) src/common/procedure/src/store.rs:223— ProcedureStore::load_messages has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 2, match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FulltextOptions::try_from (cognitive 18) src/datatypes/src/schema/column_schema.rs:742— FulltextOptions::try_from has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 6 (12 pts), if/else 5, 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.
HeartbeatRunner::report_heartbeats (cognitive 18) src/frontend/src/heartbeat.rs:449— HeartbeatRunner::report_heartbeats has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (12 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InfluxdbLineTimestampAligner::align_timestamps (cognitive 18) src/frontend/src/instance/influxdb.rs:108— InfluxdbLineTimestampAligner::align_timestamps has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Actor::start_creates (cognitive 18) src/log-store/src/object_store_wal/store.rs:1050— Actor::start_creates has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (14 pts), match/switch 1 (2 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GcScheduler::select_gc_candidates (cognitive 18) src/meta-srv/src/gc/candidate.rs:68— GcScheduler::select_gc_candidates has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (14 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.
RowModifier::fill_internal_columns (cognitive 18) src/metric-engine/src/row_modifier.rs:182— RowModifier::fill_internal_columns 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.
CacheManager::get_sst_meta_data (cognitive 18) src/mito2/src/cache.rs:1061— CacheManager::get_sst_meta_data has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 2 (6 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ValueBuilder::extend (cognitive 18) src/mito2/src/memtable/time_series.rs:1038— ValueBuilder::extend has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 2 (5 pts), match/switch 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.
RegionOpener::maybe_open (cognitive 18) src/mito2/src/region/opener.rs:508— RegionOpener::maybe_open has cognitive complexity 18 (threshold 15). Drivers by points: if/else 12 (15 pts), boolean chains 2, 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.
BloomFilterIndexer::do_update_flat (cognitive 18) src/mito2/src/sst/index/bloom_filter/creator.rs:298— BloomFilterIndexer::do_update_flat has cognitive complexity 18 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 5 (8 pts), boolean chains 1 (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RangeBase::compute_filter_mask_flat (cognitive 18) src/mito2/src/sst/parquet/file_range.rs:717— RangeBase::compute_filter_mask_flat has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (12 pts), boolean chains 3, match/switch 1 (2 pts), loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EnforceDistRequirementRewriter::get_current_applicable_column_requirements (cognitive 18) src/query/src/dist_plan/analyzer.rs:851— EnforceDistRequirementRewriter::get_current_applicable_column_requirements has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DataFusionExprConverter::convert (cognitive 18) src/query/src/dist_plan/predicate_extractor.rs:256— DataFusionExprConverter::convert has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (11 pts), loops 2 (4 pts), match/switch 2 (3 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.
CountNestAggrRule::try_rewrite_sort (cognitive 18) src/query/src/optimizer/count_nest_aggr.rs:66— CountNestAggrRule::try_rewrite_sort has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14, boolean chains 2, match/switch 2. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ExpandIntervalTransformRule::visit_expr (cognitive 18) src/sql/src/statements/transform/expand_interval.rs:71— ExpandIntervalTransformRule::visit_expr has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 4 (9 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.
PatternAst::eliminate_optional_fn (cognitive 17) src/common/function/src/scalars/matches.rs:272— PatternAst::eliminate_optional_fn has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), match/switch 2 (7 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.
Tokenizer::tokenize (cognitive 17) src/common/function/src/scalars/matches.rs:722— Tokenizer::tokenize has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (9 pts), if/else 2 (6 pts), boolean chains 1, loops 1 (nesting depth added 10). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Consumer::poll_next (cognitive 17) src/log-store/src/kafka/consumer.rs:191— Consumer::poll_next has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (11 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.
meta_srv::procedure::utils::handle_flush_region_reply (cognitive 17) src/meta-srv/src/procedure/utils.rs:75— meta_srv::procedure::utils::handle_flush_region_reply has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 1 (3 pts), match/switch 2 (3 pts) (nesting depth added 10). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
CheckpointStorage::load_checkpoint (cognitive 17) src/mito2/src/manifest/storage/checkpoint.rs:97— CheckpointStorage::load_checkpoint has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (12 pts), match/switch 2 (5 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FlatProjectionMapper::convert (cognitive 17) src/mito2/src/read/flat_projection.rs:310— FlatProjectionMapper::convert has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), boolean chains 2, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogQueryPlanner::build_content_filter_with_expr (cognitive 17) src/query/src/log_query/planner.rs:206— LogQueryPlanner::build_content_filter_with_expr has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 2 (3 pts) (nesting depth added 6). 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.
LogicalTablePendingRowsBatcher::accepts_bulk_destinations (cognitive 17) src/servers/src/batcher/logical_table.rs:208— LogicalTablePendingRowsBatcher::accepts_bulk_destinations has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (13 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.
image_config.update_env (cognitive 17) .agents/skills/greptimedb-development-docker-image/scripts/image_config.py:115— image_config.update_env has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (10 pts), ternaries 4 (6 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.
jsonbench-summary.parse_query_rows (cognitive 17) .github/scripts/jsonbench-summary.py:74— jsonbench-summary.parse_query_rows has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (7 pts), ternaries 2 (4 pts), loops 2 (3 pts), error handling 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.
query-regression-summary.build_markdown (cognitive 17) .github/scripts/query-regression-summary.py:171— query-regression-summary.build_markdown has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8, boolean chains 7, loops 1 (2 pts) (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
client::database::output_from_flight_message_stream (cognitive 16) src/client/src/database.rs:382— client::database::output_from_flight_message_stream has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 4 (11 pts), if/else 2 (3 pts), loops 1 (2 pts) (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
MatchesTermFunction::invoke_with_args (cognitive 16) src/common/function/src/scalars/matches_term.rs:116— MatchesTermFunction::invoke_with_args has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), match/switch 4 (5 pts), loops 1 (2 pts) (nesting depth added 5). 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, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MatchesTermFinder::find (cognitive 16) src/common/function/src/scalars/matches_term.rs:325— MatchesTermFinder::find has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (13 pts), boolean chains 2, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocateFunction::invoke_with_args (cognitive 16) src/common/function/src/scalars/string/locate.rs:116— LocateFunction::invoke_with_args has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 pts), boolean chains 1, loops 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
datanode::datanode::open_all_regions (cognitive 16) src/datanode/src/datanode.rs:930— datanode::datanode::open_all_regions has cognitive complexity 16 (threshold 15). Drivers by points: if/else 7 (12 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TraceRequestSchema::resolve_table_schema (cognitive 16) src/frontend/src/instance/otlp/trace_ingest.rs:552— TraceRequestSchema::resolve_table_schema has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 1 (3 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegionSupervisorTicker::start (cognitive 16) src/meta-srv/src/region/supervisor.rs:193— RegionSupervisorTicker::start has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (12 pts), loops 2 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetricEngine::handle_request (cognitive 16) src/metric-engine/src/engine.rs:210— MetricEngine::handle_request has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 1 (nesting depth added 5). 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.
MetricEngineInner::verify_rows (cognitive 16) src/metric-engine/src/engine/put.rs:553— MetricEngineInner::verify_rows has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (10 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.
RegionFlushTask::do_flush_memtables (cognitive 16) src/mito2/src/flush.rs:578— RegionFlushTask::do_flush_memtables has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (6 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SeriesIndexSearcher::search (cognitive 16) src/mito2/src/series_index/searcher.rs:101— SeriesIndexSearcher::search has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (5 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BloomFilterIndexApplier::apply (cognitive 16) src/mito2/src/sst/index/bloom_filter/applier.rs:208— BloomFilterIndexApplier::apply has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 4 (5 pts), match/switch 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QuantileOverTime::quantile_over_time (cognitive 16) src/promql/src/functions/quantile.rs:56— QuantileOverTime::quantile_over_time has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (7 pts), match/switch 3 (5 pts), loops 2 (4 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.
MatchesConstantTermOptimizer::optimize (cognitive 16) src/query/src/optimizer/constant_term.rs:158— MatchesConstantTermOptimizer::optimize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (14 pts), boolean chains 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WindowedSortPhysicalRule::do_optimize (cognitive 16) src/query/src/optimizer/windowed_sort.rs:68— WindowedSortPhysicalRule::do_optimize has cognitive complexity 16 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Column::fmt (cognitive 16) src/sql/src/statements/create.rs:205— Column::fmt 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.
query-regression-nightly-refs.select_base_and_candidate (cognitive 16) .github/scripts/query-regression-nightly-refs.py:122— query-regression-nightly-refs.select_base_and_candidate has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), boolean chains 3 (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.
query-regression-run.run_remote_case (cognitive 16) .github/scripts/query-regression-run.py:393— query-regression-run.run_remote_case has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (9 pts), boolean chains 3, loops 3, ternaries 1 (nesting depth added 3). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
D22 · Internal API Consistency· Redundant constructors with different input types. `try_new` takes raw integers (`i32`) while `new` takes the typed enum (`ColumnDataType`). This forces callers to decide between a fallible constructor for raw data and a fallible constructor for typed data, creating confusion about when to use which. · ×1
Redundant constructors with different input types. `try_new` takes raw integers (`i32`) while `new` takes the typed enum (`ColumnDataType`). This forces callers to decide between a fallible constructor for raw data and a fallible constructor for typed data, creating confusion about when to use which. — Unify into a single constructor `new` that accepts `ColumnDataType`. If raw integer construction is needed for internal/FFI purposes, mark it as `#[doc(hidden)]` or move it to a private helper, as public API should prefer type-safe enums. (signatures: ColumnDataTypeWrapper.try_new(datatype: i32, datatype_ext: ColumnDataTypeExtension): Result | ColumnDataTypeWrapper.new(datatype: ColumnDataType, datatype_ext: ColumnDataTypeExtension): Self)
D22 · Internal API Consistency· Duplicate intent for splitting a wrapper into its components. `to_parts` implies borrowing/consuming nothing or cloning, while `into_parts` implies consuming the wrapper. However, since the return type is identical and likely involves cloning or moving data, having both creates API bloat. If `to_parts` clones, it's expensive; if it doesn't, it conflicts with `into_parts` semantics. · ×1
Duplicate intent for splitting a wrapper into its components. `to_parts` implies borrowing/consuming nothing or cloning, while `into_parts` implies consuming the wrapper. However, since the return type is identical and likely involves cloning or moving data, having both creates API bloat. If `to_parts` clones, it's expensive; if it doesn't, it conflicts with `into_parts` semantics. — Keep only `into_parts` (consuming) as it is the standard Rust idiom for 'unpacking' a wrapper. Remove `to_parts` unless there is a specific need to clone the inner data without consuming the wrapper, in which case name it `clone_parts` or similar to be explicit. (signatures: ColumnDataTypeWrapper.to_parts(): (ColumnDataType, Option<ColumnDataTypeExtension>) | ColumnDataTypeWrapper.into_parts(): (ColumnDataType, Option<ColumnDataTypeExtension>))
D22 · Internal API Consistency· Confusingly similar method names `authenticate` vs `auth`. They appear to perform similar authentication logic but with different signatures (one includes catalog/schema context). This suggests a split between low-level credential verification and high-level session establishment, but the naming is inconsistent and `auth` is an abbreviation that clashes with the module name `auth`. · ×1
Confusingly similar method names `authenticate` vs `auth`. They appear to perform similar authentication logic but with different signatures (one includes catalog/schema context). This suggests a split between low-level credential verification and high-level session establishment, but the naming is inconsistent and `auth` is an abbreviation that clashes with the module name `auth`. — Rename `auth` to `authenticate_with_context` or `establish_session` to clearly distinguish it from the lower-level `authenticate`. Alternatively, if `authenticate` is the only core logic, remove `auth` and require callers to pass context if needed, or vice versa. (signatures: UserProvider.authenticate(id: Identity, password: Password): Result | UserProvider.auth(id: Identity, password: Password, catalog: str, schema: str): Result)
D22 · Internal API Consistency· Same naming inconsistency as above · ×1
Same naming inconsistency as above: `authenticate_bearer_token` vs `auth_bearer_token`. The signatures also differ in parameters (catalog/schema), indicating different scopes of operation, but the prefix difference (`authenticate_` vs `auth_`) is arbitrary and inconsistent with the rest of the API. — Unify the prefix. Use `authenticate_bearer_token` for the low-level check and `authenticate_bearer_token_with_context` (or similar) for the high-level one. Ensure consistency across all auth methods. (signatures: UserProvider.authenticate_bearer_token(_token: str, _catalog: str): Result | UserProvider.auth_bearer_token(token: str, catalog: str, schema: str): Result)
D22 · Internal API Consistency· Inconsistent naming for similar helper functions. `auth_mysql` takes raw password bytes (`save_pwd`), while `auth_mysql_with_verifier` takes a pre-computed verifier string. The naming convention is not parallel (one uses `_with_verifier`, the other doesn't use a suffix for the raw byte variant). · ×1
Inconsistent naming for similar helper functions. `auth_mysql` takes raw password bytes (`save_pwd`), while `auth_mysql_with_verifier` takes a pre-computed verifier string. The naming convention is not parallel (one uses `_with_verifier`, the other doesn't use a suffix for the raw byte variant). — Rename `auth_mysql` to `auth_mysql_with_password` or `auth_mysql_raw` to clearly indicate it takes the raw password/hash, making the distinction from `auth_mysql_with_verifier` explicit and consistent. (signatures: common.auth_mysql(auth_data: HashedPassword, salt: Salt, username: str, save_pwd: &[u8]): Result | common.auth_mysql_with_verifier(auth_data: HashedPassword, salt: Salt, username: str, verifier: str): Result)
D22 · Internal API Consistency· Inconsistent return types and parameter lists for 'format' functions. One returns `String` directly, the other returns `Result`. One takes fewer parameters. This suggests different internal complexities, but the API surface should ideally be uniform (e.g., all returning `Result` or all taking necessary salts/iterations explicitly). · ×1
Inconsistent return types and parameter lists for 'format' functions. One returns `String` directly, the other returns `Result`. One takes fewer parameters. This suggests different internal complexities, but the API surface should ideally be uniform (e.g., all returning `Result` or all taking necessary salts/iterations explicitly). — Standardize return types to `Result<String, Error>` for all formatting functions to handle potential encoding or validation errors uniformly. Ensure parameter lists are explicit about required inputs (e.g., salts). (signatures: common.format_mysql_native_password_verifier(password: &[u8]): String | common.format_pg_scram_sha256_password_verifier(password: &[u8], salt: &[u8], iterations: u32): Result)
Change-coupling hub: unordered_scan.rs → range.rs, seq_scan.rs, series_scan.rs src/mito2/src/read/unordered_scan.rs— `src/mito2/src/read/unordered_scan.rs` changes together with 3 other files — `src/mito2/src/read/range.rs`, `src/mito2/src/read/seq_scan.rs`, `src/mito2/src/read/series_scan.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 clique: failure_handler.rs, region_lease_handler.rs, weight_compute.rs src/meta-srv/src/handler/failure_handler.rs— 3 files — `src/meta-srv/src/handler/failure_handler.rs`, `src/meta-srv/src/handler/region_lease_handler.rs`, `src/meta-srv/src/selector/weight_compute.rs` — all change together with no explicit dependency: a fully-connected co-change clique, not 3 separate couplings. They share one concern (thin parallel siblings over a common abstraction), so extract the shared part into ONE unit and the whole clique's coupling clears at once — you do not need to break each pair individually.
D4 · Code Duplication· Near-duplicate member family (4 members, 13 shared lines) · ×1
Near-duplicate member family (4 members, 13 shared lines) src/common/function/src/scalars/geo/geohash.rs:89— src/common/function/src/scalars/geo/geohash.rs:89-130 | src/common/function/src/scalars/geo/geohash.rs:190-250 | src/common/function/src/scalars/geo/h3.rs:97-138 | src/common/function/src/scalars/geo/h3.rs:188-229 — These 4 members are variants of one another: a block of 13 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, 23 shared lines) · ×1
Near-duplicate member family (3 members, 23 shared lines) src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:135— src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:135-256 | src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:135-231 | src/meta-srv/src/procedure/repartition/group/sync_region.rs:120-212 — These 3 members are variants of one another: a block of 23 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 (59 shared lines) src/servers/src/http/prometheus.rs:387— src/servers/src/http/prometheus.rs:387-487 | src/servers/src/http/prometheus.rs:523-617 — These two members are variants of one another: 59 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (52 shared lines) src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:264— src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:264-354 | src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:249-337 — These two members are variants of one another: 52 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (33 shared lines) src/mito2/src/engine.rs:869— src/mito2/src/engine.rs:869-913 | src/mito2/src/engine.rs:966-1029 — These two members are variants of one another: 33 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (24 shared lines) src/common/function/src/aggrs/vector/avg.rs:87— src/common/function/src/aggrs/vector/avg.rs:87-147 | src/common/function/src/aggrs/vector/product.rs:107-147 — These two members are variants of one another: 24 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (22 shared lines) src/common/function/src/scalars/ip/cidr.rs:81— src/common/function/src/scalars/ip/cidr.rs:81-171 | src/common/function/src/scalars/ip/cidr.rs:219-282 — These two members are variants of one another: 22 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (17 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (17 members, 50+ identical tokens) src/pipeline/src/etl/processor/cmcd.rs:214— src/pipeline/src/etl/processor/cmcd.rs:214-244 | src/pipeline/src/etl/processor/csv.rs:104-184 | src/pipeline/src/etl/processor/date.rs:93-144 | src/pipeline/src/etl/processor/decolorize.rs:69-96 | src/pipeline/src/etl/processor/digest.rs:130-192 | src/pipeline/src/etl/processor/dissect.rs:557-600 | src/pipeline/src/etl/processor/epoch.rs:137-172 | src/pipeline/src/etl/processor/gsub.rs:67-110 | src/pipeline/src/etl/processor/join.rs:54-86 | src/pipeline/src/etl/processor/json_parse.rs:39-67 | src/pipeline/src/etl/processor/json_path.rs:34-81 | src/pipeline/src/etl/processor/letter.rs:85-116 | src/pipeline/src/etl/processor/regex.rs:90-131 | src/pipeline/src/etl/processor/select.rs:64-90 | src/pipeline/src/etl/processor/simple_extract.rs:42-76 | src/pipeline/src/etl/processor/urlencoding.rs:81-117 | src/pipeline/src/etl/transform.rs:547-643 — These 17 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 17 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 17 times.
D4 · Code Duplication· Members sharing a duplicated core (11 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (11 members, 50+ identical tokens) src/catalog/src/system_schema/information_schema/cluster_info.rs:154— src/catalog/src/system_schema/information_schema/cluster_info.rs:154-172 | src/catalog/src/system_schema/information_schema/columns.rs:175-193 | src/catalog/src/system_schema/information_schema/key_column_usage.rs:163-181 | src/catalog/src/system_schema/information_schema/partitions.rs:182-200 | src/catalog/src/system_schema/information_schema/procedure_info.rs:112-130 | src/catalog/src/system_schema/information_schema/recycle_bin.rs:133-151 | src/catalog/src/system_schema/information_schema/region_peers.rs:120-138 | src/catalog/src/system_schema/information_schema/region_statistics.rs:153-173 | src/catalog/src/system_schema/information_schema/schemata.rs:108-126 | src/catalog/src/system_schema/information_schema/statistics.rs:150-168 | src/catalog/src/system_schema/information_schema/table_constraints.rs:117-135 — These 11 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 11 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 11 times.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (8 members, 50+ identical tokens) src/table/src/metadata.rs:553— src/table/src/metadata.rs:553-607 | src/table/src/metadata.rs:613-667 | src/table/src/metadata.rs:776-926 | src/table/src/metadata.rs:932-1022 | src/table/src/metadata.rs:1028-1190 | src/table/src/metadata.rs:1196-1261 | src/table/src/metadata.rs:1315-1366 | src/table/src/metadata.rs:1372-1409 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (6 members, 50+ identical tokens) src/common/meta/src/key.rs:758— src/common/meta/src/key.rs:758-819 | src/common/meta/src/key.rs:828-901 | src/common/meta/src/key.rs:1488-1540 | src/common/meta/src/key.rs:1550-1585 | src/common/meta/src/key.rs:1705-1754 | src/common/meta/src/key/schema_name.rs:301-320 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Duplicated block (36 lines × 2) src/index/src/bloom_filter/reader.rs:56— src/index/src/bloom_filter/reader.rs:56-91 | src/index/src/inverted_index/format/reader.rs:50-85 — 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 (30–35 lines × 2) src/mito2/src/worker/handle_write.rs:377— src/mito2/src/worker/handle_write.rs:377-411 | src/mito2/src/worker/handle_write.rs:511-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 (34 lines × 2) src/common/function/src/aggrs/geo/encoding.rs:106— src/common/function/src/aggrs/geo/encoding.rs:106-139 | src/common/function/src/aggrs/geo/geo_path.rs:128-161 — before extracting anything, compare `src/common/function/src/aggrs/geo/encoding.rs` and `src/common/function/src/aggrs/geo/geo_path.rs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 121 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 (32 lines × 2) src/servers/src/otlp/logs.rs:578— src/servers/src/otlp/logs.rs:578-609 | src/servers/src/otlp/logs.rs:701-732 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (30–31 lines × 2) src/mito2/src/sst/parquet/reader.rs:966— src/mito2/src/sst/parquet/reader.rs:966-996 | src/mito2/src/sst/parquet/reader.rs:1227-1256 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (27–30 lines × 2) src/mito2/src/worker/handle_write.rs:336— src/mito2/src/worker/handle_write.rs:336-365 | src/mito2/src/worker/handle_write.rs:483-509 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (29 lines × 2) src/flow/src/batching_mode/engine.rs:228— src/flow/src/batching_mode/engine.rs:228-256 | src/flow/src/batching_mode/engine.rs:371-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 (28 lines × 3) src/cmd/src/datanode/objbench.rs:259— src/cmd/src/datanode/objbench.rs:259-286 | src/cmd/src/datanode/parquetbench.rs:449-476 | src/cmd/src/datanode/scanbench.rs:1239-1266 — 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 (27–28 lines × 3) src/promql/src/functions/native_histogram.rs:1119— src/promql/src/functions/native_histogram.rs:1119-1145 | src/promql/src/functions/native_histogram.rs:1196-1222 | src/promql/src/functions/native_histogram.rs:2749-2776 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (27 lines × 4) src/common/meta/src/reconciliation/reconcile_catalog.rs:181— src/common/meta/src/reconciliation/reconcile_catalog.rs:181-207 | src/common/meta/src/reconciliation/reconcile_database.rs:221-247 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:197-223 | src/common/meta/src/reconciliation/reconcile_table.rs:308-334 — before extracting anything, compare `src/common/meta/src/reconciliation/reconcile_catalog.rs` and `src/common/meta/src/reconciliation/reconcile_database.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (27 lines × 2) src/common/telemetry/src/metric.rs:119— src/common/telemetry/src/metric.rs:119-145 | src/common/telemetry/src/metric.rs:159-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 (26 lines × 2) src/servers/src/http/prometheus.rs:413— src/servers/src/http/prometheus.rs:413-438 | src/servers/src/http/prometheus.rs:544-569 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22–23 lines × 2) src/pipeline/src/etl/processor/cmcd.rs:265— src/pipeline/src/etl/processor/cmcd.rs:265-287 | src/pipeline/src/etl/processor/csv.rs:205-226 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (21–23 lines × 2) src/query/src/promql/planner.rs:1005— src/query/src/promql/planner.rs:1005-1027 | src/query/src/promql/planner.rs:1074-1094 — both copies are in the same file, so extract the block into 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) src/servers/src/postgres/types.rs:1248— src/servers/src/postgres/types.rs:1248-1270 | src/servers/src/postgres/types.rs:1351-1373 — both copies are in the same file, so extract the block into 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–22 lines × 3) src/pipeline/src/etl/processor/cmcd.rs:215— src/pipeline/src/etl/processor/cmcd.rs:215-236 | src/pipeline/src/etl/processor/decolorize.rs:70-90 | src/pipeline/src/etl/processor/json_parse.rs:40-59 — 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 (20–22 lines × 2) src/mito2/src/sst/index/bloom_filter/applier.rs:69— src/mito2/src/sst/index/bloom_filter/applier.rs:69-88 | src/mito2/src/sst/index/inverted_index/applier.rs:67-88 — `src/mito2/src/sst/index/bloom_filter/applier.rs` and `src/mito2/src/sst/index/inverted_index/applier.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 65 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (20–21 lines × 5) src/pipeline/src/etl/processor/dissect.rs:623— src/pipeline/src/etl/processor/dissect.rs:623-642 | src/pipeline/src/etl/processor/join.rs:108-128 | src/pipeline/src/etl/processor/letter.rs:138-158 | src/pipeline/src/etl/processor/regex.rs:210-230 | src/pipeline/src/etl/processor/urlencoding.rs:139-158 — before extracting anything, compare `src/pipeline/src/etl/processor/dissect.rs` and `src/pipeline/src/etl/processor/letter.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 (20–21 lines × 2) src/mito2/src/flush.rs:1582— src/mito2/src/flush.rs:1582-1601 | src/mito2/src/flush.rs:1622-1642 — both copies are in the same file, so extract the block into 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–21 lines × 2) src/servers/src/otlp/metrics.rs:1307— src/servers/src/otlp/metrics.rs:1307-1324 | src/servers/src/otlp/metrics.rs:1332-1352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–19 lines × 3) src/mito2/src/sst/index/bloom_filter/applier.rs:344— src/mito2/src/sst/index/bloom_filter/applier.rs:344-359 | src/mito2/src/sst/index/fulltext_index/applier.rs:719-737 | src/mito2/src/sst/index/inverted_index/applier.rs:295-310 — `src/mito2/src/sst/index/bloom_filter/applier.rs` and `src/mito2/src/sst/index/fulltext_index/applier.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 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (18 lines × 3) src/promql/src/functions/idelta.rs:78— src/promql/src/functions/idelta.rs:78-95 | src/promql/src/functions/predict_linear.rs:79-96 | src/promql/src/functions/quantile.rs:77-94 — before extracting anything, compare `src/promql/src/functions/idelta.rs` and `src/promql/src/functions/quantile.rs` as WHOLE FILES: this scan already matched 3 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 (13–18 lines × 2) src/servers/src/grpc/flight/stream.rs:322— src/servers/src/grpc/flight/stream.rs:322-339 | src/servers/src/grpc/flight/stream.rs:340-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 (16–17 lines × 5) src/servers/src/postgres/types.rs:631— src/servers/src/postgres/types.rs:631-646 | src/servers/src/postgres/types.rs:675-690 | src/servers/src/postgres/types.rs:722-737 | src/servers/src/postgres/types.rs:790-806 | src/servers/src/postgres/types.rs:841-857 — 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 (16–17 lines × 2) src/log-store/src/raft_engine/log_store.rs:367— src/log-store/src/raft_engine/log_store.rs:367-383 | src/log-store/src/raft_engine/log_store.rs:401-416 — both copies are in the same file, so extract the block into 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 × 4) src/servers/src/otlp/metrics.rs:1306— src/servers/src/otlp/metrics.rs:1306-1320 | src/servers/src/otlp/metrics.rs:1331-1345 | src/servers/src/otlp/metrics.rs:1495-1509 | src/servers/src/otlp/metrics.rs:1521-1536 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16 lines × 3) src/meta-srv/src/handler/collect_cluster_info_handler.rs:60— src/meta-srv/src/handler/collect_cluster_info_handler.rs:60-75 | src/meta-srv/src/handler/collect_cluster_info_handler.rs:102-117 | src/meta-srv/src/handler/collect_cluster_info_handler.rs:159-174 — all 3 copies are in the same file, so extract the block into one function there and call it from 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–16 lines × 2) src/catalog/src/system_schema/information_schema/information_memory_table.rs:111— src/catalog/src/system_schema/information_schema/information_memory_table.rs:111-126 | src/catalog/src/system_schema/information_schema/information_memory_table.rs:130-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–16 lines × 2) src/log-store/src/object_store_wal/store.rs:1253— src/log-store/src/object_store_wal/store.rs:1253-1268 | src/log-store/src/object_store_wal/store.rs:1282-1295 — both copies are in the same file, so extract the block into 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 × 3) src/flow/src/batching_mode/frontend_client.rs:450— src/flow/src/batching_mode/frontend_client.rs:450-464 | src/flow/src/batching_mode/frontend_client.rs:614-628 | src/flow/src/batching_mode/frontend_client.rs:695-709 — all 3 copies are in the same file, so extract the block into one function there and call it from 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) src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:278— src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs:278-292 | src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs:263-276 | src/meta-srv/src/procedure/repartition/group/remap_manifest.rs:144-157 — before extracting anything, compare `src/meta-srv/src/procedure/repartition/group/apply_staging_manifest.rs` and `src/meta-srv/src/procedure/repartition/group/enter_staging_region.rs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 129 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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 × 5) src/common/function/src/scalars/vector/elem_avg.rs:36— src/common/function/src/scalars/vector/elem_avg.rs:36-49 | src/common/function/src/scalars/vector/elem_product.rs:49-62 | src/common/function/src/scalars/vector/elem_sum.rs:36-49 | src/common/function/src/scalars/vector/vector_dim.rs:49-62 | src/common/function/src/scalars/vector/vector_norm.rs:52-65 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
Duplicated block (11–13 lines × 17) src/pipeline/src/etl/processor/cmcd.rs:219— src/pipeline/src/etl/processor/cmcd.rs:219-230 | src/pipeline/src/etl/processor/csv.rs:114-124 | src/pipeline/src/etl/processor/date.rs:101-113 | src/pipeline/src/etl/processor/decolorize.rs:74-85 | src/pipeline/src/etl/processor/digest.rs:136-147 | src/pipeline/src/etl/processor/dissect.rs:564-575 | src/pipeline/src/etl/processor/epoch.rs:143-154 | src/pipeline/src/etl/processor/gsub.rs:74-85 | src/pipeline/src/etl/processor/join.rs:60-71 | src/pipeline/src/etl/processor/json_parse.rs:44-54 | src/pipeline/src/etl/processor/json_path.rs:41-52 | src/pipeline/src/etl/processor/letter.rs:91-101 | src/pipeline/src/etl/processor/regex.rs:96-106 | src/pipeline/src/etl/processor/select.rs:69-79 | src/pipeline/src/etl/processor/simple_extract.rs:48-58 | src/pipeline/src/etl/processor/urlencoding.rs:87-98 | src/pipeline/src/etl/transform.rs:558-570 — before extracting anything, compare `src/pipeline/src/etl/processor/decolorize.rs` and `src/pipeline/src/etl/processor/digest.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 (8–13 lines × 2) src/catalog/src/system_schema/information_schema/region_peers.rs:215— src/catalog/src/system_schema/information_schema/region_peers.rs:215-222 | src/catalog/src/system_schema/information_schema/tables.rs:292-304 — 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 × 11) src/catalog/src/system_schema/information_schema/cluster_info.rs:162— src/catalog/src/system_schema/information_schema/cluster_info.rs:162-172 | src/catalog/src/system_schema/information_schema/columns.rs:183-193 | src/catalog/src/system_schema/information_schema/key_column_usage.rs:171-181 | src/catalog/src/system_schema/information_schema/partitions.rs:190-200 | src/catalog/src/system_schema/information_schema/procedure_info.rs:120-130 | src/catalog/src/system_schema/information_schema/recycle_bin.rs:141-151 | src/catalog/src/system_schema/information_schema/region_peers.rs:128-138 | src/catalog/src/system_schema/information_schema/region_statistics.rs:162-173 | src/catalog/src/system_schema/information_schema/schemata.rs:116-126 | src/catalog/src/system_schema/information_schema/statistics.rs:158-168 | src/catalog/src/system_schema/information_schema/table_constraints.rs:125-135 — 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 11 call sites, so a change lands once.
Duplicated block (11 lines × 5) src/common/meta/src/key/schema_name.rs:283— src/common/meta/src/key/schema_name.rs:283-293 | src/common/meta/src/key/table_info.rs:183-193 | src/common/meta/src/key/table_repart.rs:214-224 | src/common/meta/src/key/table_route.rs:662-672 | src/common/meta/src/key/view_info.rs:182-192 — before extracting anything, compare `src/common/meta/src/key/table_info.rs` and `src/common/meta/src/key/view_info.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 53 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–11 lines × 3) src/meta-srv/src/procedure/region_migration/close_downgraded_region.rs:100— src/meta-srv/src/procedure/region_migration/close_downgraded_region.rs:100-110 | src/meta-srv/src/procedure/region_migration/open_candidate_region.rs:163-172 | src/meta-srv/src/procedure/utils.rs:154-161 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (9–10 lines × 4) src/servers/src/postgres/types.rs:664— src/servers/src/postgres/types.rs:664-672 | src/servers/src/postgres/types.rs:708-717 | src/servers/src/postgres/types.rs:774-783 | src/servers/src/postgres/types.rs:825-834 — 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–9 lines × 3) src/operator/src/delete.rs:146— src/operator/src/delete.rs:146-153 | src/operator/src/insert.rs:824-832 | src/operator/src/request.rs:373-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 all 3 call sites, so a change lands once.
Duplicated block (4–9 lines × 4) src/common/function/src/scalars/geo/measure.rs:68— src/common/function/src/scalars/geo/measure.rs:68-76 | src/common/function/src/scalars/geo/measure.rs:131-139 | src/common/function/src/scalars/ip/range.rs:70-73 | src/common/function/src/scalars/ip/range.rs:158-161 — 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 (4–9 lines × 3) src/common/function/src/scalars/ip/range.rs:83— src/common/function/src/scalars/ip/range.rs:83-91 | src/common/function/src/scalars/ip/range.rs:169-177 | src/common/function/src/scalars/json/json_path_match.rs:74-77 — 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–9 lines × 2) src/common/query/src/native_histogram.rs:1083— src/common/query/src/native_histogram.rs:1083-1088 | src/servers/src/otlp/metrics.rs:893-901 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8 lines × 8) src/table/src/metadata.rs:582— src/table/src/metadata.rs:582-589 | src/table/src/metadata.rs:642-649 | src/table/src/metadata.rs:899-906 | src/table/src/metadata.rs:987-994 | src/table/src/metadata.rs:1164-1171 | src/table/src/metadata.rs:1239-1246 | src/table/src/metadata.rs:1351-1358 | src/table/src/metadata.rs:1394-1401 — 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 (7–8 lines × 3) src/sql/src/parsers/alter_parser/trigger.rs:315— src/sql/src/parsers/alter_parser/trigger.rs:315-322 | src/sql/src/parsers/create_parser/trigger.rs:392-398 | src/sql/src/parsers/create_parser/trigger.rs:433-439 — `src/sql/src/parsers/alter_parser/trigger.rs` and `src/sql/src/parsers/create_parser/trigger.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 45 lines. If both are selected at run time, neither can be retired in favour of the other, and the lines that DIFFER between them are the reason both exist. The move that pays here is to hoist the identical part into a shared location the whole family can reach and give what differs a parameter or a seam, so a change lands once instead of once per sibling; extracting one helper per block leaves every sibling to drift on its own.
Duplicated block (6–7 lines × 5) src/servers/src/postgres/types.rs:622— src/servers/src/postgres/types.rs:622-627 | src/servers/src/postgres/types.rs:663-669 | src/servers/src/postgres/types.rs:707-713 | src/servers/src/postgres/types.rs:773-779 | src/servers/src/postgres/types.rs:824-830 — 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–7 lines × 3) src/query/src/promql/planner.rs:1520— src/query/src/promql/planner.rs:1520-1524 | src/query/src/promql/planner.rs:5928-5934 | src/query/src/promql/planner.rs:6222-6227 — all 3 copies are in the same file, so extract the block into one function there and call it from 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–7 lines × 2) src/cmd/src/bin/query_regression_runner/sql.rs:87— src/cmd/src/bin/query_regression_runner/sql.rs:87-93 | src/cmd/src/bin/query_regression_runner/sql.rs:243-247 — both copies are in the same file, so extract the block into 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) src/query/src/promql/planner.rs:3787— src/query/src/promql/planner.rs:3787-3793 | src/query/src/promql/planner.rs:3797-3802 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (4–6 lines × 3) REDACTED:839— REDACTED:839-844 | REDACTED:858-861 | REDACTED:871-876 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (5 lines × 5) src/pipeline/src/etl/processor/csv.rs:197— src/pipeline/src/etl/processor/csv.rs:197-203 | src/pipeline/src/etl/processor/date.rs:197-203 | src/pipeline/src/etl/processor/dissect.rs:613-617 | src/pipeline/src/etl/processor/letter.rs:129-133 | src/pipeline/src/etl/processor/urlencoding.rs:130-134 — before extracting anything, compare `src/pipeline/src/etl/processor/dissect.rs` and `src/pipeline/src/etl/processor/letter.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 (3–5 lines × 4) src/common/function/src/scalars/geo/measure.rs:77— src/common/function/src/scalars/geo/measure.rs:77-81 | src/common/function/src/scalars/geo/measure.rs:140-144 | src/common/function/src/scalars/geo/s2.rs:95-98 | src/common/function/src/scalars/json/json_path_exists.rs:78-80 — there are 4 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 4 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (3–5 lines × 6) src/common/function/src/scalars/geo/geohash.rs:92— src/common/function/src/scalars/geo/geohash.rs:92-94 | src/common/function/src/scalars/geo/geohash.rs:193-195 | src/common/function/src/scalars/geo/h3.rs:100-102 | src/common/function/src/scalars/geo/h3.rs:191-193 | src/common/function/src/scalars/geo/s2.rs:86-90 | src/common/function/src/scalars/geo/wkt.rs:78-82 — before extracting anything, compare `src/common/function/src/scalars/geo/geohash.rs` and `src/common/function/src/scalars/geo/h3.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 43 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (3–5 lines × 3) src/common/recordbatch/src/filter.rs:470— src/common/recordbatch/src/filter.rs:470-474 | src/mito2/src/compaction/reader.rs:238-240 | src/query/src/promql/label_values.rs:62-66 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times.
Duplicated block (6 lines × 7) src/common/meta/src/ddl/event/database.rs:215— src/common/meta/src/ddl/event/database.rs:215-220 | src/common/meta/src/ddl/event/flow.rs:156-161 | src/common/meta/src/ddl/event/view.rs:210-215 | src/common/meta/src/reconciliation/event.rs:212-217 | src/common/meta/src/reconciliation/event.rs:328-333 | src/common/meta/src/reconciliation/event.rs:442-447 | src/common/meta/src/reconciliation/event.rs:555-560 — there are 7 copies across 4 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 7 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (5 lines × 8) src/common/meta/src/reconciliation/reconcile_catalog.rs:264— src/common/meta/src/reconciliation/reconcile_catalog.rs:264-268 | src/common/meta/src/reconciliation/reconcile_database.rs:316-320 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:319-323 | src/common/meta/src/reconciliation/reconcile_table.rs:416-420 | src/meta-srv/src/handler.rs:92-96 | src/meta-srv/src/procedure/region_migration.rs:782-786 | src/meta-srv/src/procedure/repartition.rs:496-500 | src/meta-srv/src/procedure/repartition/group.rs:609-613 — before extracting anything, compare `src/common/meta/src/reconciliation/reconcile_catalog.rs` and `src/common/meta/src/reconciliation/reconcile_database.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 49 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (13 lines × 4) src/common/function/src/admin/flush_compact_table.rs:55— src/common/function/src/admin/flush_compact_table.rs:55-67 | src/common/function/src/admin/purge_table.rs:42-55 | src/common/function/src/flush_flow.rs:60-72 | src/common/function/src/system/procedure_state.rs:51-63 — before extracting anything, compare `src/common/function/src/admin/flush_compact_table.rs` and `src/common/function/src/admin/purge_table.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 (7 lines × 6) src/common/meta/src/key.rs:799— src/common/meta/src/key.rs:799-805 | src/common/meta/src/key.rs:881-887 | src/common/meta/src/key.rs:1527-1533 | src/common/meta/src/key.rs:1573-1579 | src/common/meta/src/key.rs:1741-1747 | src/common/meta/src/key/schema_name.rs:306-313 — there are 6 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 6 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (2–5 lines × 4) src/cmd/src/bin/query_regression_runner/direct.rs:382— src/cmd/src/bin/query_regression_runner/direct.rs:382-386 | src/cmd/src/bin/query_regression_runner/remote/ingest.rs:282-284 | src/cmd/src/bin/query_regression_runner/remote/read_bench.rs:283-284 | src/cmd/src/bin/query_regression_runner/remote/storage.rs:51-55 — before extracting anything, compare `src/cmd/src/bin/query_regression_runner/remote/ingest.rs` and `src/cmd/src/bin/query_regression_runner/remote/storage.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. If that is what happened, the fix is to keep one copy and have the 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–21 lines × 3) .github/scripts/query-regression-run.py:314— .github/scripts/query-regression-run.py:314-322 | .github/scripts/query-regression-run.py:402-422 | .github/scripts/query-regression-run.py:496-504 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `.github/scripts/query-regression-run.py:495` calls `ValueError` and `.github/scripts/query-regression-run.py:313` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Near-duplicate member pair (60 shared lines) tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:301— tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:301-428 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:287-374 — These two members are variants of one another: 60 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (31 shared lines) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:188— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:188-294 | tests-fuzz/targets/fuzz_insert_logical_table.rs:234-295 — These two members are variants of one another: 31 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 (44 corresponding lines) · ×1
Edited copy of a member (44 corresponding lines) tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:188— tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:188-233 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:331-376 — These two members are one piece of code written twice and then edited apart: 44 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (9 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (9 members, 50+ identical tokens) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:118— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:118-238 | tests-fuzz/targets/ddl/fuzz_alter_table.rs:224-325 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:66-188 | tests-fuzz/targets/ddl/fuzz_create_table.rs:91-121 | tests-fuzz/targets/ddl/fuzz_repartition_table.rs:246-389 | tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:108-120 | tests-fuzz/targets/fuzz_insert_logical_table.rs:139-151 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:107-119 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:251-276 — These 9 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 9 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 9 times.
Duplicated block (31 lines × 2) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:229— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:229-259 | tests-fuzz/targets/failover/fuzz_failover_mito_regions.rs:297-327 — 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–26 lines × 2) tests-integration/src/test_util.rs:1186— tests-integration/src/test_util.rs:1186-1211 | tests-integration/src/test_util.rs:1231-1254 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21–25 lines × 2) tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:317— tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:317-341 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:305-325 — before extracting anything, compare `tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs` and `tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 80 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–22 lines × 2) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:133— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:133-154 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:95-115 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs` and `tests-fuzz/targets/ddl/fuzz_create_logical_table.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–19 lines × 2) tests-fuzz/targets/fuzz_insert.rs:142— tests-fuzz/targets/fuzz_insert.rs:142-160 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:158-174 — before extracting anything, compare `tests-fuzz/targets/fuzz_insert.rs` and `tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 41 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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–18 lines × 2) tests-integration/src/test_util.rs:1082— tests-integration/src/test_util.rs:1082-1099 | tests-integration/src/test_util.rs:1135-1149 — both copies are in the same file, so extract the block into 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–14 lines × 3) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:226— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:226-238 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:175-188 | tests-fuzz/targets/ddl/fuzz_create_table.rs:112-121 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs` and `tests-fuzz/targets/ddl/fuzz_create_logical_table.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (12–13 lines × 5) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:102— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:102-113 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:116-128 | tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:126-137 | tests-fuzz/targets/fuzz_insert_logical_table.rs:104-115 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:125-136 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs` and `tests-fuzz/targets/ddl/fuzz_create_logical_table.rs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 111 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the 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–13 lines × 3) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:282— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:282-294 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:416-428 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:366-374 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs` as WHOLE FILES: this scan already matched 18 separate duplicated blocks between them, totalling at least 205 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–11 lines × 3) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:201— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:201-211 | tests-fuzz/targets/fuzz_insert_logical_table.rs:248-258 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:208-216 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/fuzz_insert_logical_table.rs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 93 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (10 lines × 4) tests-fuzz/src/translator/mysql/alter_expr.rs:90— tests-fuzz/src/translator/mysql/alter_expr.rs:90-99 | tests-fuzz/src/translator/mysql/create_expr.rs:62-71 | tests-fuzz/src/translator/postgres/alter_expr.rs:76-85 | tests-fuzz/src/translator/postgres/create_expr.rs:58-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 4 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 4 times.
Duplicated block (9–10 lines × 3) tests-fuzz/targets/ddl/fuzz_alter_table.rs:83— tests-fuzz/targets/ddl/fuzz_alter_table.rs:83-91 | tests-fuzz/targets/ddl/fuzz_create_table.rs:72-81 | tests-fuzz/targets/fuzz_insert.rs:89-98 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_create_table.rs` and `tests-fuzz/targets/fuzz_insert.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (2–9 lines × 4) src/common/meta/src/kv_backend/test.rs:559— src/common/meta/src/kv_backend/test.rs:559-560 | src/common/meta/src/kv_backend/test.rs:589-597 | src/common/meta/src/kv_backend/test.rs:628-630 | src/common/meta/src/kv_backend/test.rs:669-677 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (3–8 lines × 5) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:190— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:190-197 | tests-fuzz/targets/ddl/fuzz_alter_table.rs:268-275 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:142-145 | tests-fuzz/targets/ddl/fuzz_create_table.rs:105-107 | tests-fuzz/targets/unstable/fuzz_create_table_standalone.rs:204-206 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs` and `tests-fuzz/targets/ddl/fuzz_alter_table.rs` as WHOLE FILES: this scan already matched 5 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 (6 lines × 6) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:124— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:124-129 | tests-fuzz/targets/ddl/fuzz_alter_table.rs:230-235 | tests-fuzz/targets/ddl/fuzz_repartition_table.rs:251-256 | tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:111-116 | tests-fuzz/targets/fuzz_insert_logical_table.rs:142-147 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:110-115 — before extracting anything, compare `tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs` and `tests-fuzz/targets/ddl/fuzz_alter_table.rs` as WHOLE FILES: this scan already matched 5 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.
End-of-life runtime: Rust 1.96 — rust-toolchain.toml declares Rust 1.96 as this project's toolchain file, and Rust 1.96, superseded by 1.97 on 2026-07-09 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2026-07-09 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 50 significant file(s) lose their only recent owner: src/common/meta/src/reconciliation/utils.rs, src/partition/src/utils/split.rs, src/meta-srv/src/procedure/repartition/repartition_start.rs, src/meta-srv/src/procedure/repartition/plan.rs, src/meta-srv/src/event/repartition.rs, src/meta-srv/src/procedure/repartition/group.rs, tests-fuzz/targets/ddl/fuzz_repartition_metric_table.rs, src/meta-srv/src/procedure/region_migration/open_candidate_region.rs (+42 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 26 significant file(s) lose their only recent owner: src/flow/src/batching_mode/task/test.rs, src/flow/src/batching_mode/utils/test.rs, src/flow/src/batching_mode/task.rs, src/flow/src/batching_mode/utils.rs, src/query/src/dist_plan/remote_dyn_filter_registry.rs, src/flow/src/batching_mode/time_window.rs, src/datanode/src/region_server/remote_dyn_filter.rs, src/query/src/dist_plan/analyzer/utils.rs (+18 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 16 significant file(s) lose their only recent owner: src/cli/src/data/export_v2/command.rs, src/cli/src/data/snapshot_storage.rs, src/cli/src/data/import_v2/coordinator.rs, src/cli/src/data/export_v2/tests.rs, src/cli/src/data/import_v2/command.rs, src/common/datasource/src/parquet_writer.rs, src/cli/src/data/export_v2/manifest.rs, src/cli/src/data/export_v2/coordinator.rs (+8 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 8 significant file(s) lose their only recent owner: src/operator/src/statement/semantic_graph/relationships.rs, src/operator/src/statement/semantic_graph.rs, src/catalog/src/system_schema/semantic_graph.rs, src/catalog/src/system_schema/information_schema/statistics.rs, src/servers/src/semantic.rs, src/common/function/src/scalars/json/json_object.rs, src/cmd/src/user.rs, scripts/check-enterprise-license.py. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 8 significant file(s) lose their only recent owner: src/common/function/src/uddsketch_compat.rs, src/mito2/src/compaction/scheduler/state.rs, src/catalog/src/system_schema/information_schema/recycle_bin.rs, src/mito2/src/compaction/picker.rs, src/common/function/src/scalars/uddsketch_rank.rs, src/common/grpc/src/flight/do_put.rs, src/common/meta/src/ddl/drop_table/metadata.rs, src/common/telemetry/src/panic_hook.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #6 — If anonymized user #6 becomes unavailable, 7 significant file(s) lose their only recent owner: src/mito2/src/read/series_candidate.rs, src/cmd/src/datanode/parquet_rewrite.rs, src/cmd/src/datanode/parquet_meta.rs, src/cmd/src/datanode/sst_replace.rs, src/cmd/src/datanode/tool_util.rs, src/mito2/src/batch_size.rs, src/mito2/src/series_index.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #7 — If anonymized user #7 becomes unavailable, 5 significant file(s) lose their only recent owner: src/common/query/src/native_histogram/encoding.rs, src/servers/src/otlp/metrics/translator.rs, src/servers/src/otel_arrow.rs, src/common/query/src/promql_annotations.rs, src/pipeline/src/etl/processor/simple_extract.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #8 — If anonymized user #8 becomes unavailable, 5 significant file(s) lose their only recent owner: src/datatypes/src/vectors/json/variant.rs, src/common/function/src/scalars/json/json_is.rs, src/common/function/src/scalars/json/json_path_match.rs, src/common/function/src/scalars/json/parse_json.rs, src/common/function/src/scalars/vector/elem_sum.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #9 — If anonymized user #9 becomes unavailable, 4 significant file(s) lose their only recent owner: src/mito2/src/engine/region_hook.rs, src/common/recordbatch/src/cursor.rs, src/common/telemetry/src/tracing_context.rs, src/datatypes/src/extension/histogram.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #10 — If anonymized user #10 becomes unavailable, 4 significant file(s) lose their only recent owner: src/common/function/src/scalars/primary_key.rs, src/promql/src/range_array.rs, src/query/src/optimizer/promql_tsid_narrow_join.rs, src/file-engine/src/manifest.rs. Pair on, review, or document these before any departure.
Documentation: no project overview README.md— The opening paragraph describes GreptimeDB as 'one engine on your infrastructure' without explaining what the project does beyond its dual-license layout or linking to the user guide. Expand the overview to state what the project is for (metrics, logs, traces) and how it differs from alternatives, then link to the user guide.
Documentation: contradicts the code docs/how-to/memory-profile-scripts/scripts/README.md— The jeprof tool script and the gen_flamegraph.sh example are shown but the referenced greptimedb source commit is older than the current one; the MALLOC_CONF=prof:true env var may no longer work. Verify that the jeprof binary matches the currently built greptimedb version.
Documentation: contradicts the code src/servers/src/prom_remote_write/README.md— The Remote Write V2 diagram and its two ContextReq/conversion steps are shown but the remote-write_v2 path in http/prom_store.rs has changed. Confirm that the diagram reflects the current remote-write_v2 module.
Duplicated predicate .agents/skills/greptimedb-development-docker-image/scripts/image_config.py:37— `end < 0 or text[end + 1 :].strip() and not text[end + 1 :].lstrip().startswith("#")` appears character-identically in 2 files — .agents/skills/greptimedb-development-docker-image/scripts/image_config.py, .claude/skills/greptimedb-development-docker-image/scripts/image_config.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate .agents/skills/greptimedb-development-docker-image/scripts/binary_platform.py:44— `len(header) != 64 or header[:4] != b"\x7fELF"` appears character-identically in 2 files — .agents/skills/greptimedb-development-docker-image/scripts/binary_platform.py, .claude/skills/greptimedb-development-docker-image/scripts/binary_platform.py. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Subsumed condition operand src/query/src/dist_plan/analyzer/test.rs:2787— `remote_section.contains("1700000000000000000")` can never decide this `||` — every value satisfying `remote_section.contains("1700000000000000000")` also satisfies `remote_section.contains("1700000000000")`, so the `||` chain is already decided by the latter. The expression is equivalent to the chain without it, which means it is wider than it reads. Delete the dead operand, or narrow the surviving one if IT is the accident.
Subsumed condition operand src/common/function/src/scalars/ip/cidr.rs:365— `str_addr.starts_with("2001:db8::")` can never decide this `||` — every value satisfying `str_addr.starts_with("2001:db8::")` also satisfies `str_addr.starts_with("2001:db8:")`, 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.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 5 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (139 single-owned of 1584 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; 1584 of the 1965 production source files in this repository met that bar). They are anonymized user #11 (2 file(s)), anonymized user #12 (1 file(s)), anonymized user #13 (1 file(s)), anonymized user #14 (1 file(s)), anonymized user #15 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 11 of 71 project(s) overshoot their size bounds, lowering Project Cohesion to 6.9/10. The most over is `src/mito2` (132449 LoC, 406 public types across 26 directories). Review these for cohesion — draw the boundary inside the module first (group each responsibility into its own package or directory and keep the cross-boundary members non-public), since splitting a published package moves types between packages and breaks consumers.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 70 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: src/common/decimal/src/decimal128.rs, src/index/src/inverted_index/search/fst_apply/intersection_apply.rs, src/index/src/fulltext_index/create/tantivy.rs, src/puffin/src/blob_metadata.rs, src/index/src/inverted_index/search/fst_apply/keys_apply.rs, src/index/src/inverted_index/format/writer/blob.rs, src/common/stat/src/cgroups.rs, src/common/base/src/range_read.rs (and 62 more) (71 orphaned of 1584 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; 1584 of the 1965 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D40 · Network Egress Confinement· No network policy · ×1
No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
No seccomp profile — Workloads do not set a seccomp profile (RuntimeDefault or a Localhost profile). Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
No AppArmor/SELinux confinement — Workloads declare no AppArmor or SELinux profile. A mandatory-access-control profile confines what a compromised container can touch on the host, complementing seccomp's syscall filter.
No release approval gate — Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
No changelog — No CHANGELOG/HISTORY/RELEASES file — what shipped when isn't easy to reconstruct for support or audit. (Versioning/tagging makes releases traceable, but a changelog records the what.)
Outdated: anyhow — `anyhow` is locked at 1.0.102 but 1.0.104 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in src/common/mem-prof/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p anyhow` and commit the updated REDACTED.
Outdated: arbitrary — `arbitrary` is locked at 1.4.1 but 1.4.2 is the current stable release on crates.io, and it already satisfies the `"1.3.0"` requirement declared in tests-fuzz/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p arbitrary` and commit the updated REDACTED.
Outdated: arc-swap — `arc-swap` is locked at 1.7.1 but 1.9.2 is the current stable release on crates.io, and it already satisfies the `"1.6"` requirement declared in src/client/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p arc-swap` and commit the updated REDACTED.
Outdated: async-compression — `async-compression` is locked at 0.4.41 but 0.4.49 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in src/puffin/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-compression` and commit the updated REDACTED.
Outdated: async-walkdir — `async-walkdir` is locked at 2.1.0 but 2.2.0 is the current stable release on crates.io, and it already satisfies the `"2.0.0"` requirement declared in src/puffin/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-walkdir` and commit the updated REDACTED.
Outdated: backtrace — `backtrace` is locked at 0.3.75 but 0.3.76 is the current stable release on crates.io, and it already satisfies the `"0.3"` requirement declared in src/common/telemetry/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p backtrace` and commit the updated REDACTED.
Outdated: bitvec — `bitvec` is locked at 1.0.1 but 1.1.1 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in src/common/base/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bitvec` and commit the updated REDACTED.
Outdated: crc32fast — `crc32fast` is locked at 1.4.2 but 1.5.2 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in src/mito2/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crc32fast` and commit the updated REDACTED.
Outdated: csv — `csv` is locked at 1.3.1 but 1.4.0 is the current stable release on crates.io, and it already satisfies the `"1.3"` requirement declared in src/pipeline/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p csv` and commit the updated REDACTED.
Outdated: delta-encoding — `delta-encoding` is locked at 0.4.8 but 0.4.10 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in src/log-store/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p delta-encoding` and commit the updated REDACTED.
Outdated: flatbuffers — `flatbuffers` is locked at 25.2.10 but 25.12.19 is the current stable release on crates.io, and it already satisfies the `"25.2"` requirement declared in src/common/grpc/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flatbuffers` and commit the updated REDACTED.
Outdated: flate2 — `flate2` is locked at 1.1.9 but 1.1.10 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in tests/runner/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flate2` and commit the updated REDACTED.
Outdated: flexbuffers — `flexbuffers` is locked at 25.2.10 but 25.12.19 is the current stable release on crates.io, and it already satisfies the `"25.2"` requirement declared in src/common/meta/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p flexbuffers` and commit the updated REDACTED.
Outdated: geo-types — `geo-types` is locked at 0.7.16 but 0.7.20 is the current stable release on crates.io, and it already satisfies the `"0.7"` requirement declared in src/common/function/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p geo-types` and commit the updated REDACTED.
Outdated: geohash — `geohash` is locked at 0.13.1 but 0.13.2 is the current stable release on crates.io, and it already satisfies the `"0.13"` requirement declared in src/common/function/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p geohash` and commit the updated REDACTED.
Outdated: headers — `headers` is locked at 0.4.1 but 0.4.2 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in src/servers/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p headers` and commit the updated REDACTED.
Outdated: http-body — `http-body` is locked at 1.0.1 but 1.1.0 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in src/servers/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p http-body` and commit the updated REDACTED.
Outdated: human-panic — `human-panic` is locked at 2.0.2 but 2.0.8 is the current stable release on crates.io, and it already satisfies the `"2.0"` requirement declared in src/cmd/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p human-panic` and commit the updated REDACTED.
Outdated: iso8601 — `iso8601` is locked at 0.6.3 but 0.6.6 is the current stable release on crates.io, and it already satisfies the `"0.6.1"` requirement declared in src/sql/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p iso8601` and commit the updated REDACTED.
Outdated: libfuzzer-sys — `libfuzzer-sys` is locked at 0.4.9 but 0.4.13 is the current stable release on crates.io, and it already satisfies the `"0.4"` requirement declared in tests-fuzz/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p libfuzzer-sys` and commit the updated REDACTED.
Outdated: local-ip-address — `local-ip-address` is locked at 0.6.5 but 0.6.13 is the current stable release on crates.io, and it already satisfies the `"0.6"` requirement declared in tests/runner/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p local-ip-address` and commit the updated REDACTED.
Outdated: num_enum — `num_enum` is locked at 0.7.4 but 0.7.6 is the current stable release on crates.io, and it already satisfies the `"0.7"` requirement declared in src/store-api/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p num_enum` and commit the updated REDACTED.
Outdated: opendal — `opendal` is locked at 0.59.2 but 0.59.3 is the current stable release on crates.io, and it already satisfies the `"0.59.2"` requirement declared in src/object-store/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p opendal` and commit the updated REDACTED.
Outdated: opendal-http-transport-reqwest — `opendal-http-transport-reqwest` is locked at 0.59.2 but 0.59.3 is the current stable release on crates.io, and it already satisfies the `"0.59.2"` requirement declared in src/object-store/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p opendal-http-transport-reqwest` and commit the updated REDACTED.
Outdated: pgwire — `pgwire` is locked at 0.41.0 but 0.41.1 is the current stable release on crates.io, and it already satisfies the `"0.41"` requirement declared in src/servers/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p pgwire` and commit the updated REDACTED.
+ 14 more in this group — see findings.md.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 1 file(s) — `.github/scripts/query-regression-comment.cjs` — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
Run 01a0edff-d613-7a8a-b83c-b8cda7313caf · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 492 · Warnings: 2178 · Recommendations: 43 · Info: 39 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 29-09-2026 @ 16:29 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.