Public report of GreptimeTeam/greptimedb, published 27 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Assert signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 27 October 2026, 17:30 UTC · Survey ID cd_fa369e75095b44e69226889d2c50e767
GreptimeTeam/greptimedb
Measured 27 October 2026, 17:23 UTC, at code version 62ebf71
Regression: 1 dimension fell since the last survey
A regression is a drop of 0.5 points or more in the score, or of 2.5 or more out of 10 in a dimension, since the last survey.
CAI scoreAdequate
CriticalWeakAdequateStrongExemplary
No change since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A very large codebase: 848,341 lines of product code in 69 projects, tests not counted · Estimated rebuild effort: about 7.5 person-years · Weakest lens: Code Health, 55
Findings by how serious they are
515 critical2274 serious345 minor
10 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
27 October 2026, 17:23 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
78of 78 dimensions measured by tools.
3001of 3134 findings point to an exact file and line, so you can open each one in the code. The other 133 concern the repository as a whole, such as missing documentation.
78dimensions across 8 lenses, read from 848,341 lines of product code in 69 projects.
GreptimeTeam/greptimedb falls short of our standard for production, held back most by its Code Health lens, the quality of the code itself. It scores 62 out of 100 and is rated Adequate, and 476 of its 515 critical findings are security problems.
Code Health, at 55, is the weakest lens and counts most in the score. The best first step for the work it takes is fixing the password or key in the code, worth about 3 points. Turning on missing-value checks would lift Code Health itself, worth about 5 points. Raising Code Health to 70 would lift the score to about 67.
340 pipeline tools are referenced by a changeable name, so the build pipeline can be tampered with. Forty-three settings leave the servers or containers unsafe, and thirty-four secrets can leak from the build pipeline. Pinning each tool to an exact version, correcting the unsafe settings and limiting each secret to its own step would close these risks. Passing outside input through environment variables would fix the 32 pipeline steps that put outside input straight into a shell command, and fixing the weaknesses the scanner points to would deal with the 12 security weaknesses in the code. The 31 sets of files in separate parts that keep changing together need that dependency made explicit.
The product code is 848,341 lines, about €1,100,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Code Health rose from 55 to 70, the lowest score rated Strong, the score would rise from 62 to about 67.
Code composition: what the lines of code are
Product code 87%Tests 13%
New since the last survey: 238 findings
These 238 critical or serious findings weren't in the previous survey, on 13 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
Code Duplication · Members sharing a duplicated core (5 members, 50+ identical tokens) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 137 findings
These 137 critical or serious findings were in the previous survey, on 13 October 2026, and are gone from this one. The first 100 are listed here.
€360,000 to €1,800,000, for 6,000 to 19,034 hours of work, about 7.5 person-years for 4 to 15 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.9 at a score of 62. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Very large: 848,341 lines of product code
What it is not
Not a quotation: nobody has offered to build it for that. Not a valuation: it says nothing about what the business is worth. Not a certified figure: no professional has signed it as one.
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty. For this code, every line is priced as straight logic, which keeps the estimate on the low side.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED.
The findings name the configuration each number was taken from and, for the assertions, the files that hold them.
Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Each conclusion below combines several dimensions into one point that no single dimension shows, and lists the measurements it rests on.
Where the investment is most exposed · Value at risk
This code would cost about €1,100,000 to build again, about 7.5 person-years of work. Its weakest lens is Code Health, at 55 (Adequate). Code Health is about how easy the code is to read and change safely, and code that is hard to read is slow and risky to change, so every future change costs more than it should. Because the weakest lens counts most in the score, work on Code Health also moves the score most.
Based on: the rebuild estimate · the Code Health grade · how much each lens counts
What to do: Start with the Code Health actions in Top priorities.
If you do one thing first · First action
Resolve the 1 Leaked secret finding(s) in REDACTED Scanning. Of all the actions in this report, it raises the score most for the work it takes: about 3 points for low effort, because it clears the 1 REDACTED Scanning findings. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
Architecture — module dependency graph
Project dependencies, layered top-to-bottom; arrows show direction. Any dashed red edge points upward or sideways, which only happens where the projects form a dependency cycle. A graph without cycles has none.
Architecture: which parts of the code depend on which
The code is divided into modules, groups of code that each handle one part of the product, and a module depends on another when it uses code from it. The table lists the modules both down the side and across the top, in an order where each module should only use modules listed above it. A number in a cell means the module on that row uses the module in that column, and it counts the pairs of building blocks (types) that connect them. The one thing to look for is a mark above the diagonal line. It means two or more modules use each other in a loop (a dependency cycle), so none of them can be changed, tested or released on its own.
1648 modules, with 5073 dependencies between them. 13 loops run through 335 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 1608 more are left out to keep it readable.
Which modules use which. The module on each row uses the module in each column, and the number counts the pairs of types that connect them. A cell above the diagonal is part of a loop.
common_base.bytes uses datatypes.value, so a change to datatypes.value can break common_base.bytes, while a change to common_base.bytes can't break datatypes.value.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
common_error.ext uses common_error.status_code, so a change to common_error.status_code can break common_error.ext, while a change to common_error.ext can't break common_error.status_code.
Position
Below the diagonal: common_error.ext uses a module listed above it, which is the healthy direction.
8→11 common_error.ext uses api.errorpart of a loop✕
Connections
4 pairs of types, where a type in common_error.ext uses a type in api.error.
The types involved
common_error.ext.BoxedError → api.error.Error
common_error.ext.PlainError → api.error.Error
common_error.ext.StackError → api.error.Error
common_error.ext.ext$module → api.error.Error
Direction
common_error.ext uses api.error, so a change to api.error can break common_error.ext, while a change to common_error.ext can't break api.error.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
common_meta.snapshot uses common_meta.rpc, so a change to common_meta.rpc can break common_meta.snapshot, while a change to common_meta.snapshot can't break common_meta.rpc.
Position
Below the diagonal: common_meta.snapshot uses a module listed above it, which is the healthy direction.
10→12 datatypes.data_type uses datatypes.valuepart of a loop✕
Connections
1 pair of types, where a type in datatypes.data_type uses a type in datatypes.value.
datatypes.data_type uses datatypes.value, so a change to datatypes.value can break datatypes.data_type, while a change to datatypes.data_type can't break datatypes.value.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→14 datatypes.data_type uses common_time.timestamppart of a loop✕
Connections
1 pair of types, where a type in datatypes.data_type uses a type in common_time.timestamp.
datatypes.data_type uses common_time.timestamp, so a change to common_time.timestamp can break datatypes.data_type, while a change to datatypes.data_type can't break common_time.timestamp.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
api.error uses common_error.status_code, so a change to common_error.status_code can break api.error, while a change to api.error can't break common_error.status_code.
Position
Below the diagonal: api.error uses a module listed above it, which is the healthy direction.
datatypes.value uses common_base.bytes, so a change to common_base.bytes can break datatypes.value, while a change to datatypes.value can't break common_base.bytes.
Position
Below the diagonal: datatypes.value uses a module listed above it, which is the healthy direction.
datatypes.value uses datatypes.data_type, so a change to datatypes.data_type can break datatypes.value, while a change to datatypes.value can't break datatypes.data_type.
Position
Below the diagonal: datatypes.value uses a module listed above it, which is the healthy direction.
12→14 datatypes.value uses common_time.timestamppart of a loop✕
Connections
4 pairs of types, where a type in datatypes.value uses a type in common_time.timestamp.
datatypes.value uses common_time.timestamp, so a change to common_time.timestamp can break datatypes.value, while a change to datatypes.value can't break common_time.timestamp.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
12→15 datatypes.value uses common_time.durationpart of a loop✕
Connections
2 pairs of types, where a type in datatypes.value uses a type in common_time.duration.
datatypes.value uses common_time.duration, so a change to common_time.duration can break datatypes.value, while a change to datatypes.value can't break common_time.duration.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
cmd.bin.query_regression_runner.model uses datatypes.value, so a change to datatypes.value can break cmd.bin.query_regression_runner.model, while a change to cmd.bin.query_regression_runner.model can't break datatypes.value.
Position
Below the diagonal: cmd.bin.query_regression_runner.model uses a module listed above it, which is the healthy direction.
common_time.timestamp uses datatypes.value, so a change to datatypes.value can break common_time.timestamp, while a change to common_time.timestamp can't break datatypes.value.
Position
Below the diagonal: common_time.timestamp uses a module listed above it, which is the healthy direction.
14→15 common_time.timestamp uses common_time.durationpart of a loop✕
Connections
1 pair of types, where a type in common_time.timestamp uses a type in common_time.duration.
common_time.timestamp uses common_time.duration, so a change to common_time.duration can break common_time.timestamp, while a change to common_time.timestamp can't break common_time.duration.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
common_time.duration uses datatypes.value, so a change to datatypes.value can break common_time.duration, while a change to common_time.duration can't break datatypes.value.
Position
Below the diagonal: common_time.duration uses a module listed above it, which is the healthy direction.
common_time.duration uses common_time.timestamp, so a change to common_time.timestamp can break common_time.duration, while a change to common_time.duration can't break common_time.timestamp.
Position
Below the diagonal: common_time.duration uses a module listed above it, which is the healthy direction.
pipeline.etl.transform.transformer.greptime uses datatypes.data_type, so a change to datatypes.data_type can break pipeline.etl.transform.transformer.greptime, while a change to pipeline.etl.transform.transformer.greptime can't break datatypes.data_type.
Position
Below the diagonal: pipeline.etl.transform.transformer.greptime uses a module listed above it, which is the healthy direction.
pipeline.etl.transform.transformer.greptime uses datatypes.value, so a change to datatypes.value can break pipeline.etl.transform.transformer.greptime, while a change to pipeline.etl.transform.transformer.greptime can't break datatypes.value.
Position
Below the diagonal: pipeline.etl.transform.transformer.greptime uses a module listed above it, which is the healthy direction.
pipeline.etl.transform.transformer.greptime uses cmd.bin.query_regression_runner.model, so a change to cmd.bin.query_regression_runner.model can break pipeline.etl.transform.transformer.greptime, while a change to pipeline.etl.transform.transformer.greptime can't break cmd.bin.query_regression_runner.model.
Position
Below the diagonal: pipeline.etl.transform.transformer.greptime uses a module listed above it, which is the healthy direction.
16→18 pipeline.etl.transform.transformer.greptime uses datatypes.schema.column_schemapart of a loop✕
Connections
3 pairs of types, where a type in pipeline.etl.transform.transformer.greptime uses a type in datatypes.schema.column_schema.
pipeline.etl.transform.transformer.greptime uses datatypes.schema.column_schema, so a change to datatypes.schema.column_schema can break pipeline.etl.transform.transformer.greptime, while a change to pipeline.etl.transform.transformer.greptime can't break datatypes.schema.column_schema.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
client.inserter uses common_time.duration, so a change to common_time.duration can break client.inserter, while a change to client.inserter can't break common_time.duration.
Position
Below the diagonal: client.inserter uses a module listed above it, which is the healthy direction.
datatypes.schema.column_schema uses datatypes.data_type, so a change to datatypes.data_type can break datatypes.schema.column_schema, while a change to datatypes.schema.column_schema can't break datatypes.data_type.
Position
Below the diagonal: datatypes.schema.column_schema uses a module listed above it, which is the healthy direction.
datatypes.schema.column_schema uses pipeline.etl.transform.transformer.greptime, so a change to pipeline.etl.transform.transformer.greptime can break datatypes.schema.column_schema, while a change to datatypes.schema.column_schema can't break pipeline.etl.transform.transformer.greptime.
Position
Below the diagonal: datatypes.schema.column_schema uses a module listed above it, which is the healthy direction.
common_procedure.procedure uses api.error, so a change to api.error can break common_procedure.procedure, while a change to common_procedure.procedure can't break api.error.
Position
Below the diagonal: common_procedure.procedure uses a module listed above it, which is the healthy direction.
common_procedure.procedure uses client.inserter, so a change to client.inserter can break common_procedure.procedure, while a change to common_procedure.procedure can't break client.inserter.
Position
Below the diagonal: common_procedure.procedure uses a module listed above it, which is the healthy direction.
common_recordbatch uses common_recordbatch.recordbatch, so a change to common_recordbatch.recordbatch can break common_recordbatch, while a change to common_recordbatch can't break common_recordbatch.recordbatch.
Position
Below the diagonal: common_recordbatch uses a module listed above it, which is the healthy direction.
common_recordbatch uses datatypes.data_type, so a change to datatypes.data_type can break common_recordbatch, while a change to common_recordbatch can't break datatypes.data_type.
Position
Below the diagonal: common_recordbatch uses a module listed above it, which is the healthy direction.
common_recordbatch uses client.inserter, so a change to client.inserter can break common_recordbatch, while a change to common_recordbatch can't break client.inserter.
Position
Below the diagonal: common_recordbatch uses a module listed above it, which is the healthy direction.
store_api.storage.descriptors uses datatypes.data_type, so a change to datatypes.data_type can break store_api.storage.descriptors, while a change to store_api.storage.descriptors can't break datatypes.data_type.
Position
Below the diagonal: store_api.storage.descriptors uses a module listed above it, which is the healthy direction.
store_api.storage.descriptors uses datatypes.schema.column_schema, so a change to datatypes.schema.column_schema can break store_api.storage.descriptors, while a change to store_api.storage.descriptors can't break datatypes.schema.column_schema.
Position
Below the diagonal: store_api.storage.descriptors uses a module listed above it, which is the healthy direction.
common_grpc.flow_write uses common_error.status_code, so a change to common_error.status_code can break common_grpc.flow_write, while a change to common_grpc.flow_write can't break common_error.status_code.
Position
Below the diagonal: common_grpc.flow_write uses a module listed above it, which is the healthy direction.
common_grpc.flow_write uses common_error.ext, so a change to common_error.ext can break common_grpc.flow_write, while a change to common_grpc.flow_write can't break common_error.ext.
Position
Below the diagonal: common_grpc.flow_write uses a module listed above it, which is the healthy direction.
common_grpc.flow_write uses api.error, so a change to api.error can break common_grpc.flow_write, while a change to common_grpc.flow_write can't break api.error.
Position
Below the diagonal: common_grpc.flow_write uses a module listed above it, which is the healthy direction.
common_grpc.flow_write uses common_recordbatch, so a change to common_recordbatch can break common_grpc.flow_write, while a change to common_grpc.flow_write can't break common_recordbatch.
Position
Below the diagonal: common_grpc.flow_write uses a module listed above it, which is the healthy direction.
store_api.metadata uses common_error.status_code, so a change to common_error.status_code can break store_api.metadata, while a change to store_api.metadata can't break common_error.status_code.
Position
Below the diagonal: store_api.metadata uses a module listed above it, which is the healthy direction.
store_api.metadata uses common_error.ext, so a change to common_error.ext can break store_api.metadata, while a change to store_api.metadata can't break common_error.ext.
Position
Below the diagonal: store_api.metadata uses a module listed above it, which is the healthy direction.
store_api.metadata uses pipeline.etl.transform.transformer.greptime, so a change to pipeline.etl.transform.transformer.greptime can break store_api.metadata, while a change to store_api.metadata can't break pipeline.etl.transform.transformer.greptime.
Position
Below the diagonal: store_api.metadata uses a module listed above it, which is the healthy direction.
store_api.metadata uses datatypes.schema.column_schema, so a change to datatypes.schema.column_schema can break store_api.metadata, while a change to store_api.metadata can't break datatypes.schema.column_schema.
Position
Below the diagonal: store_api.metadata uses a module listed above it, which is the healthy direction.
store_api.metadata uses store_api.storage.descriptors, so a change to store_api.storage.descriptors can break store_api.metadata, while a change to store_api.metadata can't break store_api.storage.descriptors.
Position
Below the diagonal: store_api.metadata uses a module listed above it, which is the healthy direction.
23→27 store_api.metadata uses store_api.region_requestpart of a loop✕
Connections
4 pairs of types, where a type in store_api.metadata uses a type in store_api.region_request.
store_api.metadata uses store_api.region_request, so a change to store_api.region_request can break store_api.metadata, while a change to store_api.metadata can't break store_api.region_request.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
store_api.storage.file uses api.error, so a change to api.error can break store_api.storage.file, while a change to store_api.storage.file can't break api.error.
Position
Below the diagonal: store_api.storage.file uses a module listed above it, which is the healthy direction.
store_api.storage.file uses store_api.storage.descriptors, so a change to store_api.storage.descriptors can break store_api.storage.file, while a change to store_api.storage.file can't break store_api.storage.descriptors.
Position
Below the diagonal: store_api.storage.file uses a module listed above it, which is the healthy direction.
store_api.storage.requests uses common_recordbatch, so a change to common_recordbatch can break store_api.storage.requests, while a change to store_api.storage.requests can't break common_recordbatch.
Position
Below the diagonal: store_api.storage.requests uses a module listed above it, which is the healthy direction.
servers.http uses common_recordbatch.recordbatch, so a change to common_recordbatch.recordbatch can break servers.http, while a change to servers.http can't break common_recordbatch.recordbatch.
Position
Below the diagonal: servers.http uses a module listed above it, which is the healthy direction.
servers.http uses common_time.timestamp, so a change to common_time.timestamp can break servers.http, while a change to servers.http can't break common_time.timestamp.
Position
Below the diagonal: servers.http uses a module listed above it, which is the healthy direction.
servers.http uses common_time.duration, so a change to common_time.duration can break servers.http, while a change to servers.http can't break common_time.duration.
Position
Below the diagonal: servers.http uses a module listed above it, which is the healthy direction.
servers.http uses datatypes.schema.column_schema, so a change to datatypes.schema.column_schema can break servers.http, while a change to servers.http can't break datatypes.schema.column_schema.
Position
Below the diagonal: servers.http uses a module listed above it, which is the healthy direction.
servers.http uses common_grpc.flow_write, so a change to common_grpc.flow_write can break servers.http, while a change to servers.http can't break common_grpc.flow_write.
Position
Below the diagonal: servers.http uses a module listed above it, which is the healthy direction.
store_api.region_request uses datatypes.data_type, so a change to datatypes.data_type can break store_api.region_request, while a change to store_api.region_request can't break datatypes.data_type.
Position
Below the diagonal: store_api.region_request uses a module listed above it, which is the healthy direction.
store_api.region_request uses pipeline.etl.transform.transformer.greptime, so a change to pipeline.etl.transform.transformer.greptime can break store_api.region_request, while a change to store_api.region_request can't break pipeline.etl.transform.transformer.greptime.
Position
Below the diagonal: store_api.region_request uses a module listed above it, which is the healthy direction.
store_api.region_request uses store_api.storage.descriptors, so a change to store_api.storage.descriptors can break store_api.region_request, while a change to store_api.region_request can't break store_api.storage.descriptors.
Position
Below the diagonal: store_api.region_request uses a module listed above it, which is the healthy direction.
store_api.region_request uses store_api.metadata, so a change to store_api.metadata can break store_api.region_request, while a change to store_api.region_request can't break store_api.metadata.
Position
Below the diagonal: store_api.region_request uses a module listed above it, which is the healthy direction.
27→32 store_api.region_request uses mito2.requestpart of a loop✕
Connections
2 pairs of types, where a type in store_api.region_request uses a type in mito2.request.
store_api.region_request uses mito2.request, so a change to mito2.request can break store_api.region_request, while a change to store_api.region_request can't break mito2.request.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
27→35 store_api.region_request uses common_meta.instructionpart of a loop✕
Connections
1 pair of types, where a type in store_api.region_request uses a type in common_meta.instruction.
store_api.region_request uses common_meta.instruction, so a change to common_meta.instruction can break store_api.region_request, while a change to store_api.region_request can't break common_meta.instruction.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
meta_srv.metasrv uses common_time.duration, so a change to common_time.duration can break meta_srv.metasrv, while a change to meta_srv.metasrv can't break common_time.duration.
Position
Below the diagonal: meta_srv.metasrv uses a module listed above it, which is the healthy direction.
meta_srv.metasrv uses client.inserter, so a change to client.inserter can break meta_srv.metasrv, while a change to meta_srv.metasrv can't break client.inserter.
Position
Below the diagonal: meta_srv.metasrv uses a module listed above it, which is the healthy direction.
meta_srv.metasrv uses common_procedure.procedure, so a change to common_procedure.procedure can break meta_srv.metasrv, while a change to meta_srv.metasrv can't break common_procedure.procedure.
Position
Below the diagonal: meta_srv.metasrv uses a module listed above it, which is the healthy direction.
meta_srv.metasrv uses store_api.storage.descriptors, so a change to store_api.storage.descriptors can break meta_srv.metasrv, while a change to meta_srv.metasrv can't break store_api.storage.descriptors.
Position
Below the diagonal: meta_srv.metasrv uses a module listed above it, which is the healthy direction.
meta_srv.metasrv uses servers.http, so a change to servers.http can break meta_srv.metasrv, while a change to meta_srv.metasrv can't break servers.http.
Position
Below the diagonal: meta_srv.metasrv uses a module listed above it, which is the healthy direction.
mito2.sst.file uses common_base.bytes, so a change to common_base.bytes can break mito2.sst.file, while a change to mito2.sst.file can't break common_base.bytes.
Position
Below the diagonal: mito2.sst.file uses a module listed above it, which is the healthy direction.
mito2.sst.file uses store_api.storage.descriptors, so a change to store_api.storage.descriptors can break mito2.sst.file, while a change to mito2.sst.file can't break store_api.storage.descriptors.
Position
Below the diagonal: mito2.sst.file uses a module listed above it, which is the healthy direction.
mito2.sst.file uses store_api.storage.file, so a change to store_api.storage.file can break mito2.sst.file, while a change to mito2.sst.file can't break store_api.storage.file.
Position
Below the diagonal: mito2.sst.file uses a module listed above it, which is the healthy direction.
mito2.sst.file uses store_api.region_request, so a change to store_api.region_request can break mito2.sst.file, while a change to mito2.sst.file can't break store_api.region_request.
Position
Below the diagonal: mito2.sst.file uses a module listed above it, which is the healthy direction.
table.metadata uses datatypes.schema.column_schema, so a change to datatypes.schema.column_schema can break table.metadata, while a change to table.metadata can't break datatypes.schema.column_schema.
Position
Below the diagonal: table.metadata uses a module listed above it, which is the healthy direction.
table.metadata uses store_api.region_request, so a change to store_api.region_request can break table.metadata, while a change to table.metadata can't break store_api.region_request.
Position
Below the diagonal: table.metadata uses a module listed above it, which is the healthy direction.
common_meta.key uses common_meta.rpc, so a change to common_meta.rpc can break common_meta.key, while a change to common_meta.key can't break common_meta.rpc.
Position
Below the diagonal: common_meta.key uses a module listed above it, which is the healthy direction.
common_meta.key uses table.table_name, so a change to table.table_name can break common_meta.key, while a change to common_meta.key can't break table.table_name.
Position
Below the diagonal: common_meta.key uses a module listed above it, which is the healthy direction.
common_meta.key uses common_base.bytes, so a change to common_base.bytes can break common_meta.key, while a change to common_meta.key can't break common_base.bytes.
Position
Below the diagonal: common_meta.key uses a module listed above it, which is the healthy direction.
common_meta.key uses table.metadata, so a change to table.metadata can break common_meta.key, while a change to common_meta.key can't break table.metadata.
Position
Below the diagonal: common_meta.key uses a module listed above it, which is the healthy direction.
mito2.request uses common_recordbatch.recordbatch, so a change to common_recordbatch.recordbatch can break mito2.request, while a change to mito2.request can't break common_recordbatch.recordbatch.
Position
Below the diagonal: mito2.request uses a module listed above it, which is the healthy direction.
mito2.request uses datatypes.value, so a change to datatypes.value can break mito2.request, while a change to mito2.request can't break datatypes.value.
Position
Below the diagonal: mito2.request uses a module listed above it, which is the healthy direction.
mito2.request uses pipeline.etl.transform.transformer.greptime, so a change to pipeline.etl.transform.transformer.greptime can break mito2.request, while a change to mito2.request can't break pipeline.etl.transform.transformer.greptime.
Position
Below the diagonal: mito2.request uses a module listed above it, which is the healthy direction.
mito2.request uses datatypes.schema.column_schema, so a change to datatypes.schema.column_schema can break mito2.request, while a change to mito2.request can't break datatypes.schema.column_schema.
Position
Below the diagonal: mito2.request uses a module listed above it, which is the healthy direction.
mito2.request uses store_api.storage.descriptors, so a change to store_api.storage.descriptors can break mito2.request, while a change to mito2.request can't break store_api.storage.descriptors.
Position
Below the diagonal: mito2.request uses a module listed above it, which is the healthy direction.
mito2.request uses store_api.metadata, so a change to store_api.metadata can break mito2.request, while a change to mito2.request can't break store_api.metadata.
Position
Below the diagonal: mito2.request uses a module listed above it, which is the healthy direction.
mito2.request uses store_api.storage.file, so a change to store_api.storage.file can break mito2.request, while a change to mito2.request can't break store_api.storage.file.
Position
Below the diagonal: mito2.request uses a module listed above it, which is the healthy direction.
mito2.request uses store_api.region_request, so a change to store_api.region_request can break mito2.request, while a change to mito2.request can't break store_api.region_request.
Position
Below the diagonal: mito2.request uses a module listed above it, which is the healthy direction.
mito2.request uses store_api.region_engine, so a change to store_api.region_engine can break mito2.request, while a change to mito2.request can't break store_api.region_engine.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
32→35 mito2.request uses common_meta.instructionpart of a loop✕
Connections
1 pair of types, where a type in mito2.request uses a type in common_meta.instruction.
mito2.request uses common_meta.instruction, so a change to common_meta.instruction can break mito2.request, while a change to mito2.request can't break common_meta.instruction.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
mito2.sst.parquet.reader uses common_time.duration, so a change to common_time.duration can break mito2.sst.parquet.reader, while a change to mito2.sst.parquet.reader can't break common_time.duration.
Position
Below the diagonal: mito2.sst.parquet.reader uses a module listed above it, which is the healthy direction.
mito2.sst.parquet.reader uses pipeline.etl.transform.transformer.greptime, so a change to pipeline.etl.transform.transformer.greptime can break mito2.sst.parquet.reader, while a change to mito2.sst.parquet.reader can't break pipeline.etl.transform.transformer.greptime.
Position
Below the diagonal: mito2.sst.parquet.reader uses a module listed above it, which is the healthy direction.
mito2.sst.parquet.reader uses common_recordbatch, so a change to common_recordbatch can break mito2.sst.parquet.reader, while a change to mito2.sst.parquet.reader can't break common_recordbatch.
Position
Below the diagonal: mito2.sst.parquet.reader uses a module listed above it, which is the healthy direction.
mito2.sst.parquet.reader uses store_api.metadata, so a change to store_api.metadata can break mito2.sst.parquet.reader, while a change to mito2.sst.parquet.reader can't break store_api.metadata.
Position
Below the diagonal: mito2.sst.parquet.reader uses a module listed above it, which is the healthy direction.
mito2.sst.parquet.reader uses store_api.storage.file, so a change to store_api.storage.file can break mito2.sst.parquet.reader, while a change to mito2.sst.parquet.reader can't break store_api.storage.file.
Position
Below the diagonal: mito2.sst.parquet.reader uses a module listed above it, which is the healthy direction.
mito2.sst.parquet.reader uses store_api.region_request, so a change to store_api.region_request can break mito2.sst.parquet.reader, while a change to mito2.sst.parquet.reader can't break store_api.region_request.
Position
Below the diagonal: mito2.sst.parquet.reader uses a module listed above it, which is the healthy direction.
mito2.sst.parquet.reader uses mito2.sst.file, so a change to mito2.sst.file can break mito2.sst.parquet.reader, while a change to mito2.sst.parquet.reader can't break mito2.sst.file.
Position
Below the diagonal: mito2.sst.parquet.reader uses a module listed above it, which is the healthy direction.
store_api.region_engine uses common_error.ext, so a change to common_error.ext can break store_api.region_engine, while a change to store_api.region_engine can't break common_error.ext.
Position
Below the diagonal: store_api.region_engine uses a module listed above it, which is the healthy direction.
store_api.region_engine uses common_time.timestamp, so a change to common_time.timestamp can break store_api.region_engine, while a change to store_api.region_engine can't break common_time.timestamp.
Position
Below the diagonal: store_api.region_engine uses a module listed above it, which is the healthy direction.
store_api.region_engine uses common_recordbatch, so a change to common_recordbatch can break store_api.region_engine, while a change to store_api.region_engine can't break common_recordbatch.
Position
Below the diagonal: store_api.region_engine uses a module listed above it, which is the healthy direction.
store_api.region_engine uses store_api.storage.descriptors, so a change to store_api.storage.descriptors can break store_api.region_engine, while a change to store_api.region_engine can't break store_api.storage.descriptors.
Position
Below the diagonal: store_api.region_engine uses a module listed above it, which is the healthy direction.
store_api.region_engine uses store_api.storage.file, so a change to store_api.storage.file can break store_api.region_engine, while a change to store_api.region_engine can't break store_api.storage.file.
Position
Below the diagonal: store_api.region_engine uses a module listed above it, which is the healthy direction.
store_api.region_engine uses store_api.storage.requests, so a change to store_api.storage.requests can break store_api.region_engine, while a change to store_api.region_engine can't break store_api.storage.requests.
Position
Below the diagonal: store_api.region_engine uses a module listed above it, which is the healthy direction.
store_api.region_engine uses store_api.region_request, so a change to store_api.region_request can break store_api.region_engine, while a change to store_api.region_engine can't break store_api.region_request.
Position
Below the diagonal: store_api.region_engine uses a module listed above it, which is the healthy direction.
store_api.region_engine uses mito2.request, so a change to mito2.request can break store_api.region_engine, while a change to store_api.region_engine can't break mito2.request.
Position
Below the diagonal: store_api.region_engine uses a module listed above it, which is the healthy direction.
common_meta.instruction uses common_error.status_code, so a change to common_error.status_code can break common_meta.instruction, while a change to common_meta.instruction can't break common_error.status_code.
Position
Below the diagonal: common_meta.instruction uses a module listed above it, which is the healthy direction.
common_meta.instruction uses common_error.ext, so a change to common_error.ext can break common_meta.instruction, while a change to common_meta.instruction can't break common_error.ext.
Position
Below the diagonal: common_meta.instruction uses a module listed above it, which is the healthy direction.
common_meta.instruction uses common_time.duration, so a change to common_time.duration can break common_meta.instruction, while a change to common_meta.instruction can't break common_time.duration.
Position
Below the diagonal: common_meta.instruction uses a module listed above it, which is the healthy direction.
common_meta.instruction uses store_api.storage.descriptors, so a change to store_api.storage.descriptors can break common_meta.instruction, while a change to common_meta.instruction can't break store_api.storage.descriptors.
Position
Below the diagonal: common_meta.instruction uses a module listed above it, which is the healthy direction.
common_meta.instruction uses store_api.storage.file, so a change to store_api.storage.file can break common_meta.instruction, while a change to common_meta.instruction can't break store_api.storage.file.
Position
Below the diagonal: common_meta.instruction uses a module listed above it, which is the healthy direction.
common_meta.instruction uses store_api.region_request, so a change to store_api.region_request can break common_meta.instruction, while a change to common_meta.instruction can't break store_api.region_request.
Position
Below the diagonal: common_meta.instruction uses a module listed above it, which is the healthy direction.
common_meta.instruction uses store_api.region_engine, so a change to store_api.region_engine can break common_meta.instruction, while a change to common_meta.instruction can't break store_api.region_engine.
Position
Below the diagonal: common_meta.instruction uses a module listed above it, which is the healthy direction.
datanode.region_server uses common_error.status_code, so a change to common_error.status_code can break datanode.region_server, while a change to datanode.region_server can't break common_error.status_code.
Position
Below the diagonal: datanode.region_server uses a module listed above it, which is the healthy direction.
datanode.region_server uses api.error, so a change to api.error can break datanode.region_server, while a change to datanode.region_server can't break api.error.
Position
Below the diagonal: datanode.region_server uses a module listed above it, which is the healthy direction.
datanode.region_server uses common_time.duration, so a change to common_time.duration can break datanode.region_server, while a change to datanode.region_server can't break common_time.duration.
Position
Below the diagonal: datanode.region_server uses a module listed above it, which is the healthy direction.
datanode.region_server uses client.inserter, so a change to client.inserter can break datanode.region_server, while a change to datanode.region_server can't break client.inserter.
Position
Below the diagonal: datanode.region_server uses a module listed above it, which is the healthy direction.
datanode.region_server uses common_recordbatch, so a change to common_recordbatch can break datanode.region_server, while a change to datanode.region_server can't break common_recordbatch.
Position
Below the diagonal: datanode.region_server uses a module listed above it, which is the healthy direction.
datanode.region_server uses store_api.storage.descriptors, so a change to store_api.storage.descriptors can break datanode.region_server, while a change to datanode.region_server can't break store_api.storage.descriptors.
Position
Below the diagonal: datanode.region_server uses a module listed above it, which is the healthy direction.
datanode.region_server uses common_grpc.flow_write, so a change to common_grpc.flow_write can break datanode.region_server, while a change to datanode.region_server can't break common_grpc.flow_write.
Position
Below the diagonal: datanode.region_server uses a module listed above it, which is the healthy direction.
datanode.region_server uses store_api.region_request, so a change to store_api.region_request can break datanode.region_server, while a change to datanode.region_server can't break store_api.region_request.
Position
Below the diagonal: datanode.region_server uses a module listed above it, which is the healthy direction.
datanode.region_server uses mito2.request, so a change to mito2.request can break datanode.region_server, while a change to datanode.region_server can't break mito2.request.
Position
Below the diagonal: datanode.region_server uses a module listed above it, which is the healthy direction.
datanode.region_server uses store_api.region_engine, so a change to store_api.region_engine can break datanode.region_server, while a change to datanode.region_server can't break store_api.region_engine.
Position
Below the diagonal: datanode.region_server uses a module listed above it, which is the healthy direction.
common_meta.rpc.ddl uses table.table_name, so a change to table.table_name can break common_meta.rpc.ddl, while a change to common_meta.rpc.ddl can't break table.table_name.
Position
Below the diagonal: common_meta.rpc.ddl uses a module listed above it, which is the healthy direction.
common_meta.rpc.ddl uses common_time.duration, so a change to common_time.duration can break common_meta.rpc.ddl, while a change to common_meta.rpc.ddl can't break common_time.duration.
Position
Below the diagonal: common_meta.rpc.ddl uses a module listed above it, which is the healthy direction.
common_meta.rpc.ddl uses table.metadata, so a change to table.metadata can break common_meta.rpc.ddl, while a change to common_meta.rpc.ddl can't break table.metadata.
Position
Below the diagonal: common_meta.rpc.ddl uses a module listed above it, which is the healthy direction.
common_meta.rpc.ddl uses common_meta.instruction, so a change to common_meta.instruction can break common_meta.rpc.ddl, while a change to common_meta.rpc.ddl can't break common_meta.instruction.
Position
Below the diagonal: common_meta.rpc.ddl uses a module listed above it, which is the healthy direction.
mito2.worker uses common_time.duration, so a change to common_time.duration can break mito2.worker, while a change to mito2.worker can't break common_time.duration.
Position
Below the diagonal: mito2.worker uses a module listed above it, which is the healthy direction.
mito2.worker uses store_api.storage.descriptors, so a change to store_api.storage.descriptors can break mito2.worker, while a change to mito2.worker can't break store_api.storage.descriptors.
Position
Below the diagonal: mito2.worker uses a module listed above it, which is the healthy direction.
mito2.worker uses store_api.storage.file, so a change to store_api.storage.file can break mito2.worker, while a change to mito2.worker can't break store_api.storage.file.
Position
Below the diagonal: mito2.worker uses a module listed above it, which is the healthy direction.
mito2.worker uses store_api.region_request, so a change to store_api.region_request can break mito2.worker, while a change to mito2.worker can't break store_api.region_request.
Position
Below the diagonal: mito2.worker uses a module listed above it, which is the healthy direction.
27 pairs of types, where a type in mito2.worker uses a type in mito2.request. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
mito2.worker uses store_api.region_engine, so a change to store_api.region_engine can break mito2.worker, while a change to mito2.worker can't break store_api.region_engine.
Position
Below the diagonal: mito2.worker uses a module listed above it, which is the healthy direction.
mito2.worker uses common_meta.instruction, so a change to common_meta.instruction can break mito2.worker, while a change to mito2.worker can't break common_meta.instruction.
Position
Below the diagonal: mito2.worker uses a module listed above it, which is the healthy direction.
mito2.worker uses datanode.region_server, so a change to datanode.region_server can break mito2.worker, while a change to mito2.worker can't break datanode.region_server.
Position
Below the diagonal: mito2.worker uses a module listed above it, which is the healthy direction.
operator.statement uses table.table_name, so a change to table.table_name can break operator.statement, while a change to operator.statement can't break table.table_name.
Position
Below the diagonal: operator.statement uses a module listed above it, which is the healthy direction.
operator.statement uses client.inserter, so a change to client.inserter can break operator.statement, while a change to operator.statement can't break client.inserter.
Position
Below the diagonal: operator.statement uses a module listed above it, which is the healthy direction.
operator.statement uses table.metadata, so a change to table.metadata can break operator.statement, while a change to operator.statement can't break table.metadata.
Position
Below the diagonal: operator.statement uses a module listed above it, which is the healthy direction.
operator.statement uses common_meta.instruction, so a change to common_meta.instruction can break operator.statement, while a change to operator.statement can't break common_meta.instruction.
Position
Below the diagonal: operator.statement uses a module listed above it, which is the healthy direction.
operator.statement uses common_meta.rpc.ddl, so a change to common_meta.rpc.ddl can break operator.statement, while a change to operator.statement can't break common_meta.rpc.ddl.
Position
Below the diagonal: operator.statement uses a module listed above it, which is the healthy direction.
frontend.instance uses common_error.status_code, so a change to common_error.status_code can break frontend.instance, while a change to frontend.instance can't break common_error.status_code.
Position
Below the diagonal: frontend.instance uses a module listed above it, which is the healthy direction.
frontend.instance uses cmd.bin.query_regression_runner.model, so a change to cmd.bin.query_regression_runner.model can break frontend.instance, while a change to frontend.instance can't break cmd.bin.query_regression_runner.model.
Position
Below the diagonal: frontend.instance uses a module listed above it, which is the healthy direction.
frontend.instance uses common_time.duration, so a change to common_time.duration can break frontend.instance, while a change to frontend.instance can't break common_time.duration.
Position
Below the diagonal: frontend.instance uses a module listed above it, which is the healthy direction.
frontend.instance uses pipeline.etl.transform.transformer.greptime, so a change to pipeline.etl.transform.transformer.greptime can break frontend.instance, while a change to frontend.instance can't break pipeline.etl.transform.transformer.greptime.
Position
Below the diagonal: frontend.instance uses a module listed above it, which is the healthy direction.
frontend.instance uses common_grpc.flow_write, so a change to common_grpc.flow_write can break frontend.instance, while a change to frontend.instance can't break common_grpc.flow_write.
Position
Below the diagonal: frontend.instance uses a module listed above it, which is the healthy direction.
frontend.instance uses table.metadata, so a change to table.metadata can break frontend.instance, while a change to frontend.instance can't break table.metadata.
Position
Below the diagonal: frontend.instance uses a module listed above it, which is the healthy direction.
frontend.instance uses common_meta.rpc.ddl, so a change to common_meta.rpc.ddl can break frontend.instance, while a change to frontend.instance can't break common_meta.rpc.ddl.
Position
Below the diagonal: frontend.instance uses a module listed above it, which is the healthy direction.
frontend.instance uses operator.statement, so a change to operator.statement can break frontend.instance, while a change to frontend.instance can't break operator.statement.
Position
Below the diagonal: frontend.instance uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 55% · Adequate · gated by X4, X5 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A05:2025 — Injection
434
High / Critical
A03:2025 — Software Supply Chain Failures
94
High / Critical
A02:2025 — Security Misconfiguration
82
High / Critical
A07:2025 — Authentication Failures
3
High / Critical
Roadmap
First, enable strict null checking in the base TypeScript configuration and resolve existing assertions to prevent runtime errors. Next, address the nearly one thousand instances of unstructured logging to ensure consistent data parsing. Then, immediately remediate the single leaked secret in the action file and remove the yanked dependency release. Finally, codify backup and geo-recovery strategies in infrastructure as code to fully support the disaster recovery plan.
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.
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
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.
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 2 sites, not one: `src/auth/src/common.rs:511` (`Sha1::new`), `src/auth/src/common.rs:518` (`Sha1::new`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
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 — 515
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 — 2274
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 — 345
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 10
Something this survey could not settle
from the outside, and which could be critical or serious. Either a control was required and no
positive evidence of it exists in the repository — a backup job that nothing shows was ever restored from proves
nothing about restores — or our own analysis could not run over that part of the tree. This is not a clean
result. These are excluded from the score rather than awarded a pass, so the number on the cover neither
rewards nor penalises them: if you act on this survey without resolving them, you carry that risk yourself. Each
one is named under Limitations.
Methodology & how to trust this report
Watchdog is a deep, periodic assessment — run each sprint, monthly, or quarterly, taking the time to go wider and deeper than a quick check and surfacing in one coherent report what you'd otherwise piece together from a dozen separate tools. It scores deterministically: the same commit yields the same score, every run. 78 of 78 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); none rely on LLM judgement. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 78 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, 3001 of 3134 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 (.rs, .py, .ts), so the analyzer could not read the number — a gap in the analyzer's language coverage, not an unmeasured repo. Not scored. To have the real number read, produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or `coverage run -m pytest` then `coverage xml`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures. You can widen what we reach: optional: produce a coverage report in a standard format (lcov — `cargo install cargo-llvm-cov`, then `cargo llvm-cov --lcov --output-path lcov.info`, or `coverage run -m pytest` then `coverage xml`, or lcov — `vitest --coverage`, `jest --coverage`, `bun test --coverage --coverage-reporter=lcov`, or `nyc`) and commit it — a hosted scan measures a clone of the repository, so a report that exists only in a working tree, a CI runner's or your own, never reaches it; the artefact is commonly gitignored, so `git add -f` that one file (or un-ignore its path) and commit it alongside the code it measures — then the real number is read on the next scan.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 4 test(s) behind this row are the ones the JavaScript/TypeScript census could read, and this repository also carries at least 213 test source file(s) (.rs, .py) that it cannot: it reads JavaScript/TypeScript test declarations off disk, so a JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test source is present (.rs, .py, .ts) and this repository declares a Cargo test suite (repository root, 1309 test files), but it was not re-run: its build outgrew the 7 GB scratch ceiling (7.007 GB measured) and was stopped; its suite was not run. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its crate dependencies. Nothing was read about its npm dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D21 Naming Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D21's deterministic naming rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. Until then its declarations carry no naming verdict this run — this says nothing about whether its names are consistent.
D22 Internal API Consistency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. D22's deterministic call-shape rules are gated on C# first (docs/plans/deterministic-engine.md, P5): each other language is switched on only after its own concept suite and A/B gate pass. This says nothing about whether that surface is consistent.
D24 Comment Value — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check's reader does not cover the language this repository's product is written in, so it had nothing of the product to read. That is a gap in this analyzer's language reach — not a finding about this repository.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `.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.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (tests-integration/fixtures/docker-compose.yml). compose up failed (exit 18 — an image could not be pulled) — etcd Error Get "https://registry-1.docker.io/v2/": Forbidden mysql Error Get "https://registry-1.docker.io/v2/": Forbidden postgres Error context canceled postgres15 Error context canceled minio Error context canceled etcd-tls Error context canceled zookeeper Error context canceled kafka Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: mysql Error Get "https://registry-1.docker.io/v2/": Forbidden zookeeper Error Get "https://registry-1.docker.io/v2/": Forbidden minio Error Get "https://registry-1.docker.io/v2/": Forbidden kafka Error context canceled etcd Error context canceled postgres15 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.
GD1 Unfinished & placeholder code — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, F#, JavaScript/TypeScript, Dart, Ruby and Scala source only, and this repository's Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
IC1 Incompleteness & stubs — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check reads C# syntax, JavaScript/TypeScript, Java, Dart, Ruby and Scala source only, and this repository's Python, Rust is most of its product and is not read yet, so it had nothing of this repository's product to read. That is a gap in this analyzer's language reach — not a finding that the repository is free of what this check looks for.
M4 Documentation accuracy — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. M4 checks only the claim kinds adjudicated at or above 95 % precision: links and versions (PREREGISTRATION version 9). Paths, command arguments, installs, environment variables, settings, projects, packages, routes, cd targets, infrastructure products and removed modules are read but not checked, and none of them is reported or counted.
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.
X4 Structured logging — 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. 948 further occurrence(s) are not listed individually; the score already reflects all 988.
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 publishes two things only: a runnable or packaged unit with no example, and a multi-project root README that maps none of its parts. It does not judge clarity, and its other checks (overview, licence, boilerplate, structure, empty sections, XML-doc coverage) are withheld after adjudication: their candidates are counted in the card's gaps, not shown as rows. A false statement in a document is M4's; units are .NET projects only.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D26 Project Cohesion: Project focus is sized from members/namespaces per project — a project that is broad by deliberate design reads the same as one that has sprawled.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
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.
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.
158 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was servers::postgres::types::parameters_to_scalar_values at 131. A further 80 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 76 — they are counted neither in the figure above nor in this dimension's score. 40 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 76), 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::information_table at 45), src/meta-srv/src/error.rs (Error::status_code at 42), and 35 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.
+ 88 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 6 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with servers::postgres::types::parameters_to_scalar_values (cyclomatic 131), PromPlanner::create_function_expr (cyclomatic 106), operator::req_convert::common::push_column_to_rows (cyclomatic 94). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 6 together lifts Cyclomatic Complexity from 5.7 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 196 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 5 bodies over 120 down to 120 or less in Cognitive Complexity — start with servers::postgres::types::parameters_to_scalar_values (cognitive 205), operator::req_convert::common::push_column_to_rows (cognitive 187), servers::otlp::metrics::prepare::prepare_metrics (cognitive 172). — This score is capped by its worst body, so a finding fixed alone moves it by almost nothing — the next one down takes its place. Refactoring these 5 together lifts Cognitive Complexity from 5.3 to about 5.8/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.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 136 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 (136 warning-level).
Resolve the 93 MethodTooLong finding(s) in God Classes — start with planner.rs (9), error.rs (6), task.rs (4). — One of this dimension's main actionable groups (93 warning-level).
Resolve the 49 ClassTooLong finding(s) in God Classes — start with error.rs (8), planner.rs (2), store.rs (2). — One of this dimension's main actionable groups (49 warning-level).
Enforce God Classes in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d3_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Copy-pasted code that should be shared instead.
Method: Code duplication via token-stream sliding windows with type-aware normalization (locals masked, type names preserved), density-scored per KLoC of production code. Deterministic.
705 duplicated block group(s) detected. A further 32 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 96 of the 737 are in trees this repository does not ship — vendored, example/demo, project-template, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 154 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 46 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with authorize.rs (3), table_repart.rs (2), uddsketch.rs. — One of this dimension's main actionable groups (46 warning-level).
Resolve the 46 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with planner.rs (4), binary.rs (4), format.rs (2). — One of this dimension's main actionable groups (46 warning-level).
Resolve the 45 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with REDACTED (2), alter_parser.rs (2), fuzz_failover_metric_regions.rs (2). — One of this dimension's main actionable groups (45 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · 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, declare types in source no model reads, or have no source directory of their own).
Off the main sequence: api · ×2
Unstable project cli
Unstable project common-grpc-expr
Unstable project datanode
Unstable project flow
+ 11 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 2 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (2 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).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 12 Low cohesion finding(s) in Cohesion (LCOM4) — start with test_util.rs, state.rs, cache.rs. — One of this dimension's main actionable groups (12 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.
No mechanizable ADR was identified, so enforcement is not measured. Dependency cycles not checked (no project-reference graph; where this repository's language has an import-cycle lens, cycles are reported there).
Resolve the 28 Classify ADR enforcement finding(s) in Architectural Integrity — start with rfc.md, 2023-01-03-procedure-framework.md, 2023-02-01-table-compaction.md. — One of this dimension's main actionable groups (28 recommendation-level).
Enforce Architectural Integrity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d7_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D9 · Test Distribution10.0 / 10Exemplary✓ Tool-verified
What it measures: Whether the test suite has a healthy mix of unit / integration / end-to-end tests.
Method: Test projects classified (Unit/Integration/BDD/E2E) from compiled metadata; test methods counted exhaustively across projects with placement-agnostic disk fallback. Deterministic.
9642 test methods: 9289 unit, 353 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 9462 `#[test]` function(s) across 1309 file(s) declaring at least one; its unit/integration split is Cargo's own — 62 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 176 test function(s) across 12 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 213 test source file(s) (.rs, .py) 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.
82 outdated, 1 yanked direct Cargo dependencies. 244 of 247 direct crates were graded against crates.io (0 not published there, 3 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 · ×82
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 1298 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 57 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 (32×106=3392); src/frontend/src/instance.rs (30×48=1440); src/operator/src/insert.rs (26×48=1248) Repeated repair below the complexity floor: src/mito2/src/compaction/twcs.rs (8 of 13 changes were fixes); src/mito2/src/region_write_ctx.rs (7 of 11 changes were fixes); src/servers/src/prom_store.rs (6 of 11 changes were fixes)
Resolve the 68 Hotspot finding(s) in Churn × Complexity Hotspots — start with error.rs (8), statement.rs (2), engine.rs (2). — One of this dimension's main actionable groups (68 warning-level).
Resolve the 12 Repeated repair finding(s) in Churn × Complexity Hotspots — start with twcs.rs, region_write_ctx.rs, prom_store.rs. — One of this dimension's main actionable groups (12 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.0 / 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.
163 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is src/log-store/src/object_store_wal/store.rs. Counted over 1634 of the 2013 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 · ×9
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.
407 deducted task-comment markers across 848341 LoC (0.0/KLoC) → score 9.9. Task comments only: this repository's language is read without a compiler, so D17's suppression, dead-code and commented-out-code arms did not run and this score counts fewer marker kinds than a .NET repository's would.
Resolve the 389 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 (389 warning-level).
Resolve the 13 FixmeComment finding(s) in Explicit Debt — start with datanode_table.rs (2), fuzz_create_table_standalone.rs, ir.rs. — One of this dimension's main actionable groups (13 warning-level).
Resolve the 5 HackComment finding(s) in Explicit Debt — start with region.rs, region_server.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: Every README, docs/ document and root guide parsed by its markup and measured in Unicode letters. Published: a runnable or packaged .NET project whose README (or a document it links, or a root guide) shows no example, and a root README naming none of three or more projects. Overview, licence, boilerplate, wall-of-text, empty-section and XML-doc rows are measured and withheld (counted in gaps) after adjudication. Deterministic, exhaustive, advisory.
1 of 1 documentation facets pass in full. 45 document(s) read across 1 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality6.4 / 10Adequate✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
11 of 28 evaluated ADRs have a defect readable from the log itself (a missing or empty section, no title, a single option, consequences with no cost, no status, a missing enforcement field, a status the log contradicts, a dangling link, an unlinked second decision on one question). How well each record argues its case is not measured.
ADR has no Decision and Consequences section · ×9docs/rfcs/2022-12-20-promql-in-rust/rfc.md:11detected by adr-integrity
ADR considers only one optiondocs/rfcs/2023-05-09-distributed-planner.md:133detected by adr-integrity
ADR has no Decision sectiondocs/rfcs/2025-07-23-global-gc-worker.md:8detected by adr-integrity
What to do
Resolve the 9 ADR has no Decision and Consequences section finding(s) in ADR Quality — start with rfc.md, 2023-01-03-procedure-framework.md, 2023-12-22-enclose-column-id.md. — One of this dimension's main actionable groups (9 recommendation-level).
Resolve the 1 ADR considers only one option finding(s) in ADR Quality — start with 2023-05-09-distributed-planner.md. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 ADR has no Decision section finding(s) in ADR Quality — start with 2025-07-23-global-gc-worker.md. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
10 of 69 build units (Cargo, npm) flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
What to do
Resolve the 1 Projects may be oversized for their cohesion finding(s) in Project Cohesion. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
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).
434 finding(s): 0 critical, 426 high, 8 medium, 0 low. 299 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 13 file(s) — `.github/scripts/find-previous-workflow-artifact.sh` (line 137, line 141, line 158), `.github/scripts/oswal-s3-bench-run.sh` (lines 108–487), `.github/scripts/query-regression-comment.cjs` (line 52), `REDACTED` (line 28), `scripts/check-builder-rust-version.sh` (line 57), … (+8 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 299 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 (339 issue-level, 40 of them charged here).
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).
Resolve the 28 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (4), REDACTED (4), REDACTED (4). — One of this dimension's main actionable groups (28 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 21 Medium advisory (unsound) finding(s) in Dependency Vulnerabilities — start with REDACTED (21). — One of this dimension's main actionable groups (21 warning-level).
Resolve the 17 Medium advisory (unmaintained) finding(s) in Dependency Vulnerabilities — start with REDACTED (17). — One of this dimension's main actionable groups (17 warning-level).
Resolve the 5 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (5 issue-level).
Detailed fixes: d30_recommendation.md · top locations in Appendix A, every location in findings.md.
Resolve the 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.
111 of 1634 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 1634 of the 2013 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 3 Orphaned knowledge finding(s) in Knowledge Freshness — start with bitmap.rs, builder.rs, rds.rs. — One of this dimension's main actionable groups (3 issue-level).
Resolve the 108 Orphaned file finding(s) in Knowledge Freshness — start with error.rs (7), REDACTED (4), blob.rs (2). — One of this dimension's main actionable groups (108 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 31 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 (31 issue-level).
Resolve the 30 Change coupling finding(s) in Change Coupling — start with reader.rs (2), export.rs, csv.rs. — One of this dimension's main actionable groups (30 warning-level).
Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with unordered_scan.rs, metrics.rs. — One of this dimension's main actionable groups (2 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
+ 6 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 7 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (7 warning-level).
Resolve the 6 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — 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.
0/1 workload(s) run every container under a seccomp profile; 0/1 declare an AppArmor/SELinux profile.
No seccomp profileREDACTED:2
What to do
Resolve the 1 No seccomp profile finding(s) in Kernel & Syscall Confinement — start with REDACTED. — 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.
0 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.
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.
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
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:484
`DrainDatanodeProcedureTask` 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/meta-srv/src/procedure/drain_datanode.rs:74
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
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add 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.
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, Swift, Dart) or inside a Java method returning a Reactor Mono/Flux or a Scala method returning a Future or effect — and, for a .NET library with ≥5 awaits, the share of awaits using ConfigureAwait(false). Deterministic, syntax/text detection.
Other · Security — Read from this repository's Rust source: cryptographic hygiene (weak hash or cipher, key material fixed in the source) and outbound TLS (certificate validation, protocol version) — facts about code that hold whether or not it serves anything itself. This repository serves HTTP itself (`axum::serve(` (src/servers/src/http.rs:1680)), so its Rust source was also read for the server controls: TLS served or HSTS set, security response headers, cookie flags and inbound validation — each credited where its Rust spelling appears in production source, not proven on every route. A Rocket 0.5 application is credited the headers Rocket's default `Shield` sends unless it attaches its own, and its cookie jar's SameSite=Strict default; a session middleware its default cookie flags.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call. (×2) — src/auth/src/common.rs:511, src/auth/src/common.rs:518
None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (src/servers/src/http.rs:1680).
What to do
Review each MD5/SHA1 use by what it protects: replace it with SHA-256+ (or a KDF for passwords) where the digest is security-relevant, and switch it to a non-cryptographic hash (xxhash, murmurhash) where it only derives an identifier such as a cache key. This repository constructs a collision-broken hash (MD5/SHA1) at 2 sites, not one: `src/auth/src/common.rs:511` (`Sha1::new`), `src/auth/src/common.rs:518` (`Sha1::new`). Each is a separate decision — fixing only the line this row cites leaves the others in place.
Set security response headers on what the server sends — actix-web's `DefaultHeaders::new().add((header::X_CONTENT_TYPE_OPTIONS, "nosniff"))`, tower-http's `SetResponseHeaderLayer::overriding(…)` on an axum router, or keep Rocket's default `Shield` — with `Content-Security-Policy`, `X-Content-Type-Options` and a frame policy on every response.
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Other · Code Health — Whether any branch is dead by construction — a switch arm whose label can never equal a case-normalised subject, or an `else if` whose predicate the arm above has already swallowed.
Method: Roslyn syntax + semantics: switch labels compared against the subject's own case normaliser, and if/else-if chains checked for a literal an earlier arm's containment test already swallows. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X13 · Undrained process stream10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a child process that has BOTH standard streams redirected drains both — reading one to the end while the other is never read deadlocks once the child fills the unread pipe.
Method: Roslyn syntax + semantics: ProcessStartInfo launches with both streams redirected, checked for a drain of each stream across the enclosing type. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `spawn` imported from `child_process` whose stdout and stderr are both pipes (no options, no `stdio`, or `stdio` of `'pipe'`), bound to a local that never leaves its scope, where exactly one of the two streams is read, the other never, and the child’s `close`/`exit` (or the read stream’s end) is awaited; a shell redirect in the call’s arguments or a `kill` of the child suppresses it. The same rule reads Python’s `subprocess.Popen`, Dart’s `Process.start`, Ruby’s `Open3.popen3`, and Scala’s JDK process starts (`new ProcessBuilder(…).start()` with no `redirectErrorStream`/`redirectError`/`redirectOutput`/`inheritIO`, `Runtime.getRuntime.exec`) where one of `getInputStream`/`getErrorStream` is read and the other never while `waitFor()` is called or the read stream is read to its end. Deterministic, provable per finding. Advisory.
Other · Security — Whether a hand-rolled public/private IP check can be walked past — a method that unwraps IPv4-mapped IPv6 but returns the opposite verdict for the same host written as IPv4-compatible, 6to4 or NAT64.
Method: Roslyn syntax + semantics: methods that unwrap IPv4-mapped IPv6 and hand-roll IPv4 range carve-outs, checked for whether the IPv6 branch also accounts for the IPv4-compatible, 6to4 and NAT64 embeddings. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X15 · Unvalidated length from an untrusted reader10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a length read out of the stream being parsed is bounded before it is allocated or read — an unchecked count taken from the input lets the input choose the allocation.
Method: Roslyn syntax + semantics: integer lengths read from a BinaryReader and spent on a bulk read or an array allocation, checked for any comparison or bounding call on the value anywhere in the method. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a loop that shortens a string until it fits a length budget has a floor — one with none grinds the value down to the empty string, or past it into a negative-length `Substring`.
Method: Roslyn syntax + semantics: while/do loops whose body's only effect on a string is to drop its last character, checked for whether anything — a direct comparison on the length, a body guard, a break — bounds that length below. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `while`/`do` loop whose body’s one assignment to a value is `x = x.slice(0, -1)` or `x = x.slice|substring|substr(0, x.length - 1)`, driven by a condition that reads `x.length` only as a term of a larger expression — never compared directly, never tested for truthiness, and with no other read of `x` — and whose body has no `break`, `return`, `throw` or `if` naming `x`. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X17 · Uncapped recursion over a caller-supplied document10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether a walk that recurses through a JSON/XML tree handed in by its caller bounds how deep it will go — an uncapped walk lets the document's nesting choose the stack depth, and the resulting StackOverflowException cannot be caught.
Method: Roslyn syntax + semantics: methods that take a JSON/XML document node and call themselves with a child of it, reachable from an externally-callable member of the same type that accepts a document, checked for any depth parameter, descent counter or threaded arithmetic anywhere in the walk. On a repository with no .NET source it reads TypeScript off the engine’s own token stream (test, vendored, generated and minified paths and `.d.ts` not) with the same rule: a function or method with a parameter typed as a document value — `unknown`, `any`, `object`, `Record<string, unknown|any>`, a JSON alias (`JsonValue`, `JSONObject`, …) or a DOM node global the file does not rebind — that calls itself (bare, or through `this` for a method, or hands itself to a call over the value as in `value.map(walk)`) with something it took out of that value and never through an ancestor accessor such as `closest()` or `parentElement`, that is exported or reached from an exported function (a public method of the same exported class) taking such a value, and that names no depth, level, nesting, recursion, remaining or budget anywhere and threads no `+`/`-` arithmetic through a self-call. Plain JavaScript is not read: with no annotation nothing tells a parsed document from a tree the code built itself. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a type's disposal matches what it OWNS — releasing what it created, leaving alone what it was handed, and not declaring a finalizer for state that has nothing unmanaged to finalize.
Method: Roslyn syntax + semantics: every assignment to a disposable field is read to decide whether the type CREATED the value or was handed it, and the type's disposal is checked against that answer — an injected interface it disposes, a value it constructed and never releases, a finalizer on a type holding nothing unmanaged, and a disposable local whose every reference is a plain member read. A value handed to a container that disposes its contents (a parent control's `Controls` collection, a component `IContainer`) is released by that container and is not reported; generated code is out of population. On a repository with no .NET source the same ownership questions are read in JavaScript/TypeScript off the engine’s own token stream (test, vendored, generated and minified paths not): a class declaring `dispose()`, `[Symbol.dispose]()` or `[Symbol.asyncDispose]()` that disposes a field it was handed through a constructor parameter typed as a repository interface or resolved by a dependency-injection container; that assigns a field only ever from `new X(…)` of a disposable class and neither releases it anywhere in the class nor names it in its disposal member or a method that member calls, nor hands it to anything else; and a `const`/`let` local built from literals only whose every reference opens a statement operating on a non-release member of it. A class is disposable when every repository declaration of its name declares or inherits a disposal member, or when it is a documented library disposable (`vscode` EventEmitter, CancellationTokenSource and Disposable; three.js geometries, materials, textures, render targets, renderers, controls and composers). The finalizer arm has no JavaScript counterpart: a class cannot declare one. Dart is read for the owned-and-never-released arm: a Flutter `State` (or a class declaring `dispose()`/`close()`) whose library-private field is written only with direct creations of a framework controller, `FocusNode`, `StreamController` or periodic `Timer` (or a `.listen(…)` into a field declared `StreamSubscription`), which nothing in the class or its library releases (`dispose`/`close`/`cancel`) and which is never handed on except as a named argument. Ruby is read for the owned-and-never-released arm and the abandoned-local arm: a class declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose instance variable is written only with a blockless core descriptor creation (`File.open`/`new`, `Tempfile`, `Dir.open`, `IO.popen`, the `socket` and `openssl` socket classes) that no method of the class closes and that is never handed on (passed, returned, stored, exposed by `attr_reader`, delegated) — a class whose superclass or mixin lies outside the repository is not judged — and a blockless creation read through and dropped (`File.open(path).read`) or held in a local that is never closed, returned, passed or stored (a `&:read` block-pass, an `autoclose: false` borrow and a `fileno` hand-over are not abandonment). PHP is read for the same two arms: a class (not a trait, and not one using a trait) declaring an instance `close`, `dispose`, `shutdown`, `stop`, `disconnect` or `terminate` whose `private` property (or a `final` class's `protected` one) is written only with a direct core `fopen`, `tmpfile`, `popen`, `proc_open`, `fsockopen`, `stream_socket_client`/`server` or `opendir` that nothing in the class closes (`fclose`, `pclose`, `closedir`, `unset`, a reset to `null`) and that is never handed on, and a handle held in a function's local, or read through as the argument of a reader, that is never closed, returned, passed, captured or stored; a `php://` stream, `curl_init`, `SplFileObject`, `PDO` and a function the repository declares under the core name are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `for` loop leaves the `RefCell` it is walking alone — safe Rust rejects a body that changes the collection its loop borrows at compile time, except through interior mutability: a `RefCell` borrowed in the loop's header stays borrowed until the loop ends, so a `borrow_mut()` of it inside the body panics with `already borrowed: BorrowMutError` and the remaining elements are never seen. Whether a `for` loop leaves the `dict`, `set` or `deque` it is walking alone — CPython's iterators over those check that the collection has not changed size since the loop began, so a body that removes from (or empties) the very collection the loop is walking makes the next step raise `RuntimeError: dictionary changed size during iteration` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
`warn!` at line 33 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/addrs.rs:33
`debug!` at line 133 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/elasticsearch.rs:133
`debug!` at line 358 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/elasticsearch.rs:358
`info!` at line 109 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/grpc.rs:109
`error!` at line 113 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/grpc.rs:113
`info!` at line 387 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/grpc.rs:387
`warn!` at line 412 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/grpc.rs:412
`info!` at line 1655 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/http.rs:1655
`info!` at line 1706 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/http.rs:1706
`error!` at line 131 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/otel_arrow.rs:131
`info!` at line 103 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/server.rs:103
`info!` at line 126 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/server.rs:126
`error!` at line 175 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/server.rs:175
`info!` at line 180 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/server.rs:180
`info!` at line 207 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/server.rs:207
`debug!` at line 854 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/postgres/handler.rs:854
`info!` at line 855 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/postgres/handler.rs:855
`debug!` at line 108 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/postgres/server.rs:108
`debug!` at line 112 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/postgres/server.rs:112
`debug!` at line 27 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/postgres/utils.rs:27
`info!` at line 534 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/postgres/copy_in/mod.rs:534
`debug!` at line 316 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/mysql/handler.rs:316
`debug!` at line 342 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/mysql/handler.rs:342
`debug!` at line 347 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/mysql/handler.rs:347
`error!` at line 482 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/mysql/handler.rs:482
`debug!` at line 528 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/mysql/handler.rs:528
`debug!` at line 560 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/mysql/handler.rs:560
`debug!` at line 637 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/mysql/handler.rs:637
`debug!` at line 879 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/mysql/handler.rs:879
`debug!` at line 912 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/mysql/handler.rs:912
`debug!` at line 194 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/mysql/server.rs:194
`debug!` at line 163 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/mysql/writer.rs:163
`debug!` at line 444 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/mysql/writer.rs:444
`warn!` at line 47 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/http/client_ip.rs:47
`debug!` at line 37 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/http/dashboard.rs:37
`info!` at line 52 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/http/dyn_log.rs:52
`warn!` at line 411 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/http/event.rs:411
`warn!` at line 423 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/http/event.rs:423
`warn!` at line 911 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/http/event.rs:911
`debug!` at line 386 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`. — src/servers/src/http/jaeger.rs:386
Other · Code Health — Whether strict null checking is enabled and not undermined by heavy `!` assertion — TypeScript's `strictNullChecks` (which `strict` turns on) is what makes `string` exclude `null` and `undefined`, and the postfix `!` is the operator that silences it.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
0/1 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
What to do
The findings name the configuration each number was taken from and, for the assertions, the files that hold them. Turn null checking on where it is off — `"strict": true` in the base tsconfig that the others extend switches `strictNullChecks` on with the rest of the family — and then resolve the assertions rather than adding to them. A `!` on a value the checker could show to be null is a promise the author cannot check from where they are standing, and each one is a `TypeError: Cannot read properties of null` waiting for the path that makes it true; where the value genuinely cannot be null, say something the checker can see instead (narrow it with a test, make the property required, drop the `?`).
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 7 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 included — 47 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 applicable: Rust with no dependency-injection crate has no container to hand one lifetime's instance to another — every value is owned by the code that builds it, and the borrow checker rejects a longer-lived value keeping a borrow of a shorter-lived one; this repository's TypeScript imports no dependency-injection container and defines no container of its own — nothing that both registers and resolves bindings, and nothing that names two lifetimes — so nothing holds one lifetime's instance while handing out another's.
AX2 Stateful singletons — No container singleton was found, so there is no shared instance for concurrent requests to race on. No function in this Python code is served by a threaded web framework (a Flask, Bottle or FastAPI route, a Django or Pyramid view), so no module is shared between request threads. Rust's compiler refuses unsynchronised shared mutation — a value shared across threads must be Sync — so the race this check looks for cannot be written. TypeScript/JavaScript runs each process's requests on one event loop, so no two requests write a shared object at the same instant (interleaving across an await is a different defect).
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 — no exported interface declares behaviour
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 Error Get "https://registry-1.docker.io/v2/": Forbidden mysql Error Get "https://registry-1.docker.io/v2/": Forbidden postgres Error context canceled postgres15 Error context canceled minio Error context canceled etcd-tls Error context canceled zookeeper Error context canceled kafka Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: mysql Error Get "https://registry-1.docker.io/v2/": Forbidden zookeeper Error Get "https://registry-1.docker.io/v2/": Forbidden minio Error Get "https://registry-1.docker.io/v2/": Forbidden kafka Error context canceled etcd Error context canceled postgres15 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 — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no data at rest for these controls to protect.
C3 Audit Trail — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no sensitive data whose changes an audit trail would record. If it does (through a store configured outside this repository, for instance), the trail belongs to wherever that data is stored.
C4 Data Retention — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data whose lifetime a retention limit would bound.
C5 Data-Subject Rights — No personal data detected in a persisted data model — no PII-named field (email, first_name, date_of_birth, phone, …) or stored credential in a Diesel schema, a SeaORM entity, a Diesel or sqlx row struct, or a SQL CREATE TABLE or ALTER TABLE — and no database or data-store crate (sqlx, Diesel, SeaORM, rusqlite, tokio-postgres, MongoDB, …) in the source either, so this repository keeps no personal data for a data subject to erase, export or consent over.
D11 Test Reliability — Test reliability not included — the .rs suite was found but not re-run
D18 Solution Shape — D18 scores the shape of a .NET solution; this repository has no .NET solution or project files, so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# only; Python, Rust, TypeScript not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — No bounded-context organisation was detected either — neither a context-shaped layout, nor 2+ sibling source directories each declaring an aggregate root, nor 2+ projects each declaring an entity of their own. Declaring this codebase's bounded contexts (≥2) would let cross-boundary type coupling be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D24 Comment Value — D24 reads C# and Visual Basic comments only — this repository's production source is .py, .rs, .ts, which was left unread. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D25 ADR Conformance — None of 0 binding record(s) states a rule in checkable form (a backticked element with a prohibition, or an `adr-rules` block), so conformance cannot be read from the code. Write the rule as an `adr-rules` block (`forbid:` a symbol, a package or a dependency) to make it checkable.
D27 Navigability — D27 counts a call into the standard library or a dependency as unresolved for this repository's language (.rs), so too few call sites counted as resolved to assess navigability. Not scored: this is a gap in the analyzer, not a verdict about this repository.
D32 Data Compliance (PII/GDPR) — 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 — no mutating command handlers or message consumers detected — idempotency check not applicable
GD1 Unfinished & placeholder code — no source files were read — this check reads C#, F#, JavaScript/TypeScript, Dart, Ruby and Scala, and none was read for this repository's product. That is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — not analysed — these correctness checks read a source model that was not loaded for this repository, because the repository is written in a language this check does not yet model, or because its projects failed to load. This is a gap in the analyzer, not a finding about this repository
P12 CI test-gate honesty — Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
P8 Schema migrations — 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.
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X2 Cancellation propagation — no C# was loaded; this repository's Python and Rust were read, and no request in it can be cancelled by a caller — a Python request takes no token: asyncio cancels the task and trio or anyio the scope that made it, from outside the call, and requests, httpx, aiohttp and gRPC take a timeout, not a cancellation; a Rust request takes no token: a future is cancelled by dropping it, from outside the call (select!, a timeout, an aborted task), and reqwest, hyper and tonic take none
X20 Mistyped argument guard — This check asks whether an argument guard reports an EMPTY value as a NULL one, which needs a language that throws a null-specific argument exception — .NET's ArgumentNullException, the JVM's NullPointerException, Dart's ArgumentError.notNull. This repository contains none of those languages: the ones it is written in have a single exception for a bad argument, so there is no pair of exceptions to confuse and nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X32 Type resolved by simple name across every loaded assembly — This check is about how a .NET program searches the assemblies loaded into its process for a type, and this repository contains no .NET source, so there is nothing here for it to assess. Not a gap in the analyzer and not a finding about your code.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
Boundary-crossing change coupling: table_names.rs ↔ consts.rs src/catalog/src/system_schema/information_schema/table_names.rs:1— `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/file-engine/src/engine.rs:1— `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 82% of the time (9 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 9 shared commits counted here, the most recent 3 are `91a59b82` fix: acknowledge writes only within the region's leader lease (#9904); `294f19fa` feat(metric-engine): support sync logical regions from source region …; `f7d5c87a` feat: introduce `copy_region_from` for mito engine (#7389) — run `git show` on any of them.
Boundary-crossing change coupling: REDACTED ↔ test_util.rs src/datanode/src/tests.rs:1— `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 82% of the time (9 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 9 shared commits counted here, the most recent 3 are `91a59b82` fix: acknowledge writes only within the region's leader lease (#9904); `294f19fa` feat(metric-engine): support sync logical regions from source region …; `f7d5c87a` feat: introduce `copy_region_from` for mito engine (#7389) — run `git show` on any of them.
Boundary-crossing change coupling: engine.rs ↔ test_util.rs src/mito2/src/engine.rs:1— `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 82% of the time (9 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 9 shared commits counted here, the most recent 3 are `91a59b82` fix: acknowledge writes only within the region's leader lease (#9904); `294f19fa` feat(metric-engine): support sync logical regions from source region …; `f7d5c87a` feat: introduce `copy_region_from` for mito engine (#7389) — 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:1— `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: seq_scan.rs ↔ parallelize_scan.rs src/mito2/src/read/seq_scan.rs:1— `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 73% of the time (8 of the 11 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — 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 `b32ca3ad` perf: parallelize file source region (#7285); `c7e94855` feat: New scanner `SeriesScan` to scan by series for querying metrics…; `73ca39f3` feat: time series distribution in scanner (#5675) — run `git show` on any of them.
Boundary-crossing change coupling: etcd.rs ↔ metasrv.rs src/common/meta/src/election/etcd.rs:1— `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:1— `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:1— `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: REDACTED ↔ engine.rs src/datanode/src/tests.rs:1— `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 64% of the time (14 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 14 shared commits counted here, the most recent 3 are `91a59b82` fix: acknowledge writes only within the region's leader lease (#9904); `294f19fa` feat(metric-engine): support sync logical regions from source region …; `f7d5c87a` feat: introduce `copy_region_from` for mito engine (#7389) — run `git show` on any of them.
Boundary-crossing change coupling: scan_region.rs ↔ parallelize_scan.rs src/mito2/src/read/scan_region.rs:1— `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 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 `0c30bf1a` feat: add a subcommand to bench scan (#7722); `c7e94855` feat: New scanner `SeriesScan` to scan by series for querying metrics…; `73ca39f3` feat: time series distribution in scanner (#5675) — 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:1— `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: prom_store.rs ↔ test_util.rs src/frontend/src/service_config/prom_store.rs:1— `src/frontend/src/service_config/prom_store.rs` (context service_config) and `tests-integration/src/test_util.rs` (context tests-integration) 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 `20dde260` feat: enable native histogram ingestion by default (#9301); `aa725637` refactor!: move native histogram config and `prom_validation_mode` to…; `c8f65c7b` feat: update flow windows after metric batch flush (#8544) — 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:1— `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: log_handler.rs ↔ pipeline_operator.rs src/frontend/src/instance/log_handler.rs:1— `src/frontend/src/instance/log_handler.rs` (context instance) and `src/pipeline/src/manager/pipeline_operator.rs` (context pipeline) 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 `ad823db0` fix(pipeline)!: disable VRL host access by default (#9610); `7274ceba` feat: Add query pipeline http api (#5819); `f13a4364` chore: remove `Transformer` trait (#5772) — run `git show` on any of them.
Boundary-crossing change coupling: table_route.rs ↔ downgrade_leader_region.rs src/common/meta/src/key/table_route.rs:1— `src/common/meta/src/key/table_route.rs` (context common) and `src/meta-srv/src/procedure/region_migration/update_metadata/downgrade_leader_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 `dcae2120` chore: refresh route table (#4673); `a8cbec82` refactor: refactor TableRouteManager (#3392); `4460af80` feat(TableRouteValue): add panic notes and type checks (#3031) — run `git show` on any of them.
Boundary-crossing change coupling: jaeger.rs ↔ v0.rs src/frontend/src/instance/jaeger.rs:1— `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:1— `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:1— `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: objbench.rs ↔ write_cache.rs src/cmd/src/datanode/objbench.rs:1— `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 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 `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: builder.rs ↔ options.rs src/frontend/src/instance/builder.rs:1— `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 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) — 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 `83e62a77` feat: remove the server-side Metric export gate (#9547); `953d01ac` feat: support pending rows batching for MySQL and PostgreSQL (#9302); `723da69b` feat: share logical table batching with OTLP metrics (#9288) — run `git show` on any of them.
Boundary-crossing change coupling: metasrv.rs ↔ log_store.rs src/common/wal/src/config/kafka/metasrv.rs:1— `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: copy_parser.rs ↔ requests.rs src/sql/src/parsers/copy_parser.rs:1— `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: lib.rs ↔ pipeline.rs src/pipeline/src/lib.rs:1— `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:1— `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.
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:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge src/mito2/src/sst/index/fulltext_index/applier/builder.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away, so if it breaks, no one currently understands it. It does carry its own tests, so the behaviour is pinned even though the understanding is gone: schedule a read-through, using those tests as the specification, before the next change lands here.
Orphaned knowledge src/common/meta/src/kv_backend/rds.rs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
DM4 · Rich vs anemic domain model· Anemic domain model · ×2
Anemic domain model: DroppedTableLifecycle src/common/meta/src/key.rs:484— `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.
Anemic domain model: DrainDatanodeProcedureTask src/meta-srv/src/procedure/drain_datanode.rs:74— `DrainDatanodeProcedureTask` 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 tests-integration/tests/http.rs:6009— // todo(shuiyisong): refactor http error handling — 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 tests-integration/tests/main.rs:86— // TODO(niebayes): add integration tests for remote wal. — 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 tests-integration/src/tests/gc.rs:271— // TODO: Add more specific assertions once we have proper file system access — 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 tests-fuzz/src/context.rs:91— // TODO(weny): find a better way? — 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 tests-fuzz/src/validator/column.rs:129— // TODO: Checks `semantic_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 tests-fuzz/src/validator/column.rs:223— // TODO(discord9): invalid prepared sql after alter — 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 tests-fuzz/src/validator/column.rs:239— // TODO(discord9): make sure marker value is set — 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 tests/runner/src/cmd/bare.rs:248— // TODO(weny): remove postgre and mysql containers — 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/table/src/metadata.rs:735— // TODO(yingwen): Remove this. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment src/table/src/metadata.rs:771— // TODO(yingwen): Tests add if not exists. — 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/table/src/predicate.rs:160— // TODO(hl): `execution_props` provides variables required by evaluation. — 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/table/src/predicate.rs:508— // TODO(hl): maybe we should raise an error here since cannot parse — 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/table/src/stats.rs:47— // TODO(discord9): histogram of values — 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/table/src/table.rs:57— /// TODO(discord9): add the entire partition exprs rules here 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/table/src/table/scan.rs:77— // TODO(ruihang): handle TimeWindowed dist via this parameter — 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/table/src/predicate/stats.rs:117— // TODO(LFC): Impl it. — 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/table/src/predicate/stats.rs:122— // TODO(LFC): Impl it. — 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/mito2/src/sst/parquet/stats.rs:178— // TODO(LFC): Impl it. — 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/mito2/src/sst/parquet/stats.rs:183— // TODO(LFC): Impl it. — 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/store-api/src/region_engine.rs:210— /// TODO(weny): rename it to `RegionRoleState` — 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/store-api/src/region_engine.rs:612— /// TODO(weny): remove this two fields and use single instead. — 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/store-api/src/storage/file.rs:118— /// TODO(discord9): change to `RemovedFile`? — 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/sql/src/statements.rs:88— // TODO(dennis): supports binary — 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/sql/src/statements.rs:335— // TODO(fys): infer it later from type hints. — 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/sql/src/statements/transform/type_alias.rs:146— // TODO(dennis): supports try_cast — 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 — 4590 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, 290-6604). The bar is 500 significant lines; this is 4090 over it, 9.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: statement/ddl.rs src/operator/src/statement/ddl.rs— FileTooLong — 2251 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 69% of them inside a single declaration: StatementExecutor (354-2514). The bar is 500 significant lines; this is 1751 over it, 4.50× 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: object_store_wal/store.rs src/log-store/src/object_store_wal/store.rs— FileTooLong — 2123 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 1623 over it, 4.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: 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 — 1787 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 51 free functions. The bar is 500 significant lines; this is 1287 over it, 3.57× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: otlp/trace_ingest.rs src/frontend/src/instance/otlp/trace_ingest.rs— FileTooLong — 1693 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 1193 over it, 3.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/region_server.rs src/datanode/src/region_server.rs— FileTooLong — 1657 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 1157 over it, 3.31× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: parquet/reader.rs src/mito2/src/sst/parquet/reader.rs— FileTooLong — 1585 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 1085 over it, 3.17× 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 — 1565 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: Inserter (3 blocks, 107-1795). The bar is 500 significant lines; this is 1065 over it, 3.13× 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: 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: read/scan_region.rs src/mito2/src/read/scan_region.rs— FileTooLong — 1501 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 1001 over it, 3.00× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/error.rs src/mito2/src/error.rs— FileTooLong — 1329 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-1784). The bar is 500 significant lines; this is 829 over it, 2.66× 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/instance.rs src/frontend/src/instance.rs— FileTooLong — 1311 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 74% of them inside a single declaration: Instance (7 blocks, 118-1581). The bar is 500 significant lines; this is 811 over it, 2.62× 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 — 1307 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 807 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 — 1298 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 798 over it, 2.60× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: 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: 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/region.rs src/mito2/src/region.rs— FileTooLong — 1247 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 747 over it, 2.49× 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 — 1219 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, 401-1814). The bar is 500 significant lines; this is 719 over it, 2.44× 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 — 1205 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 50 free functions. The bar is 500 significant lines; this is 705 over it, 2.41× 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/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: src/ddl_manager.rs src/common/meta/src/ddl_manager.rs— FileTooLong — 1194 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted). The bar is 500 significant lines; this is 694 over it, 2.39× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/engine.rs src/mito2/src/engine.rs— FileTooLong — 1188 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 688 over it, 2.38× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/native_histogram.rs src/common/query/src/native_histogram.rs— FileTooLong — 1168 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 668 over it, 2.34× 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/worker.rs src/mito2/src/worker.rs— FileTooLong — 1156 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 656 over it, 2.31× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
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:3557— MethodTooLong — create_function_expr runs 424 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 324 over it, 4.24× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ScanbenchCommand.run src/cmd/src/datanode/scanbench.rs:771— MethodTooLong — run runs 422 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 322 over it, 4.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.
MethodTooLong: PromPlanner.prom_binary_expr_to_plan src/query/src/promql/planner.rs:1147— MethodTooLong — prom_binary_expr_to_plan runs 403 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 303 over it, 4.03× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MetasrvBuilder.build src/meta-srv/src/metasrv/builder.rs:213— MethodTooLong — build runs 380 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 280 over it, 3.80× 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:1087— MethodTooLong — create_or_alter_tables_on_demand runs 254 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 154 over it, 2.54× 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:508— MethodTooLong — build_with runs 222 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 122 over it, 2.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.
MethodTooLong: MergeScanExec.to_stream src/query/src/dist_plan/merge_scan.rs:617— MethodTooLong — to_stream runs 211 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 111 over it, 2.11× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ParquetReaderBuilder.build_reader_input_inner src/mito2/src/sst/parquet/reader.rs:442— MethodTooLong — build_reader_input_inner runs 207 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 107 over it, 2.07× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: 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: Inserter.handle_bulk_insert src/operator/src/bulk_insert.rs:83— MethodTooLong — handle_bulk_insert 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: Inserter.validate_and_normalize_otlp_metrics src/operator/src/insert/otlp.rs:72— MethodTooLong — validate_and_normalize_otlp_metrics runs 201 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 101 over it, 2.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StatementExecutor.execute_sql src/operator/src/statement.rs:248— MethodTooLong — execute_sql runs 201 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 101 over it, 2.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Instance.ingest_trace_spans src/frontend/src/instance/otlp/trace_ingest.rs:1042— MethodTooLong — ingest_trace_spans runs 198 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 98 over it, 1.98× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StatementExecutor.repartition_table src/operator/src/statement/ddl.rs:1815— MethodTooLong — repartition_table runs 196 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 96 over it, 1.96× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: FrontendBuilder.try_build src/frontend/src/instance/builder.rs:195— MethodTooLong — try_build 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: Instance.do_query src/frontend/src/instance/grpc.rs:64— MethodTooLong — do_query runs 186 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 86 over it, 1.86× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
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: ObjectStoreLogStore.open src/log-store/src/object_store_wal/store.rs:314— MethodTooLong — open 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:3041— 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: Error.status_code src/mito2/src/error.rs:1494— MethodTooLong — status_code 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.
Hotspot: src/query/src/promql/planner.rs src/query/src/promql/planner.rs:3557— src/query/src/promql/planner.rs changed 32 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 106 in PromPlanner::create_function_expr at line 3557. 19 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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:1594— 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 1594. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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:1087— src/operator/src/insert.rs changed 26 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 48 in Inserter::create_or_alter_tables_on_demand at line 1087. 3 of those changes were fix/bug commits, and the other 23 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/mito2/src/error.rs src/mito2/src/error.rs:1494— src/mito2/src/error.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 76 in Error::status_code at line 1494. 7 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/operator/src/statement.rs src/operator/src/statement.rs:248— src/operator/src/statement.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 57 in StatementExecutor::execute_sql at line 248. 2 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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 12 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 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/operator/src/statement/ddl.rs src/operator/src/statement/ddl.rs:981— src/operator/src/statement/ddl.rs changed 22 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in StatementExecutor::determine_flow_type at line 981. 4 of those changes were fix/bug commits, and the other 18 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/mito2/src/sst/parquet/reader.rs src/mito2/src/sst/parquet/reader.rs:442— src/mito2/src/sst/parquet/reader.rs changed 19 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 442. 3 of those changes were fix/bug commits, and the other 16 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/common/meta/src/error.rs src/common/meta/src/error.rs:1216— src/common/meta/src/error.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 39 in Error::status_code at line 1216. 3 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/mito2/src/region.rs src/mito2/src/region.rs:577— src/mito2/src/region.rs changed 16 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in MitoRegion::set_role_state_gracefully at line 577. 6 of those changes were fix/bug commits, and the other 10 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/mito2/src/region.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:617— src/query/src/dist_plan/merge_scan.rs changed 14 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 25 in MergeScanExec::to_stream at line 617. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/mito2/src/worker.rs src/mito2/src/worker.rs:1442— src/mito2/src/worker.rs changed 18 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 19 in RegionWorkerLoop::handle_background_notify at line 1442. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/mito2/src/request.rs src/mito2/src/request.rs:847— src/mito2/src/request.rs changed 15 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in WorkerRequest::try_from_region_request at line 847. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/mito2/src/region/opener.rs src/mito2/src/region/opener.rs:1222— src/mito2/src/region/opener.rs changed 18 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 1222. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/servers/src/error.rs src/servers/src/error.rs:746— src/servers/src/error.rs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 40 in Error::status_code at line 746. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/log-store/src/object_store_wal/store.rs src/log-store/src/object_store_wal/store.rs:1553— src/log-store/src/object_store_wal/store.rs changed 19 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 16 in Actor::run at line 1553. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/log-store/src/object_store_wal/store.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: src/cmd/src/datanode/scanbench.rs src/cmd/src/datanode/scanbench.rs:771— src/cmd/src/datanode/scanbench.rs changed 7 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/query/src/dist_plan/commutativity.rs src/query/src/dist_plan/commutativity.rs:97— src/query/src/dist_plan/commutativity.rs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 41 in Categorizer::check_plan at line 97. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/query/src/dist_plan/commutativity.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/expr_helper.rs src/operator/src/expr_helper.rs:820— src/operator/src/expr_helper.rs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in operator::expr_helper::to_alter_table_expr at line 820. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/operator/src/expr_helper.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:960— src/common/meta/src/ddl_manager.rs changed 12 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in DdlManager::submit_ddl_task at line 960. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/catalog/src/system_schema/information_schema.rs src/catalog/src/system_schema/information_schema.rs:216— 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::information_table at line 216. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/mito2/src/worker/handle_write.rs src/mito2/src/worker/handle_write.rs:46— src/mito2/src/worker/handle_write.rs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in RegionWorkerLoop::handle_write_requests at line 46. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/mito2/src/worker/handle_write.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/mito2/src/read/seq_scan.rs src/mito2/src/read/seq_scan.rs:678— src/mito2/src/read/seq_scan.rs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 23 in mito2::read::seq_scan::build_flat_sources at line 678. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/mito2/src/read/seq_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/frontend/src/instance/otlp/trace_ingest.rs src/frontend/src/instance/otlp/trace_ingest.rs:1042— src/frontend/src/instance/otlp/trace_ingest.rs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in Instance::ingest_trace_spans at line 1042. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/frontend/src/instance/otlp/trace_ingest.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.
ClassTooLong: PromPlanner src/query/src/promql/planner.rs:290— ClassTooLong — 4403 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 139 methods, 2 blocks, lines 290-6604. The bar is 400 significant lines; this is 4003 over it, 11.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/mito2/src/error.rs:46— ClassTooLong — 1300 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-1784. The bar is 400 significant lines; this is 900 over it, 3.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: 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/common/meta/src/error.rs:43— ClassTooLong — 1102 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-1507. The bar is 400 significant lines; this is 702 over it, 2.76× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Inserter src/operator/src/insert.rs:107— ClassTooLong — 1091 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods, 3 blocks, lines 107-1795. The bar is 400 significant lines; this is 691 over it, 2.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Error src/meta-srv/src/error.rs:37— ClassTooLong — 1067 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-1443. The bar is 400 significant lines; this is 667 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Instance src/frontend/src/instance.rs:118— ClassTooLong — 965 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 104 methods, 7 blocks, lines 118-1581. The bar is 400 significant lines; this is 565 over it, 2.41× 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: TableMeta src/table/src/metadata.rs:137— ClassTooLong — 864 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-1420. The bar is 400 significant lines; this is 464 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: TableMetadataManager src/common/meta/src/key.rs:401— 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 401-1814. 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: ParquetReaderBuilder src/mito2/src/sst/parquet/reader.rs:188— ClassTooLong — 862 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 32 methods, 2 blocks, lines 188-1424. The bar is 400 significant lines; this is 462 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: 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: Actor src/log-store/src/object_store_wal/store.rs:1472— ClassTooLong — 800 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 41 methods, 3 blocks, lines 1472-2784. The bar is 400 significant lines; this is 400 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RegionServer src/datanode/src/region_server.rs:121— ClassTooLong — 720 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, 5 blocks, lines 121-1230. The bar is 400 significant lines; this is 320 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Error src/servers/src/error.rs:41— ClassTooLong — 660 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-958. The bar is 400 significant lines; this is 260 over it, 1.65× 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: ObjectStoreLogStore src/log-store/src/object_store_wal/store.rs:155— ClassTooLong — 618 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 11 methods, 5 blocks, lines 155-1260. The bar is 400 significant lines; this is 218 over it, 1.55× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DdlManager src/common/meta/src/ddl_manager.rs:111— ClassTooLong — 611 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 111-1104. The bar is 400 significant lines; this is 211 over it, 1.53× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LocalGcWorker src/mito2/src/gc.rs:198— ClassTooLong — 596 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 198-1134. The bar is 400 significant lines; this is 196 over it, 1.49× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RegionServerInner src/datanode/src/region_server.rs:1356— ClassTooLong — 582 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 1356-2281. The bar is 400 significant lines; this is 182 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: MitoEngine src/mito2/src/engine.rs:286— ClassTooLong — 576 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 37 methods, 5 blocks, lines 286-1783. The bar is 400 significant lines; this is 176 over it, 1.44× 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:150— ClassTooLong — 566 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 51 methods, 3 blocks, lines 150-1240. The bar is 400 significant lines; this is 166 over it, 1.42× 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: FrontendClient src/flow/src/batching_mode/frontend_client.rs:91— ClassTooLong — 527 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 17 methods, 3 blocks, lines 91-836. The bar is 400 significant lines; this is 127 over it, 1.32× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
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:707— src/frontend/src/instance/otlp/trace_ingest.rs:707-714 | src/frontend/src/instance/otlp/trace_ingest.rs:2307-2314 — both copies are in the same file, so extract the block into 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/log-store/src/object_store_wal/store.rs:1621— src/log-store/src/object_store_wal/store.rs:1621-1628 | src/log-store/src/object_store_wal/store.rs:2466-2473 — both copies are in the same file, so extract the block into 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:829— src/meta-srv/src/metasrv.rs:829-836 | 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:648— src/mito2/src/memtable/bulk.rs:648-655 | 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/worker/handle_write.rs:637— src/mito2/src/worker/handle_write.rs:637-644 | src/mito2/src/worker/handle_write.rs:741-748 — both copies are in the same file, so extract the block into 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:411— src/promql/src/extension_plan/instant_manipulate.rs:411-418 | src/promql/src/extension_plan/range_manipulate.rs:237-244 — 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:1383— src/query/src/promql/planner.rs:1383-1390 | src/query/src/promql/planner.rs:1391-1398 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) src/servers/src/http/authorize.rs:255— src/servers/src/http/authorize.rs:255-262 | src/servers/src/http/authorize.rs:297-304 — both copies are in the same file, so extract the block into 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/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 (8 lines × 2) src/common/meta/src/key/table_repart.rs:261— src/common/meta/src/key/table_repart.rs:261-268 | src/common/meta/src/key/table_route.rs:719-726 — 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 (7 lines × 2) src/catalog/src/system_schema/information_schema/flows.rs:165— src/catalog/src/system_schema/information_schema/flows.rs:165-171 | src/query/src/sql.rs:1307-1315 — 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:423— src/common/meta/src/ddl/drop_table.rs:423-429 | 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:765— REDACTED:765-771 | REDACTED:807-813 — both copies are in the same file, so extract the block into 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/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:942— src/mito2/src/engine.rs:942-948 | src/mito2/src/engine.rs:1056-1062 — both copies are in the same file, so extract the block into 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:935— src/mito2/src/gc.rs:935-941 | src/mito2/src/gc.rs:943-949 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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:147-153 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) src/mito2/src/sst/index/fulltext_index/applier.rs:609— src/mito2/src/sst/index/fulltext_index/applier.rs:609-615 | src/mito2/src/sst/index/fulltext_index/applier.rs:654-660 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 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:1354— src/query/src/promql/planner.rs:1354-1360 | src/query/src/promql/planner.rs:1362-1368 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) src/query/src/sql.rs:1039— src/query/src/sql.rs:1039-1045 | src/query/src/sql.rs:1085-1091 — both copies are in the same file, so extract the block into 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/instruction.rs:571— src/common/meta/src/instruction.rs:571-577 | src/meta-srv/src/procedure/region_migration.rs:89-95 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) src/index/src/bloom_filter/reader.rs:96— src/index/src/bloom_filter/reader.rs:96-102 | src/index/src/inverted_index/format/reader.rs:90-96 — 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/cli/src/data/export_v2/command.rs:531— src/cli/src/data/export_v2/command.rs:531-540 | src/cli/src/data/export_v2/command.rs:608-617 — both copies are in the same file, so extract the block into 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.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/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/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/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/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:653— src/frontend/src/instance/otlp/trace_ingest.rs:653-663 | src/frontend/src/instance/otlp/trace_ingest.rs:1893-1902 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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:1192— src/mito2/src/memtable/time_series.rs:1192-1201 | src/mito2/src/memtable/time_series.rs:1334-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 (10 lines × 2) src/mito2/src/read/scan_util.rs:839— src/mito2/src/read/scan_util.rs:839-848 | src/mito2/src/sst/parquet/reader.rs:1595-1604 — 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:90— src/mito2/src/read/seq_scan.rs:90-99 | src/mito2/src/read/series_scan.rs:149-158 — before extracting anything, compare `src/mito2/src/read/seq_scan.rs` and `src/mito2/src/read/series_scan.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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/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:523— src/promql/src/extension_plan/instant_manipulate.rs:523-532 | src/promql/src/extension_plan/range_manipulate.rs:531-540 — 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/http/influxdb.rs:55— src/servers/src/http/influxdb.rs:55-64 | src/servers/src/http/influxdb.rs:79-88 — both copies are in the same file, so extract the block into 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/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 (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:71— src/catalog/src/system_schema/information_schema/region_info.rs:71-81 | src/catalog/src/system_schema/information_schema/region_info.rs:97-107 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) src/cmd/src/flownode.rs:307— src/cmd/src/flownode.rs:307-317 | tests-integration/src/cluster.rs:589-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 (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:525-535 — 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:636— REDACTED:636-646 | REDACTED:436-446 — 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/instance.rs:349— src/frontend/src/instance.rs:349-359 | src/frontend/src/instance.rs:930-940 — both copies are in the same file, so extract the block into 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:251— src/metric-engine/src/engine.rs:251-261 | src/metric-engine/src/engine.rs:264-274 — both copies are in the same file, so extract the block into 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:859— src/mito2/src/request.rs:859-869 | src/mito2/src/request.rs:874-884 — both copies are in the same file, so extract the block into 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:284-294 — 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/mito2/src/sst/index/fulltext_index/applier.rs:644— src/mito2/src/sst/index/fulltext_index/applier.rs:644-654 | src/mito2/src/sst/index/fulltext_index/applier.rs:661-671 — both copies are in the same file, so extract the block into 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:187— src/promql/src/extension_plan/instant_manipulate.rs:187-197 | 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:656— src/promql/src/extension_plan/instant_manipulate.rs:656-666 | 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:645— src/servers/src/mysql/handler.rs:645-655 | src/servers/src/mysql/handler.rs:661-671 — both copies are in the same file, so extract the block into 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:1239— src/servers/src/postgres/types.rs:1239-1249 | src/servers/src/postgres/types.rs:1351-1361 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src/cli/src/data/export_v2/command.rs:398— src/cli/src/data/export_v2/command.rs:398-406 | 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:537-545 — 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.rs:1626— src/common/meta/src/key.rs:1626-1634 | src/common/meta/src/key.rs:1795-1803 — both copies are in the same file, so extract the block into 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/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/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:926— src/meta-srv/src/procedure/repartition.rs:926-934 | src/meta-srv/src/procedure/repartition.rs:944-952 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) src/meta-srv/src/selector/lease_based.rs:35— src/meta-srv/src/selector/lease_based.rs:35-43 | src/meta-srv/src/selector/load_based.rs:54-62 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (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:189— src/mito2/src/memtable/bulk/part.rs:189-197 | src/mito2/src/memtable/bulk/part.rs:1843-1851 — both copies are in the same file, so extract the block into 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:423— src/mito2/src/read/compat.rs:423-431 | src/mito2/src/read/compat.rs:586-594 — both copies are in the same file, so extract the block into 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/read/scan_util.rs:1434— src/mito2/src/read/scan_util.rs:1434-1442 | src/mito2/src/read/series_reader.rs:441-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 (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.rs:219— src/mito2/src/sst/index/bloom_filter/applier.rs:219-227 | src/mito2/src/sst/index/fulltext_index/applier.rs:474-482 — `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/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/operator/src/delete.rs:144— src/operator/src/delete.rs:144-152 | src/operator/src/insert.rs:903-911 — 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/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 (12 lines × 2) src/cli/src/data/export.rs:170— src/cli/src/data/export.rs:170-181 | 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:111— src/index/src/fulltext_index/create/bloom_filter.rs:111-122 | 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:756— src/mito2/src/config.rs:756-767 | src/mito2/src/config.rs:843-854 — both copies are in the same file, so extract the block into 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:895— src/mito2/src/engine.rs:895-906 | src/mito2/src/engine.rs:991-1002 — both copies are in the same file, so extract the block into 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:968— src/mito2/src/engine.rs:968-979 | src/mito2/src/engine.rs:1084-1095 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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:256— src/mito2/src/sst/index/fulltext_index/applier.rs:256-267 | 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/query/src/promql/planner.rs:3907— src/query/src/promql/planner.rs:3907-3918 | src/query/src/promql/planner.rs:3928-3939 — both copies are in the same file, so extract the block into 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/servers/src/grpc.rs:158— src/servers/src/grpc.rs:158-169 | src/servers/src/grpc.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/servers/src/http/prometheus.rs:744— src/servers/src/http/prometheus.rs:744-755 | src/servers/src/http/prometheus.rs:2446-2457 — both copies are in the same file, so extract the block into 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/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.
FunctionTooLong: servers::postgres::types::parameters_to_scalar_values src/servers/src/postgres/types.rs:574— 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:769— 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: flow::batching_mode::frontend_client::flow_write::tracked_query src/flow/src/batching_mode/frontend_client/flow_write.rs:72— FunctionTooLong — flow::batching_mode::frontend_client::flow_write::tracked_query runs 188 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 88 over it, 1.88× 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:1757— 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: operator::expr_helper::to_alter_table_expr src/operator/src/expr_helper.rs:820— FunctionTooLong — operator::expr_helper::to_alter_table_expr 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.
FunctionTooLong: common_query::native_histogram::encoding::decode_native_histogram_for_remote_read src/common/query/src/native_histogram/encoding.rs:151— FunctionTooLong — common_query::native_histogram::encoding::decode_native_histogram_for_remote_read runs 156 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 56 over it, 1.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: common_grpc_expr::alter::alter_expr_to_request src/common/grpc-expr/src/alter.rs:163— 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: servers::http::handler::sql_analyze_stream src/servers/src/http/handler.rs:373— 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: servers::postgres::handler::describe_fields src/servers/src/postgres/handler.rs:659— 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_macro::admin_fn::build_struct src/common/macro/src/admin_fn.rs:156— FunctionTooLong — common_macro::admin_fn::build_struct 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: common_query::native_histogram::build_histogram_array src/common/query/src/native_histogram.rs:1534— 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: 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::otlp::metrics::encode_histogram src/servers/src/otlp/metrics.rs:1118— FunctionTooLong — servers::otlp::metrics::encode_histogram 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: common_telemetry::logging::init_global_logging src/common/telemetry/src/logging.rs:455— FunctionTooLong — common_telemetry::logging::init_global_logging runs 118 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 18 over it, 1.18× 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:1000— 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:218— 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.
Duplicated block (13 lines × 2) src/catalog/src/system_schema/information_schema/table_semantics.rs:260— src/catalog/src/system_schema/information_schema/table_semantics.rs:260-272 | src/catalog/src/system_schema/information_schema/tables.rs:164-176 — 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:428— src/catalog/src/system_schema/information_schema/table_semantics.rs:428-440 | src/catalog/src/system_schema/information_schema/tables.rs:465-477 — 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.rs:803— src/common/meta/src/key.rs:803-815 | src/common/meta/src/key.rs:885-897 — both copies are in the same file, so extract the block into 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:797— src/common/meta/src/key.rs:797-809 | src/common/meta/src/key.rs:1739-1751 — both copies are in the same file, so extract the block into 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/flow/flow_route.rs:249— src/common/meta/src/key/flow/flow_route.rs:249-261 | src/common/meta/src/key/flow/table_flow.rs:294-306 — 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/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:908— src/mito2/src/engine.rs:908-920 | src/mito2/src/engine.rs:1004-1016 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) src/mito2/src/read/seq_scan.rs:96— src/mito2/src/read/seq_scan.rs:96-108 | 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:1181— src/mito2/src/sst/parquet/reader.rs:1181-1193 | src/mito2/src/sst/parquet/reader.rs:1267-1279 — both copies are in the same file, so extract the block into 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:640— src/query/src/datafusion.rs:640-652 | src/query/src/datafusion.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 (13 lines × 2) src/query/src/promql/planner.rs:1243— src/query/src/promql/planner.rs:1243-1255 | src/query/src/promql/planner.rs:1310-1322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) src/servers/src/http/prometheus.rs:765— src/servers/src/http/prometheus.rs:765-777 | src/servers/src/http/prometheus.rs:1912-1924 — both copies are in the same file, so extract the block into 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:555— src/servers/src/mysql/handler.rs:555-567 | src/servers/src/mysql/handler.rs:632-644 — both copies are in the same file, so extract the block into 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:1207— src/servers/src/postgres/types.rs:1207-1219 | src/servers/src/postgres/types.rs:1319-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 (13 lines × 2) src/servers/src/postgres/types.rs:1223— src/servers/src/postgres/types.rs:1223-1235 | src/servers/src/postgres/types.rs:1335-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 (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.
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:218-223 — 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:228-233 — 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/flush_flow.rs:81— src/common/function/src/flush_flow.rs:81-86 | src/frontend/src/instance.rs:1790-1795 — 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/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/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:337-342 — 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:302— src/query/src/optimizer/count_nest_aggr.rs:302-307 | src/query/src/optimizer/count_nest_aggr.rs:322-327 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src/servers/src/http/handler.rs:222— src/servers/src/http/handler.rs:222-227 | src/servers/src/http/handler.rs:946-951 — both copies are in the same file, so extract the block into 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:150-155 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) src/store-api/src/region_info.rs:107— src/store-api/src/region_info.rs:107-112 | src/store-api/src/sst_entry.rs:491-496 — 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/cli/src/common/store.rs:135— src/cli/src/common/store.rs:135-140 | src/meta-srv/src/metasrv.rs:425-430 — 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:1— `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:1— `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:1— `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:1— `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: table_flownode.rs ↔ create_flow.rs src/common/meta/src/cache/flow/table_flownode.rs:1— `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: context.rs ↔ reader.rs src/mito2/src/memtable/bulk/context.rs:1— `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: close_region.rs ↔ open_region.rs src/datanode/src/heartbeat/handler/close_region.rs:1— `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:1— `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: create.rs ↔ state.rs src/metric-engine/src/engine/create.rs:1— `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: test_util.rs ↔ handle_create.rs src/mito2/src/test_util.rs:1— `src/mito2/src/test_util.rs` and `src/mito2/src/worker/handle_create.rs` change together 64% of the time (16 of the 25 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: reader.rs ↔ bounded_stager.rs src/puffin/src/puffin_manager/fs_puffin_manager/reader.rs:1— `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: table_info.rs ↔ table_route.rs src/common/meta/src/key/table_info.rs:1— `src/common/meta/src/key/table_info.rs` and `src/common/meta/src/key/table_route.rs` change together 58% of the time (11 of the 19 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency 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 11 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: lease_based.rs ↔ load_based.rs src/meta-srv/src/selector/lease_based.rs:1— `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:1— `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:1— `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:1— `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: datanode.rs ↔ metasrv.rs src/common/wal/src/config/kafka/datanode.rs:1— `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:1— `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: flush.rs ↔ handle_close.rs src/mito2/src/flush.rs:1— `src/mito2/src/flush.rs` and `src/mito2/src/worker/handle_close.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 `a026b3b2` fix(mito): flush memtables containing skip-WAL writes on region close…; `59e4e7ef` fix: preserve close-time flush responses (#8443); `15fc148e` refactor: clarify region flush reasons (#8146) — run `git show` on any of them.
Change coupling: engine.rs ↔ handle_create.rs src/mito2/src/engine.rs:1— `src/mito2/src/engine.rs` and `src/mito2/src/worker/handle_create.rs` change together 52% of the time (13 of the 25 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 13 shared commits counted here, the most recent 3 are `91a59b82` fix: acknowledge writes only within the region's leader lease (#9904); `9fe84f6f` feat(mito): backfill partition expr on region open (#6862); `f7c8d86e` feat: file ref mgr (#6844) — run `git show` on any of them.
Change coupling: test.rs ↔ commutativity.rs src/query/src/dist_plan/analyzer/test.rs:1— `src/query/src/dist_plan/analyzer/test.rs` and `src/query/src/dist_plan/commutativity.rs` change together 52% of the time (13 of the 25 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 13 shared commits counted here, the most recent 3 are `0dab3aef` fix(query): preserve IGNORE NULLS semantics in distributed queries (#…; `c5129383` fix(query): push LIKE filters down into MergeScan remote plans (#9648); `def0c2ec` fix: only push down aggregates grouped by the partition columns thems… — run `git show` on any of them.
Change coupling: create_table.rs ↔ drop_table.rs src/common/meta/src/ddl/create_table.rs:1— `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: columns.rs ↔ tables.rs src/catalog/src/system_schema/information_schema/columns.rs:1— `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.
Change coupling: metasrv.rs ↔ test_util.rs src/meta-srv/src/metasrv.rs:1— `src/meta-srv/src/metasrv.rs` and `src/meta-srv/src/test_util.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 `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: table_name.rs ↔ table_route.rs src/common/meta/src/key/table_name.rs:1— `src/common/meta/src/key/table_name.rs` and `src/common/meta/src/key/table_route.rs` change together 50% of the time (7 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) 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 `c91132bd` feat: introduce `TableNameCache` & `TableInfoCache` & `TableRouteCach…; `343525da` refactor: remove removed-prefixed keys (#3535); `1fab7ab7` feat: batch create ddl (#3194) — run `git show` on any of them.
Duplicated block (5 lines × 2) src/catalog/src/system_schema/information_schema/partitions.rs:323— src/catalog/src/system_schema/information_schema/partitions.rs:323-328 | src/catalog/src/system_schema/information_schema/tables.rs:288-292 — 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.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/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/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:550— src/operator/src/insert.rs:550-554 | src/operator/src/insert.rs:816-820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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:85— src/query/src/datafusion.rs:85-89 | src/query/src/datafusion.rs:114-118 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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:137— src/servers/src/mysql/handler.rs:137-141 | src/servers/src/postgres/handler.rs:66-70 — 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/mito2/src/read/scan_region.rs:2131— src/mito2/src/read/scan_region.rs:2131-2135 | src/mito2/src/read/scan_region.rs:2140-2146 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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:629— src/mito2/src/read/seq_scan.rs:629-633 | src/mito2/src/read/unordered_scan.rs:366-370 — 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:1872— src/operator/src/insert.rs:1872-1876 | 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/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.
Duplicated block (5 lines × 2) src/store-api/src/region_info.rs:90— src/store-api/src/region_info.rs:90-94 | src/store-api/src/sst_entry.rs:473-477 — 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.
TooManyMethods: ParserContext src/sql/src/parser.rs:43— TooManyMethods — 145 methods, declared across 24 files: parsers/create_parser.rs (26), parsers/alter_parser.rs (19), parsers/show_parser.rs (19), src/parser.rs (18), +20 more file(s). The bar is 30 methods; this is 115 over it, 4.83× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: PromPlanner src/query/src/promql/planner.rs:290— TooManyMethods — 139 methods, declared across 5 files: promql/planner.rs (117), 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 109 over it, 4.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: StatementExecutor src/operator/src/statement.rs:139— TooManyMethods — 124 methods, declared across 18 files: statement/ddl.rs (49), 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 94 over it, 4.13× 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:118— TooManyMethods — 104 methods, declared across 14 files: src/instance.rs (39), otlp/trace_ingest.rs (23), instance/grpc.rs (10), instance/dashboard.rs (7), +10 more file(s). The bar is 30 methods; this is 74 over it, 3.47× 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:1021— TooManyMethods — 84 methods, declared across 18 files: worker/handle_write.rs (13), src/worker.rs (10), worker/handle_flush.rs (9), worker/handle_manifest.rs (9), +14 more file(s). The bar is 30 methods; this is 54 over it, 2.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: MetricEngineInner src/metric-engine/src/engine.rs:637— TooManyMethods — 68 methods, declared across 13 files: engine/put.rs (19), engine/read.rs (12), engine/open.rs (10), engine/create.rs (7), +9 more file(s). The bar is 30 methods; this is 38 over it, 2.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: QueryContext src/session/src/context.rs:66— TooManyMethods — 64 methods. The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: 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: 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: MitoRegion src/mito2/src/region.rs:150— TooManyMethods — 51 methods. The bar is 30 methods; this is 21 over it, 1.70× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TableMetadataManager src/common/meta/src/key.rs:401— 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: RegionServer src/datanode/src/region_server.rs:121— TooManyMethods — 49 methods, declared across 4 files: src/region_server.rs (37), region_server/remote_dyn_filter.rs (6), region_server/catalog.rs (4), region_server/flow_write.rs (2). The bar is 30 methods; this is 19 over it, 1.63× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Actor src/log-store/src/object_store_wal/store.rs:1472— TooManyMethods — 41 methods. The bar is 30 methods; this is 11 over it, 1.37× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Metasrv src/meta-srv/src/metasrv.rs:581— TooManyMethods — 41 methods, declared across 3 files: src/metasrv.rs (35), service/procedure.rs (4), service/cluster.rs (2). The bar is 30 methods; this is 11 over it, 1.37× 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: ColumnSchema src/datatypes/src/schema/column_schema.rs:80— TooManyMethods — 39 methods. The bar is 30 methods; this is 9 over it, 1.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: 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: CompactionScheduler src/mito2/src/compaction/scheduler.rs:83— TooManyMethods — 38 methods, declared across 3 files: compaction/scheduler.rs (24), scheduler/local.rs (7), scheduler/planning.rs (7). The bar is 30 methods; this is 8 over it, 1.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: MitoEngine src/mito2/src/engine.rs:286— TooManyMethods — 37 methods. The bar is 30 methods; this is 7 over it, 1.23× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Inserter src/operator/src/insert.rs:107— TooManyMethods — 37 methods, declared across 3 files: src/insert.rs (33), src/bulk_insert.rs (3), insert/otlp.rs (1). The bar is 30 methods; this is 7 over it, 1.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: NativeHistogram src/common/query/src/native_histogram.rs:269— 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: Indexer src/mito2/src/sst/index.rs:255— TooManyMethods — 33 methods, declared across 4 files: indexer/finish.rs (10), sst/index.rs (9), indexer/update.rs (9), indexer/abort.rs (5). The bar is 30 methods; this is 3 over it, 1.10× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: 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: ParquetReaderBuilder src/mito2/src/sst/parquet/reader.rs:188— 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: DdlManager src/common/meta/src/ddl_manager.rs:111— TooManyMethods — 31 methods. The bar is 30 methods; this is 1 over it, 1.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: CacheManager src/mito2/src/cache.rs:1064— 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.
servers::postgres::types::parameters_to_scalar_values (cognitive 205) src/servers/src/postgres/types.rs:574— 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::otlp::metrics::prepare::prepare_metrics (cognitive 172) src/servers/src/otlp/metrics/prepare.rs:68— servers::otlp::metrics::prepare::prepare_metrics has cognitive complexity 172 (threshold 15). Drivers by points: if/else 24 (132 pts), loops 8 (30 pts), boolean chains 6, match/switch 1 (4 pts) (nesting depth added 133). To reduce it, split the body into named stages: move each independent 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:769— 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::prepare::conflicting_points (cognitive 31) src/servers/src/otlp/metrics/prepare.rs:551— servers::otlp::metrics::prepare::conflicting_points has cognitive complexity 31 (threshold 15). Drivers by points: if/else 6 (15 pts), loops 8 (14 pts), boolean chains 2 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
servers::prom_store::query_to_plan (cognitive 30) src/servers/src/prom_store.rs:170— servers::prom_store::query_to_plan has cognitive complexity 30 (threshold 15). Drivers by points: if/else 13 (27 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.
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::otlp::metrics::encode_histogram (cognitive 29) src/servers/src/otlp/metrics.rs:1118— 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::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::batcher::logical_table::pending_worker::start_worker (cognitive 27) src/servers/src/batcher/logical_table/pending_worker.rs:98— 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::from_output (cognitive 27) src/servers/src/http/handler.rs:790— 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:1757— 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::http::handler::sql_analyze_stream (cognitive 23) src/servers/src/http/handler.rs:373— 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::convert_bucket_range (cognitive 19) src/servers/src/otlp/metrics.rs:760— 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::http::authorize::inner_auth (cognitive 17) src/servers/src/http/authorize.rs:80— 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::jaeger::v3::summary::summarize (cognitive 17) src/servers/src/http/jaeger/v3/summary.rs:24— servers::http::jaeger::v3::summary::summarize has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 4 (7 pts), match/switch 1 (2 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
servers::http::prometheus::update_metric_name_matcher (cognitive 17) src/servers/src/http/prometheus.rs:1693— 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::mysql::federated::has_trailing_statement (cognitive 17) src/servers/src/mysql/federated.rs:472— 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::otlp::metrics::exponential_histogram_value (cognitive 17) src/servers/src/otlp/metrics.rs:649— servers::otlp::metrics::exponential_histogram_value has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (14 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
servers::postgres::copy_in::parse::scan_copy_from_stdin (cognitive 17) src/servers/src/postgres/copy_in/parse.rs:60— servers::postgres::copy_in::parse::scan_copy_from_stdin has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (10 pts), boolean chains 3, match/switch 3, loops 1 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
servers::prom_store::append_recordbatch_to_timeseries (cognitive 16) src/servers/src/prom_store.rs:470— servers::prom_store::append_recordbatch_to_timeseries has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), match/switch 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
mito2::read::seq_scan::build_flat_sources (cognitive 36) src/mito2/src/read/seq_scan.rs:678— mito2::read::seq_scan::build_flat_sources has cognitive complexity 36 (threshold 15). Drivers by points: if/else 17 (24 pts), boolean chains 6, 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.
mito2::region::opener::preload_parquet_meta_cache_for_files (cognitive 35) src/mito2/src/region/opener.rs:1222— 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:405— 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::read::scan_util::should_split_flat_batches_for_merge (cognitive 30) src/mito2/src/read/scan_util.rs:1203— mito2::read::scan_util::should_split_flat_batches_for_merge has cognitive complexity 30 (threshold 15). Drivers by points: if/else 14 (26 pts), boolean chains 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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::series_index::maintenance::build_index_version (cognitive 25) src/mito2/src/series_index/maintenance.rs:185— 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::read::scan_util::build_flat_file_range_scan_stream (cognitive 22) src/mito2/src/read/scan_util.rs:1519— 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:506— 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:1891— 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::compaction::find_dynamic_options (cognitive 19) src/mito2/src/compaction.rs:55— 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::compaction::twcs::units::close_units (cognitive 19) src/mito2/src/compaction/twcs/units.rs:862— mito2::compaction::twcs::units::close_units has cognitive complexity 19 (threshold 15). Drivers by points: loops 6 (10 pts), if/else 4 (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.
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::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::worker::handle_manifest::edit_region (cognitive 18) src/mito2/src/worker/handle_manifest.rs:671— 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::worker::handle_write::write_wal (cognitive 18) src/mito2/src/worker/handle_write.rs:665— 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::compaction::twcs::units::pick_closed_merge_with_budget (cognitive 16) src/mito2/src/compaction/twcs/units.rs:301— mito2::compaction::twcs::units::pick_closed_merge_with_budget has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8, boolean chains 7, match/switch 1. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
mito2::memtable::bulk::part::convert_bulk_part (cognitive 16) src/mito2/src/memtable/bulk/part.rs:1000— 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:608— 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.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×21
Duplicated block (15 lines × 2) src/cli/src/data/export.rs:216— src/cli/src/data/export.rs:216-230 | 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/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:590— src/promql/src/extension_plan/range_manipulate.rs:590-604 | 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:1835— src/query/src/promql/planner.rs:1835-1849 | src/query/src/promql/planner.rs:1858-1872 — both copies are in the same file, so extract the block into 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:1216— src/servers/src/postgres/types.rs:1216-1230 | src/servers/src/postgres/types.rs:1285-1299 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) src/servers/src/postgres/types.rs:1328— src/servers/src/postgres/types.rs:1328-1342 | src/servers/src/postgres/types.rs:1388-1402 — both copies are in the same file, so extract the block into 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:1528— src/frontend/src/instance/otlp/trace_ingest.rs:1528-1542 | src/frontend/src/instance/otlp/trace_ingest.rs:1598-1613 — both copies are in the same file, so extract the block into 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:248— .github/scripts/aliyun-ecs-runner-provision.py:248-262 | .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:248` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:274— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:274-288 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:408-422 — 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 22 separate duplicated blocks between them, totalling at least 227 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.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×17
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D30 · Dependency Vulnerabilities· Medium vulnerability · ×17
Duplicated block (14 lines × 2) src/catalog/src/kvbackend/client.rs:237— src/catalog/src/kvbackend/client.rs:237-250 | src/catalog/src/kvbackend/client.rs:257-270 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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:946— REDACTED:946-959 | REDACTED:789-802 — 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/mito2/src/engine.rs:952— src/mito2/src/engine.rs:952-965 | src/mito2/src/engine.rs:1068-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 (14 lines × 2) src/mito2/src/engine.rs:1684— src/mito2/src/engine.rs:1684-1697 | src/mito2/src/engine.rs:1704-1717 — both copies are in the same file, so extract the block into 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/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.rs:1347— src/servers/src/http.rs:1347-1360 | src/servers/src/http.rs:1382-1395 — both copies are in the same file, so extract the block into 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/store-api/src/metadata.rs:903— src/store-api/src/metadata.rs:903-916 | src/store-api/src/metadata.rs:944-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 (14 lines × 2) src/mito2/src/sst/index.rs:657— src/mito2/src/sst/index.rs:657-670 | src/mito2/src/sst/index.rs:708-721 — both copies are in the same file, so extract the block into 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:386-399 — 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.
servers::postgres::types::parameters_to_scalar_values (cyclomatic 131) src/servers/src/postgres/types.rs:574— 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:769— 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::otlp::metrics::prepare::prepare_metrics (cyclomatic 42) src/servers/src/otlp/metrics/prepare.rs:68— servers::otlp::metrics::prepare::prepare_metrics 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.
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::http::prometheus::label_values_query (cyclomatic 18) src/servers/src/http/prometheus.rs:1757— 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::postgres::handler::describe_fields (cyclomatic 18) src/servers/src/postgres/handler.rs:659— 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::update_metric_name_matcher (cyclomatic 17) src/servers/src/http/prometheus.rs:1693— 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::otlp::metrics::prepare::conflicting_points (cyclomatic 17) src/servers/src/otlp/metrics/prepare.rs:551— servers::otlp::metrics::prepare::conflicting_points 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.
servers::http::handler::sql_analyze_stream (cyclomatic 16) src/servers/src/http/handler.rs:373— 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::http::prometheus::collect_metric_names (cyclomatic 16) src/servers/src/http/prometheus.rs:1449— 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.
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.
FixmeComment tests-fuzz/targets/unstable/fuzz_create_table_standalone.rs:167— // 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.
FixmeComment tests-fuzz/src/ir.rs:111— /// FIXME(weny): Waits for https://github.com/GreptimeTeam/greptimedb/issues/4247
FixmeComment src/store-api/src/storage/descriptors.rs:53— /// FIXME(discord9): workaround for serde issue: https://github.com/serde-rs/json/issues/1254
FixmeComment src/servers/src/http.rs:1685— // 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/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/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/dist_plan/analyzer.rs:286— // 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:786— /// 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/mito2/src/config.rs:281— // FIXME(#9435): Keep v2 opt-in while long-range scan memory usage is investigated.
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/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/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.
Duplicated block (19 lines × 2) src/cmd/src/frontend.rs:280— src/cmd/src/frontend.rs:280-298 | src/cmd/src/standalone.rs:405-423 — 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/predicate.rs:300— src/common/recordbatch/src/filter/predicate.rs:300-318 | src/common/recordbatch/src/filter/predicate.rs:351-369 — both copies are in the same file, so extract the block into 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:448— src/flow/src/batching_mode/frontend_client.rs:448-466 | src/flow/src/batching_mode/frontend_client.rs:636-654 — both copies are in the same file, so extract the block into 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:529— src/flow/src/batching_mode/frontend_client.rs:529-547 | src/flow/src/batching_mode/frontend_client.rs:817-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 (19 lines × 2) src/flow/src/batching_mode/frontend_client.rs:714— src/flow/src/batching_mode/frontend_client.rs:714-732 | src/flow/src/batching_mode/frontend_client.rs:802-820 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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:420— src/servers/src/http/prometheus.rs:420-438 | src/servers/src/http/prometheus.rs:557-575 — both copies are in the same file, so extract the block into 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:579-597 — both copies are in the same file, so extract the block into 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:81— src/catalog/src/system_schema/information_schema/flow_statistics.rs:81-99 | src/catalog/src/system_schema/information_schema/flows.rs:104-132 — 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.
Repeated repair: src/mito2/src/compaction/twcs.rs src/mito2/src/compaction/twcs.rs:260— src/mito2/src/compaction/twcs.rs changed 13 times in last 90 days and 8 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is TwcsPicker::pick_window at line 260), 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): pick TWCS L1 merges by closed units so compaction terminates (#9741)”; “fix: align TWCS assignment with half-open time windows (#9464)”; “fix(mito2): compare primary key ranges across schema versions (#9205)”; “fix(mito2): preserve last-non-null values across compaction (#9169)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/mito2/src/region_write_ctx.rs src/mito2/src/region_write_ctx.rs:403— src/mito2/src/region_write_ctx.rs changed 11 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 10 (its worst body is RegionWriteCtx::write_bulk at line 403), 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: acknowledge writes only within the region's leader lease (#9904)”; “fix(mito2): validate bulk insert batches against the region schema (#9698)”; “fix(mito2): keep processing bulk requests after one fails to encode (#9638)”; “fix(mito): flush memtables containing skip-WAL writes on region close (#9440)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/mito2/src/region_write_ctx.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/servers/src/prom_store.rs src/servers/src/prom_store.rs:470— src/servers/src/prom_store.rs changed 11 times in last 90 days and 6 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 13 (its worst body is servers::prom_store::append_recordbatch_to_timeseries at line 470), 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(prom): align remote read label matcher semantics (#9633)”; “fix(prom): return empty remote read results for missing metrics (#9613)”; “fix: bound decompressed request size and close memory-admission gaps for compressed requests (#9264)”; “fix(promql): resolve dotted column names as unqualified columns (#9391)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/servers/src/prom_store.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/mito2/src/sst/parquet/writer.rs src/mito2/src/sst/parquet/writer.rs:413— src/mito2/src/sst/parquet/writer.rs changed 8 times in last 90 days and 5 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is ParquetWriter::write_all_flat_inner at line 413), 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): apply SST internal column encodings to bulk-encoded parts (#9735)”; “fix(mito2): truncate parquet column index min/max for SST writes (#9420)”; “fix: release completed SST write buffers during compaction (#9243)”; “fix(mito2): split SSTs at primary key series boundaries (#8888)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/mito2/src/sst/parquet/writer.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/mito2/src/sst/file_purger.rs src/mito2/src/sst/file_purger.rs:220— src/mito2/src/sst/file_purger.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 mito2::sst::file_purger::schedule_range_index_deletion at line 220), 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): coordinate range cache invalidation and singleflight reads (#9935)”; “fix(mito): preserve SST lifetime across index replacement (#9950)”; “fix: align fulltext bloom tokens with matches_term and use them for LIKE (#9470)”; “fix(mito2): compare primary key ranges across schema versions (#9205)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/mito2/src/sst/file_purger.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: .github/scripts/aliyun-ecs-runner-provision.py .github/scripts/aliyun-ecs-runner-provision.py:440— .github/scripts/aliyun-ecs-runner-provision.py 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 8 (its worst body is aliyun-ecs-runner-provision.main at line 440), 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(ci): scope Aliyun janitor sweeps to the owning repository (#9966)”; “fix(ci): repair agent observability dispatch and runner cleanup (#9204)”; “fix(ci): increase query regression ECS disk to 80 GiB (#9123)”; “fix: increase system disk size to 50 GiB for ECS instances (#8986)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- .github/scripts/aliyun-ecs-runner-provision.py`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/query/src/dist_plan/planner.rs src/query/src/dist_plan/planner.rs:247— src/query/src/dist_plan/planner.rs changed 7 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is DistExtensionPlanner::get_regions at line 247), 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): guard deep expressions during query planning (#9564)”; “fix(query): stop reporting region scans as hash partitioned (#9491)”; “fix(query): preserve remote dynamic filter target (#8615)”; “fix(query): use physical partition types for metric route pruning (#8590)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/query/src/dist_plan/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.
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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/mito2/src/memtable/time_series.rs src/mito2/src/memtable/time_series.rs:1050— src/mito2/src/memtable/time_series.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 10 (its worst body is ValueBuilder::extend at line 1050), 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): validate bulk insert batches against the region schema (#9698)”; “fix(promql): restore exact filtering for nullable label matchers (#9418)”; “fix(mito2): preserve last-non-null values across compaction (#9169)”; “fix(metric-engine): handle Utf8View tag/label columns without panicking (#8772)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/mito2/src/memtable/time_series.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/promql/error.rs src/query/src/promql/error.rs:260— src/query/src/promql/error.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 8 (its worst body is Error::status_code at line 260), 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): return range-vector results for instant queries (#9477)”; “fix(promql): align subqueries to the absolute evaluation grid (#9400)”; “fix(promql): align timestamp(), label_join and label_replace with Prometheus semantics (#9385)”; “fix(prometheus): honor label matchers in __name__ values query (#9134)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/query/src/promql/error.rs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: src/query/src/optimizer/type_conversion.rs src/query/src/optimizer/type_conversion.rs:244— src/query/src/optimizer/type_conversion.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 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)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +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/query/src/promql/label_values.rs src/query/src/promql/label_values.rs:65— src/query/src/promql/label_values.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 4 (its worst body is query::promql::label_values::timestamp_to_scalar_value at line 65), 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): accept evaluation times before the Unix epoch (#9480)”; “fix: address Windows test failures and run full Windows CI (#9305)”; “fix(prometheus): honor label matchers in __name__ values query (#9134)”. 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-29..2026-10-27, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-29 13:12:52 +00:00' --until='2026-10-27 13:12:52 +00:00' --full-history --no-merges -- src/query/src/promql/label_values.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.
RegionWorkerLoop::process_write_requests (cognitive 33) src/mito2/src/worker/handle_write.rs:307— RegionWorkerLoop::process_write_requests has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (28 pts), match/switch 1 (3 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.
RegionWorkerLoop::process_bulk_requests (cognitive 32) src/mito2/src/worker/handle_write.rs:473— RegionWorkerLoop::process_bulk_requests has cognitive complexity 32 (threshold 15). Drivers by points: if/else 11 (28 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RegionWorkerLoop::handle_alter_region_options_fast (cognitive 29) src/mito2/src/worker/handle_alter.rs:227— 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::handle_write_requests (cognitive 23) src/mito2/src/worker/handle_write.rs:46— 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:1113— 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:49— 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_rebuild_index (cognitive 19) src/mito2/src/worker/handle_rebuild_index.rs:164— RegionWorkerLoop::handle_rebuild_index has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (13 pts), boolean chains 2, loops 2, match/switch 1 (2 pts) (nesting depth added 3). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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::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:384— 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:384— 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.
RegionWorkerLoop::handle_open_request (cognitive 17) src/mito2/src/worker/handle_open.rs:162— RegionWorkerLoop::handle_open_request has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 2 (5 pts), match/switch 2, boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
RegionWorkerLoop::handle_compaction_unit (cognitive 16) src/mito2/src/worker/handle_compaction.rs:39— RegionWorkerLoop::handle_compaction_unit has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (10 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.
D30 · Dependency Vulnerabilities· Medium CVE · ×12
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
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:266— src/catalog/src/system_schema/information_schema/columns.rs:266-304 | src/catalog/src/system_schema/information_schema/key_column_usage.rs:238-289 | src/catalog/src/system_schema/information_schema/statistics.rs:237-342 | src/catalog/src/system_schema/information_schema/table_constraints.rs:181-221 — 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:181— src/common/meta/src/reconciliation/reconcile_catalog.rs:181-208 | src/common/meta/src/reconciliation/reconcile_database.rs:221-248 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:197-224 | src/common/meta/src/reconciliation/reconcile_table.rs:308-335 — 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-171 | 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.
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:433— src/mito2/src/read/compat.rs:433-448 | src/mito2/src/read/compat.rs:596-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 (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:1645-1660 — 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 7 separate duplicated blocks between them, totalling at least 76 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:354-369 — 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 7 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. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Low cohesion: MockKvBackend (LCOM4 7) src/common/meta/src/kv_backend/test_util.rs:37— 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: QueryEngineState (LCOM4 7) src/query/src/query_engine/state.rs:94— QueryEngineState'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:1064— 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:1356— 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:74— 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: ColumnExtensions (LCOM4 4) src/sql/src/statements/create.rs:152— ColumnExtensions'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:298— 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.
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:433— 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 25) src/operator/src/expr_helper.rs:262— operator::expr_helper::expr_to_create has cognitive complexity 25 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 1 (3 pts), loops 2, boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
operator::insert::fill_table_options_for_create (cognitive 24) src/operator/src/insert.rs:1944— operator::insert::fill_table_options_for_create has cognitive complexity 24 (threshold 15). Drivers by points: if/else 10 (18 pts), loops 3 (4 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.
operator::expr_helper::to_alter_table_expr (cognitive 22) src/operator/src/expr_helper.rs:820— 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::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.
operator::insert::flow_write::dispatch_datanode (cognitive 16) src/operator/src/insert/flow_write.rs:70— operator::insert::flow_write::dispatch_datanode has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (12 pts), loops 3, if/else 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.
PromPlanner::create_function_expr (cognitive 139) src/query/src/promql/planner.rs:3557— 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 85) src/query/src/promql/planner.rs:1147— PromPlanner::prom_binary_expr_to_plan has cognitive complexity 85 (threshold 15). Drivers by points: if/else 33 (56 pts), boolean chains 19, match/switch 5 (10 pts) (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PromPlanner::selector_to_series_normalize_plan (cognitive 44) src/query/src/promql/planner.rs:2529— 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:3041— 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:745— 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 28) src/query/src/promql/planner.rs:2806— PromPlanner::matchers_to_expr has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 2 (4 pts), boolean chains 3, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PromPlanner::agg_modifier_to_col (cognitive 26) src/query/src/promql/planner.rs:2701— 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:2941— 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.
Duplicated block (18 lines × 2) src/catalog/src/system_schema/information_schema/columns.rs:326— src/catalog/src/system_schema/information_schema/columns.rs:326-345 | src/catalog/src/system_schema/information_schema/tables.rs:363-380 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (18 lines × 2) src/cmd/src/flownode.rs:296— src/cmd/src/flownode.rs:296-313 | src/cmd/src/frontend.rs:445-462 — 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:675— src/datanode/src/datanode.rs:675-692 | src/datanode/src/datanode.rs:717-734 — both copies are in the same file, so extract the block into 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:696— src/datanode/src/datanode.rs:696-713 | src/datanode/src/datanode.rs:747-764 — both copies are in the same file, so extract the block into 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:510— src/flow/src/batching_mode/frontend_client.rs:510-527 | src/flow/src/batching_mode/frontend_client.rs:798-815 — both copies are in the same file, so extract the block into 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:734— src/operator/src/statement.rs:734-751 | src/operator/src/statement.rs:753-770 — both copies are in the same file, so extract the block into 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) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:215— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:215-232 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:164-181 — 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 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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/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/metric-engine/src/engine/put.rs:466— src/metric-engine/src/engine/put.rs:466-482 | src/metric-engine/src/engine/put.rs:504-520 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) src/servers/src/otlp/metrics.rs:1030— src/servers/src/otlp/metrics.rs:1030-1046 | src/servers/src/otlp/metrics.rs:1069-1085 — both copies are in the same file, so extract the block into 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/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:962— src/datanode/src/datanode.rs:962-978 | src/datanode/src/datanode.rs:1024-1041 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×9
Members sharing a duplicated core (5 members, 50+ identical tokens) src/catalog/src/system_schema/information_schema/flow_statistics.rs:130— src/catalog/src/system_schema/information_schema/flow_statistics.rs:130-148 | src/catalog/src/system_schema/information_schema/flows.rs:217-235 | src/catalog/src/system_schema/information_schema/table_semantics.rs:259-277 | src/catalog/src/system_schema/information_schema/tables.rs:163-181 | src/catalog/src/system_schema/information_schema/views.rs:126-144 — 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:265-375 | src/cmd/src/metasrv.rs:230-318 | src/cmd/src/standalone.rs:400-477 — 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:206-224 — 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/failover/fuzz_failover_metric_regions.rs:188— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:188-294 | tests-fuzz/targets/failover/fuzz_failover_mito_regions.rs:273-349 | tests-fuzz/targets/fuzz_insert_logical_table.rs:234-295 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:301-428 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:295-382 — 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.
PromPlanner::create_function_expr (cyclomatic 106) src/query/src/promql/planner.rs:3557— PromPlanner::create_function_expr has cyclomatic complexity 106 (threshold 15). To reduce it, separate the cases: extract each independent 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 52) src/query/src/promql/planner.rs:1147— PromPlanner::prom_binary_expr_to_plan has cyclomatic complexity 52 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
PromPlanner::create_table_scan_plan (cyclomatic 22) src/query/src/promql/planner.rs:3041— 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:2941— 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:2529— 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.
PromPlanner::prom_call_expr_to_plan (cyclomatic 18) src/query/src/promql/planner.rs:2250— PromPlanner::prom_call_expr_to_plan 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.
PromPlanner::matchers_to_expr (cyclomatic 16) src/query/src/promql/planner.rs:2806— PromPlanner::matchers_to_expr 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.
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.
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.
mito2::read::seq_scan::build_flat_sources (cyclomatic 23) src/mito2/src/read/seq_scan.rs:678— mito2::read::seq_scan::build_flat_sources has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
mito2::region::opener::preload_parquet_meta_cache_for_files (cyclomatic 18) src/mito2/src/region/opener.rs:1222— 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::series_index::maintenance::build_index_version (cyclomatic 18) src/mito2/src/series_index/maintenance.rs:185— 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::sst::parquet::prefilter::build_reader_filter_plan (cyclomatic 18) src/mito2/src/sst/parquet/prefilter.rs:405— 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::compaction::twcs::units::pick_closed_merge_with_budget (cyclomatic 17) src/mito2/src/compaction/twcs/units.rs:301— mito2::compaction::twcs::units::pick_closed_merge_with_budget 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.
mito2::read::scan_util::should_split_flat_batches_for_merge (cyclomatic 16) src/mito2/src/read/scan_util.rs:1203— mito2::read::scan_util::should_split_flat_batches_for_merge 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.
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::optimizer::expr_depth::validate_plan_exprs (cognitive 32) src/query/src/optimizer/expr_depth.rs:58— query::optimizer::expr_depth::validate_plan_exprs has cognitive complexity 32 (threshold 15). Drivers by points: loops 6 (19 pts), if/else 6 (11 pts), match/switch 1 (2 pts) (nesting depth added 19). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
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::sql::show_create_table::create_column (cognitive 17) src/query/src/sql/show_create_table.rs:85— query::sql::show_create_table::create_column has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 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.
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.
TooManyFields: ScanMetricsSet src/mito2/src/read/scan_util.rs:110— TooManyFields — 66 stored fields beside 7 methods. The bar is 30 stored fields; this is 36 over it, 2.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: MitoConfig src/mito2/src/config.rs:72— TooManyFields — 51 stored fields beside 2 methods. The bar is 30 stored fields; this is 21 over it, 1.70× 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: Actor src/log-store/src/object_store_wal/store.rs:1472— TooManyFields — 41 stored fields beside 41 methods. The bar is 30 stored fields; this is 11 over it, 1.37× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: RegionWorkerLoop src/mito2/src/worker.rs:1021— TooManyFields — 40 stored fields beside 84 methods. The bar is 30 stored fields; this is 10 over it, 1.33× 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:581— TooManyFields — 38 stored fields beside 41 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: StandaloneOptions src/standalone/src/options.rs:41— TooManyFields — 35 stored fields beside 3 methods. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: ScanInput src/mito2/src/read/scan_region.rs:910— TooManyFields — 33 stored fields beside 26 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 (14–15 lines × 2) src/catalog/src/system_schema/information_schema/flow_statistics.rs:190— src/catalog/src/system_schema/information_schema/flow_statistics.rs:190-203 | src/catalog/src/system_schema/information_schema/flows.rs:299-313 — 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:590— src/metric-engine/src/engine.rs:590-603 | src/store-api/src/region_engine.rs:1028-1042 — 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/mito2/src/compaction/scheduler.rs:646— src/mito2/src/compaction/scheduler.rs:646-660 | src/mito2/src/compaction/scheduler/planning.rs:404-417 — 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/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 (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/mito2/src/read/seq_scan.rs:653— src/mito2/src/read/seq_scan.rs:653-665 | src/mito2/src/read/unordered_scan.rs:390-401 — 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:1129— src/mito2/src/read/series_scan.rs:1129-1141 | src/mito2/src/read/series_scan.rs:1145-1156 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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:2624— src/query/src/promql/planner.rs:2624-2636 | src/query/src/promql/planner.rs:3256-3267 — both copies are in the same file, so extract the block into 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 (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:574— src/promql/src/extension_plan/instant_manipulate.rs:574-583 | src/promql/src/extension_plan/range_manipulate.rs:586-595 | 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:1198— tests-integration/src/test_util.rs:1198-1207 | tests-integration/src/test_util.rs:1242-1251 | tests-integration/src/test_util.rs:1298-1307 — 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/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:117— src/index/src/fulltext_index/create/bloom_filter.rs:117-125 | src/mito2/src/sst/index/bloom_filter/creator.rs:426-434 | src/mito2/src/sst/index/inverted_index/creator.rs:431-439 — 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 lines × 3) src/promql/src/extension_plan/instant_manipulate.rs:150— src/promql/src/extension_plan/instant_manipulate.rs:150-158 | 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:186-195 | 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 (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:88— src/mito2/src/read/seq_scan.rs:88-94 | src/mito2/src/read/series_scan.rs:147-153 | 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/series_scan.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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/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 (7 lines × 3) src/common/meta/src/reconciliation/reconcile_database.rs:250— src/common/meta/src/reconciliation/reconcile_database.rs:250-256 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:226-232 | src/common/meta/src/reconciliation/reconcile_table.rs:337-343 — 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 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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:145— src/common/meta/src/reconciliation/reconcile_catalog.rs:145-151 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:173-179 | src/common/meta/src/reconciliation/reconcile_table.rs:268-274 — 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 4 separate duplicated blocks between them, totalling at least 51 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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:801— src/common/meta/src/key.rs:801-809 | src/common/meta/src/key.rs:1531-1537 | src/common/meta/src/key.rs:1743-1751 — 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/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:2460-2466 — 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/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/failover/fuzz_failover_mito_regions.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (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/failover/fuzz_failover_mito_regions.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 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (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:395— src/common/meta/src/ddl/create_table.rs:395-399 | src/common/meta/src/ddl/create_view.rs:268-272 | src/common/meta/src/reconciliation/reconcile_table.rs:357-361 — 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:406— src/common/meta/src/ddl/drop_table.rs:406-410 | 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:1152-1156 — 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:60— src/meta-srv/src/key.rs:60-64 | src/meta-srv/src/key.rs:101-105 | 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.
RegionWorkerLoop::handle_alter_region_options_fast (cyclomatic 19) src/mito2/src/worker/handle_alter.rs:227— 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:46— 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::process_write_requests (cyclomatic 17) src/mito2/src/worker/handle_write.rs:307— RegionWorkerLoop::process_write_requests 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.
RegionWorkerLoop::run (cyclomatic 17) src/mito2/src/worker.rs:1113— RegionWorkerLoop::run has cyclomatic complexity 17 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. This is NOT this file's highest cyclomatic complexity: RegionWorkerLoop::handle_background_notify (cyclomatic 19) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded function is counted neither in this dimension's figures nor in its score.
RegionWorkerLoop::handle_alter_request (cyclomatic 16) src/mito2/src/worker/handle_alter.rs:49— 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::handle_rebuild_index (cyclomatic 16) src/mito2/src/worker/handle_rebuild_index.rs:164— RegionWorkerLoop::handle_rebuild_index 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.
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 53) REDACTED:28— cli::data::import_v2::packed::validate_snapshot has cognitive complexity 53 (threshold 15). Drivers by points: if/else 9 (33 pts), loops 5 (11 pts), match/switch 1 (5 pts), boolean chains 4 (nesting depth added 34). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
cli::data::import_v2::command::iter_ddl_statements (cognitive 37) src/cli/src/data/import_v2/command.rs:426— cli::data::import_v2::command::iter_ddl_statements has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (33 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:169— 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:1212— 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:1055— 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::ingest_trace_spans (cognitive 45) src/frontend/src/instance/otlp/trace_ingest.rs:1042— Instance::ingest_trace_spans has cognitive complexity 45 (threshold 15). Drivers by points: if/else 17 (25 pts), loops 4 (10 pts), match/switch 4 (7 pts), boolean chains 3 (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Instance::reconcile_trace_column_types (cognitive 42) src/frontend/src/instance/otlp/trace_ingest.rs:2257— 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::prevalidate_trace_v1_fixed_columns (cognitive 25) src/frontend/src/instance/otlp/trace_ingest.rs:1882— 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:1802— 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:764— 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::ingest_trace_chunk (cognitive 16) src/frontend/src/instance/otlp/trace_ingest.rs:1395— Instance::ingest_trace_chunk has cognitive complexity 16 (threshold 15). Drivers by points: loops 3 (8 pts), match/switch 3 (5 pts), if/else 2 (3 pts) (nesting depth added 8). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
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:566— src/frontend/src/instance/prom_store.rs:566-581 | src/frontend/src/instance/prom_store.rs:817-831 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 2) src/mito2/src/read/seq_scan.rs:384— src/mito2/src/read/seq_scan.rs:384-398 | src/mito2/src/read/unordered_scan.rs:226-241 — 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:685— src/servers/src/postgres/handler.rs:685-700 | src/servers/src/postgres/handler.rs:703-717 — both copies are in the same file, so extract the block into 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 (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/flow/src/batching_mode/frontend_client.rs:689— src/flow/src/batching_mode/frontend_client.rs:689-701 | src/flow/src/batching_mode/frontend_client.rs:776-789 — both copies are in the same file, so extract the block into 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.rs:768— src/meta-srv/src/procedure/repartition.rs:768-780 | 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/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/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:335-348 — 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 7 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. If that is what happened, the fix is to keep one copy and have the other call 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:401-412 — 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/function/src/admin/reconcile_catalog.rs:94— src/common/function/src/admin/reconcile_catalog.rs:94-105 | src/common/function/src/admin/reconcile_database.rs:103-114 | src/common/function/src/admin/reconcile_table.rs:84-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 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:208— src/promql/src/extension_plan/empty_metric.rs:208-219 | src/promql/src/extension_plan/range_manipulate.rs:271-282 | 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:527-538 | 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–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:1053— src/query/src/sql.rs:1053-1064 | src/query/src/sql/show_create_table.rs:256-266 — 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:1903— src/servers/src/http/prometheus.rs:1903-1913 | src/servers/src/http/prometheus.rs:2470-2481 — both copies are in the same file, so extract the 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.
HackComment src/mito2/src/region.rs:714— // 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.
HackComment src/datanode/src/region_server.rs:1368— /// 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/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/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/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.
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::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::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::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 (21 lines × 2) REDACTED:745— REDACTED:745-765 | REDACTED:576-596 — 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:817— src/mito2/src/read/scan_util.rs:817-837 | src/mito2/src/sst/parquet/reader.rs:1573-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 (21 lines × 2) src/query/src/promql/planner.rs:1264— src/query/src/promql/planner.rs:1264-1284 | src/query/src/promql/planner.rs:1331-1351 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (21 lines × 2) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:166— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:166-186 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:165-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 22 separate duplicated blocks between them, totalling at least 227 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 3) src/common/meta/src/ddl_manager.rs:1298— src/common/meta/src/ddl_manager.rs:1298-1308 | src/common/meta/src/ddl_manager.rs:1531-1541 | src/common/meta/src/ddl_manager.rs:1632-1642 — 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:100— src/frontend/src/instance/otlp.rs:100-110 | src/frontend/src/instance/otlp.rs:238-248 | src/frontend/src/instance/otlp.rs:276-286 — 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 11 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (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/datatypes/src/data_type.rs:206— src/datatypes/src/data_type.rs:206-215 | src/servers/src/postgres/copy_in/csv.rs:97-105 — 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/query/src/promql/planner.rs:1746— src/query/src/promql/planner.rs:1746-1754 | src/query/src/promql/planner.rs:6569-6578 — both copies are in the same file, so extract the block into 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 6 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 (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 22 separate duplicated blocks between them, totalling at least 227 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/ddl/fuzz_repartition_table_chaos.rs:204— tests-fuzz/targets/ddl/fuzz_repartition_table_chaos.rs:204-208 | tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:113-117 | tests-fuzz/targets/fuzz_insert_logical_table.rs:144-148 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:112-116 — 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 11 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (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/failover/fuzz_failover_mito_regions.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 31 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
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:820— 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.
operator::insert::fill_table_options_for_create (cyclomatic 18) src/operator/src/insert.rs:1944— operator::insert::fill_table_options_for_create 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.
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:981— 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:530— 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:1815— 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.
Inserter::create_or_alter_tables_on_demand (cognitive 105) src/operator/src/insert.rs:1087— Inserter::create_or_alter_tables_on_demand has cognitive complexity 105 (threshold 15). Drivers by points: if/else 26 (67 pts), loops 10 (23 pts), boolean chains 9, match/switch 3 (6 pts) (nesting depth added 57). To reduce it, split the body into named stages: move each independent 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::validate_and_normalize_otlp_metrics (cognitive 49) src/operator/src/insert/otlp.rs:72— Inserter::validate_and_normalize_otlp_metrics has cognitive complexity 49 (threshold 15). Drivers by points: if/else 17 (29 pts), loops 6 (11 pts), match/switch 3 (7 pts), boolean chains 2 (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.
Inserter::get_alter_table_expr_on_demand (cognitive 40) src/operator/src/insert.rs:1601— 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 17) src/operator/src/bulk_insert.rs:83— Inserter::handle_bulk_insert has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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_row (cognitive 38) src/promql/src/extension_plan/histogram_fold.rs:1240— HistogramFoldStream::evaluate_row has cognitive complexity 38 (threshold 15). Drivers by points: if/else 16 (25 pts), boolean chains 6, loops 2 (4 pts), match/switch 3 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistogramFoldStream::evaluate_fraction (cognitive 33) src/promql/src/extension_plan/histogram_fold.rs:1359— HistogramFoldStream::evaluate_fraction has cognitive complexity 33 (threshold 15). Drivers by points: if/else 15 (23 pts), boolean chains 9, loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HistogramFoldStream::finalize_safe_group (cognitive 22) src/promql/src/extension_plan/histogram_fold.rs:1047— 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:1114— 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 (20 lines × 2) src/frontend/src/instance/otlp/trace_ingest.rs:1465— src/frontend/src/instance/otlp/trace_ingest.rs:1465-1484 | src/frontend/src/instance/otlp/trace_ingest.rs:1635-1654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (20 lines × 2) 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/migration/fuzz_migrate_mito_regions.rs:222— tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:222-241 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:365-384 — 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 4 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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) tests-integration/src/test_util.rs:1102— tests-integration/src/test_util.rs:1102-1121 | tests-integration/src/test_util.rs:1152-1171 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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:267— src/catalog/src/system_schema/information_schema/columns.rs:267-277 | src/catalog/src/system_schema/information_schema/key_column_usage.rs:239-249 | src/catalog/src/system_schema/information_schema/statistics.rs:238-248 | src/catalog/src/system_schema/information_schema/table_constraints.rs:182-192 — 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:672-682 | src/store-api/src/region_engine.rs:685-695 — 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:287-297 | 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–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/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/operator/src/insert.rs:1285— src/operator/src/insert.rs:1285-1293 | src/operator/src/insert.rs:1336-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 (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 11 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (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:342— src/mito2/src/read/series_reader.rs:342-348 | src/mito2/src/read/series_scan.rs:773-780 — 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/servers/src/mysql/handler.rs:885— src/servers/src/mysql/handler.rs:885-892 | src/servers/src/mysql/handler.rs:916-922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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.
Inserter::create_or_alter_tables_on_demand (cyclomatic 48) src/operator/src/insert.rs:1087— Inserter::create_or_alter_tables_on_demand has cyclomatic complexity 48 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Inserter::validate_and_normalize_otlp_metrics (cyclomatic 30) src/operator/src/insert/otlp.rs:72— Inserter::validate_and_normalize_otlp_metrics 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.
Inserter::get_alter_table_expr_on_demand (cyclomatic 21) src/operator/src/insert.rs:1601— 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.
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:774— 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:688— 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:555— 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.
Instance::ingest_trace_spans (cyclomatic 29) src/frontend/src/instance/otlp/trace_ingest.rs:1042— Instance::ingest_trace_spans has cyclomatic complexity 29 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Instance::do_query (cyclomatic 23) src/frontend/src/instance/grpc.rs:64— Instance::do_query 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.
Instance::reconcile_trace_column_types (cyclomatic 19) src/frontend/src/instance/otlp/trace_ingest.rs:2257— 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.
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 19) src/cmd/src/frontend.rs:261— 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 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.
NativeHistogram::quantile_with_info (cognitive 41) src/common/query/src/native_histogram.rs:688— 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:774— 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:555— 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.
flow::batching_mode::frontend_client::flow_write::tracked_query (cognitive 36) src/flow/src/batching_mode/frontend_client/flow_write.rs:72— flow::batching_mode::frontend_client::flow_write::tracked_query has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 6 (11 pts), boolean chains 1, loops 1 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
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.
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:981— 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:1815— 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 22) src/cmd/src/frontend.rs:261— StartCommand::merge_with_cli_options has cognitive complexity 22 (threshold 15). Drivers by points: if/else 20 (22 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:1522— 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:1597— 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:2149— 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::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.
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.
pipeline::etl::parse_with_options (cognitive 19) src/pipeline/src/etl.rs:67— pipeline::etl::parse_with_options 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::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::transform::transformer::greptime::values_to_rows (cognitive 16) src/pipeline/src/etl/transform/transformer/greptime.rs:580— 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:262— src/common/meta/src/key/flow.rs:262-291 | src/common/meta/src/key/flow.rs:358-387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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 — before extracting anything, compare `tests-fuzz/targets/fuzz_insert.rs` and `tests-fuzz/targets/fuzz_insert_logical_table.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 (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:266-287 — 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) src/mito2/src/read/seq_scan.rs:553— src/mito2/src/read/seq_scan.rs:553-574 | src/mito2/src/read/series_scan.rs:491-512 — before extracting anything, compare `src/mito2/src/read/seq_scan.rs` and `src/mito2/src/read/series_scan.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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/common/meta/src/key.rs:964— src/common/meta/src/key.rs:964-977 | src/common/meta/src/key.rs:1680-1691 — both copies are in the same file, so extract the block into 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 (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 (13 lines × 3) 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 — 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 (11–13 lines × 2) src/frontend/src/instance/otlp/trace_ingest.rs:1631— src/frontend/src/instance/otlp/trace_ingest.rs:1631-1643 | src/frontend/src/instance/otlp/trace_ingest.rs:1718-1728 — both copies are in the same file, so extract the block into 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:1024— src/query/src/dist_plan/analyzer.rs:1024-1034 | src/query/src/dist_plan/analyzer.rs:1044-1056 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 2) src/query/src/sql.rs:729— src/query/src/sql.rs:729-741 | src/query/src/sql.rs:1152-1162 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–12 lines × 2) src/catalog/src/system_schema/information_schema/region_peers.rs:190— src/catalog/src/system_schema/information_schema/region_peers.rs:190-201 | src/catalog/src/system_schema/information_schema/tables.rs:257-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 (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/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 (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 (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:153— src/common/meta/src/reconciliation/reconcile_catalog.rs:153-160 | src/common/meta/src/reconciliation/reconcile_database.rs:193-200 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:181-188 | src/common/meta/src/reconciliation/reconcile_table.rs:280-287 — 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 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 (9 lines × 4) src/common/meta/src/reconciliation/reconcile_catalog.rs:57— src/common/meta/src/reconciliation/reconcile_catalog.rs:57-65 | src/common/meta/src/reconciliation/reconcile_database.rs:64-72 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:62-70 | src/common/meta/src/reconciliation/reconcile_table.rs:163-171 — 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 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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/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 — 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) 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 22 separate duplicated blocks between them, totalling at least 227 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.
frontend::instance::check_permission (cyclomatic 48) src/frontend/src/instance.rs:1594— 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:325— 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.
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_row (cyclomatic 25) src/promql/src/extension_plan/histogram_fold.rs:1240— HistogramFoldStream::evaluate_row 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.
HistogramFoldStream::evaluate_fraction (cyclomatic 24) src/promql/src/extension_plan/histogram_fold.rs:1359— HistogramFoldStream::evaluate_fraction 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::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.
MitoRegion::set_role_state_gracefully (cyclomatic 23) src/mito2/src/region.rs:577— MitoRegion::set_role_state_gracefully 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.
MitoRegion::manifest_sst_stream (cyclomatic 17) src/mito2/src/region.rs:916— MitoRegion::manifest_sst_stream 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.
cli::data::import_v2::packed::validate_snapshot (cyclomatic 22) REDACTED:28— cli::data::import_v2::packed::validate_snapshot 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.
cli::data::import_v2::command::iter_ddl_statements (cyclomatic 19) src/cli/src/data/import_v2/command.rs:426— cli::data::import_v2::command::iter_ddl_statements 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.
flow::batching_mode::frontend_client::flow_write::tracked_query (cyclomatic 22) src/flow/src/batching_mode/frontend_client/flow_write.rs:72— flow::batching_mode::frontend_client::flow_write::tracked_query 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.
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.
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.
common_sql::convert::sql_value_to_value (cyclomatic 19) src/common/sql/src/convert.rs:127— common_sql::convert::sql_value_to_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.
common_sql::convert::parse_string_to_value (cyclomatic 16) src/common/sql/src/convert.rs:261— 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.
PreparedMetrics::finish (cyclomatic 19) src/servers/src/otlp/metrics/prepare.rs:392— PreparedMetrics::finish 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.
PreparedMetrics::push_point (cyclomatic 16) src/servers/src/otlp/metrics/prepare.rs:197— PreparedMetrics::push_point 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.
MergeScanExec::to_stream (cognitive 57) src/query/src/dist_plan/merge_scan.rs:617— 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:1202— 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:100— 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.
MitoRegion::manifest_sst_stream (cognitive 35) src/mito2/src/region.rs:916— MitoRegion::manifest_sst_stream has cognitive complexity 35 (threshold 15). Drivers by points: if/else 18 (27 pts), match/switch 2 (5 pts), boolean chains 2, loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MitoRegion::set_role_state_gracefully (cognitive 19) src/mito2/src/region.rs:577— 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.
InvertedIndexer::do_update_flat (cognitive 35) src/mito2/src/sst/index/inverted_index/creator.rs:176— InvertedIndexer::do_update_flat has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (24 pts), loops 4 (8 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InvertedIndexer::do_update (cognitive 18) src/mito2/src/sst/index/inverted_index/creator.rs:314— InvertedIndexer::do_update has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (3 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.
PartitionChecker::remap_checkpoint (cognitive 35) REDACTED:167— 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 27) REDACTED:62— PartitionChecker::run has cognitive complexity 27 (threshold 15). Drivers by points: loops 8 (14 pts), if/else 6 (13 pts) (nesting depth added 13). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PreparedMetrics::finish (cognitive 35) src/servers/src/otlp/metrics/prepare.rs:392— PreparedMetrics::finish has cognitive complexity 35 (threshold 15). Drivers by points: if/else 14 (23 pts), loops 5 (9 pts), boolean chains 3 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PreparedMetrics::push_point (cognitive 24) src/servers/src/otlp/metrics/prepare.rs:197— PreparedMetrics::push_point has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (9 pts), loops 3 (6 pts), boolean chains 5, match/switch 2 (4 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.
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.
PostgresServerHandlerInner::on_startup (cognitive 33) src/servers/src/postgres/auth_handler.rs:269— PostgresServerHandlerInner::on_startup has cognitive complexity 33 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 6 (13 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.
PostgresServerHandlerInner::do_query (cognitive 16) src/servers/src/postgres/handler.rs:76— PostgresServerHandlerInner::do_query has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (13 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, 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.
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.
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:488— 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.
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.
ExportCreate::run (cognitive 23) src/cli/src/data/export_v2/command.rs:485— ExportCreate::run has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (19 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.
ExportCreate::get_schema_objects (cognitive 17) src/cli/src/data/export_v2/command.rs:655— 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.
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.
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.
common_config::tagged_seq::merge_at (cognitive 17) src/common/config/src/tagged_seq.rs:288— common_config::tagged_seq::merge_at has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (10 pts), match/switch 2 (5 pts), loops 1 (2 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
PlanRewriter::should_expand (cognitive 23) src/query/src/dist_plan/analyzer.rs:495— 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:664— 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:427— 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:583— 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.
RegionSupervisor::handle_region_failures (cognitive 22) src/meta-srv/src/region/supervisor.rs:580— 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.
RegionSupervisor::select_peers (cognitive 18) src/meta-srv/src/region/supervisor.rs:674— RegionSupervisor::select_peers has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 4 (8 pts), if/else 4 (6 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
meta_srv::procedure::repartition::allocate_region::collect_allocation_sources (cognitive 21) src/meta-srv/src/procedure/repartition/allocate_region.rs:466— meta_srv::procedure::repartition::allocate_region::collect_allocation_sources has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), loops 4 (10 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
ScanRegion::build_read_col_ids (cognitive 21) src/mito2/src/read/scan_region.rs:633— 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:470— 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.
common_sql::convert::parse_string_to_value (cognitive 19) src/common/sql/src/convert.rs:261— 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.
common_sql::convert::sql_value_to_value (cognitive 16) src/common/sql/src/convert.rs:127— common_sql::convert::sql_value_to_value has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 3, boolean chains 2 (nesting depth added 6). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
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.
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 hub: metrics.rs → ddl.rs, ddl_manager.rs, error.rs src/common/meta/src/metrics.rs— `src/common/meta/src/metrics.rs` changes together with 3 other files — `src/common/meta/src/ddl.rs`, `src/common/meta/src/ddl_manager.rs`, `src/common/meta/src/error.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.
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:39-66 — 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:588— src/flow/src/adapter.rs:588-612 | src/flow/src/adapter.rs:617-641 — both copies are in the same file, so extract the block into 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 (17–18 lines × 2) REDACTED:717— REDACTED:717-733 | REDACTED:544-561 — 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 (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:80— src/catalog/src/system_schema/information_schema/region_info.rs:80-94 | src/catalog/src/system_schema/information_schema/ssts.rs:102-116 | src/catalog/src/system_schema/information_schema/ssts.rs:168-182 | src/catalog/src/system_schema/information_schema/ssts.rs:234-248 — 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 5 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15 lines × 3) src/flow/src/batching_mode/frontend_client.rs:513— src/flow/src/batching_mode/frontend_client.rs:513-527 | src/flow/src/batching_mode/frontend_client.rs:713-727 | src/flow/src/batching_mode/frontend_client.rs:801-815 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 3) src/meta-srv/src/selector/lease_based.rs:73— src/meta-srv/src/selector/lease_based.rs:73-87 | src/meta-srv/src/selector/load_based.rs:105-119 | src/meta-srv/src/selector/round_robin.rs:136-150 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once.
Duplicated block (13–15 lines × 2) src/operator/src/statement/ddl.rs:2556— src/operator/src/statement/ddl.rs:2556-2568 | src/operator/src/statement/ddl.rs:2846-2860 — both copies are in the same file, so extract the block into 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:488— src/promql/src/extension_plan/instant_manipulate.rs:488-502 | src/promql/src/extension_plan/range_manipulate.rs:497-509 — 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 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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:457-467 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (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:197— src/mito2/src/sst/index/fulltext_index/applier/builder.rs:197-205 | src/mito2/src/sst/index/fulltext_index/applier/builder.rs:239-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 (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 (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 (6–7 lines × 2) src/query/src/dist_plan/merge_scan.rs:1131— src/query/src/dist_plan/merge_scan.rs:1131-1137 | src/query/src/dist_plan/merge_scan.rs:1145-1150 — both copies are in the same file, so extract the block into 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:4069— src/query/src/promql/planner.rs:4069-4075 | src/query/src/promql/planner.rs:4079-4084 — both copies are in the same file, so extract the block into 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 × 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/failover/fuzz_failover_metric_regions.rs:284— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:284-294 | tests-fuzz/targets/fuzz_insert_logical_table.rs:285-295 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:418-428 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:376-382 — 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 11 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
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: 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.
Weak hash algorithm src/auth/src/common.rs:511— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
Weak hash algorithm src/auth/src/common.rs:518— MD5/SHA1 is computed here, and both are collision-broken. If this digest protects anything — a signature, an integrity or tamper check, a credential, or any value an attacker can influence — that is a real weakness: use SHA-256+ (`sha2::Sha256::digest(…)`) for content integrity, or a KDF (bcrypt/Argon2/scrypt) for password storage. If it only derives a non-security identifier (a cache key, an avatar URL, an ETag), collision resistance carries no security consequence here; make that intent explicit instead — a non-cryptographic hash such as xxhash or murmurhash says it in code — since the algorithm alone cannot distinguish the two uses. Where a protocol this code does not own fixes the digest (a k-anonymity range query, a legacy signature format), the protocol decides; say so beside the call.
oswal-s3-bench-summary.render (cyclomatic 63) .github/scripts/oswal-s3-bench-summary.py:341— oswal-s3-bench-summary.render has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ScanMetricsSet::fmt (cyclomatic 59) src/mito2/src/read/scan_util.rs:286— ScanMetricsSet::fmt has cyclomatic complexity 59 (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 41) src/query/src/dist_plan/commutativity.rs:97— Categorizer::check_plan 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.
oswal-s3-bench.group_cells (cyclomatic 36) .github/scripts/oswal-s3-bench.py:208— oswal-s3-bench.group_cells has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
sql::util::extract_tables_from_statement (cyclomatic 34) src/sql/src/util.rs:218— 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:1068— 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.
oswal-s3-bench-summary.load_cell (cyclomatic 27) .github/scripts/oswal-s3-bench-summary.py:182— oswal-s3-bench-summary.load_cell 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.
tracesbench-summary.benchmark (cyclomatic 27) .github/scripts/tracesbench-summary.py:69— tracesbench-summary.benchmark 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.
SimplePredicate::cast_timestamp_unit (cyclomatic 26) src/common/recordbatch/src/filter/timestamp.rs:36— SimplePredicate::cast_timestamp_unit 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.
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:617— 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.
oswal-s3-bench-crash.verify (cyclomatic 24) .github/scripts/oswal-s3-bench-crash.py:134— oswal-s3-bench-crash.verify 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.
MetricEngine::handle_request (cyclomatic 22) src/metric-engine/src/engine.rs:211— 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.
WorkerRequest::try_from_region_request (cyclomatic 22) src/mito2/src/request.rs:847— WorkerRequest::try_from_region_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.
ParquetReaderBuilder::build_reader_input_inner (cyclomatic 22) src/mito2/src/sst/parquet/reader.rs:442— 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.
PartitionExpr::try_as_logical_expr (cyclomatic 22) src/partition/src/expr.rs:306— PartitionExpr::try_as_logical_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. This is NOT this file's highest cyclomatic complexity: Operand::try_as_logical_expr (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.
oswal-s3-bench.main (cyclomatic 22) .github/scripts/oswal-s3-bench.py:433— oswal-s3-bench.main 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.
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.
InvertedIndexApplierBuilder::expr_to_index_target (cyclomatic 20) src/mito2/src/sst/index/inverted_index/applier/builder.rs:238— InvertedIndexApplierBuilder::expr_to_index_target has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
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.
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:495— 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:68— 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.
PostgresServerHandlerInner::on_startup (cyclomatic 19) src/servers/src/postgres/auth_handler.rs:269— PostgresServerHandlerInner::on_startup 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.
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:933— 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:85— 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.
Import::run (cyclomatic 17) src/cli/src/data/import_v2/command.rs:209— Import::run 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.
FulltextOptions::try_from (cyclomatic 17) src/datatypes/src/schema/column_schema.rs:804— 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.
MetasrvBuilder::build (cyclomatic 17) src/meta-srv/src/metasrv/builder.rs:213— MetasrvBuilder::build 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.
Metasrv::try_start_after_gc_check (cyclomatic 17) src/meta-srv/src/metasrv.rs:639— 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:777— 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:422— 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:381— 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:977— 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.
ExportCreateCommand::build (cyclomatic 16) src/cli/src/data/export_v2/command.rs:343— ExportCreateCommand::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.
Actor::run (cyclomatic 16) src/log-store/src/object_store_wal/store.rs:1553— Actor::run 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.
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.
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:269— 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.
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.
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:136— 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.4. Run `cargo update -p mysql` and commit the updated lock.
oswal-s3-bench-summary.render (cognitive 119) .github/scripts/oswal-s3-bench-summary.py:341— oswal-s3-bench-summary.render has cognitive complexity 119 (threshold 15). Drivers by points: ternaries 19 (56 pts), loops 13 (26 pts), if/else 19 (25 pts), boolean chains 12 (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.
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 69) src/mito2/src/read/scan_util.rs:286— ScanMetricsSet::fmt has cognitive complexity 69 (threshold 15). Drivers by points: if/else 49 (58 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.
tracesbench-summary.benchmark (cognitive 63) .github/scripts/tracesbench-summary.py:69— tracesbench-summary.benchmark has cognitive complexity 63 (threshold 15). Drivers by points: if/else 8 (24 pts), ternaries 6 (23 pts), loops 5 (9 pts), boolean chains 7 (nesting depth added 37). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oswal-s3-bench.group_cells (cognitive 57) .github/scripts/oswal-s3-bench.py:208— oswal-s3-bench.group_cells has cognitive complexity 57 (threshold 15). Drivers by points: if/else 13 (19 pts), ternaries 9 (19 pts), loops 4 (10 pts), boolean chains 9 (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.
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:777— 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.
oswal-s3-bench-summary.load_cell (cognitive 39) .github/scripts/oswal-s3-bench-summary.py:182— oswal-s3-bench-summary.load_cell has cognitive complexity 39 (threshold 15). Drivers by points: ternaries 14 (23 pts), if/else 7 (11 pts), boolean chains 3, loops 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.
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:237— 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:325— 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.
oswal-s3-bench-summary.ratios (cognitive 35) .github/scripts/oswal-s3-bench-summary.py:268— oswal-s3-bench-summary.ratios has cognitive complexity 35 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 4 (10 pts), ternaries 2 (9 pts), boolean chains 2 (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.
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.
oswal-s3-bench-crash.verify (cognitive 32) .github/scripts/oswal-s3-bench-crash.py:134— oswal-s3-bench-crash.verify has cognitive complexity 32 (threshold 15). Drivers by points: if/else 14 (20 pts), loops 5 (8 pts), boolean chains 4 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
Categorizer::check_plan (cognitive 31) src/query/src/dist_plan/commutativity.rs:97— Categorizer::check_plan has cognitive complexity 31 (threshold 15). Drivers by points: if/else 12 (22 pts), boolean chains 4, loops 2 (4 pts), match/switch 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
agent-observability-summary.benchmark (cognitive 31) .github/scripts/agent-observability-summary.py:85— 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.
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.
Metasrv::try_start_after_gc_check (cognitive 30) src/meta-srv/src/metasrv.rs:639— 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.
benchmark_resource_summary.render_resources (cognitive 30) .github/scripts/benchmark_resource_summary.py:66— benchmark_resource_summary.render_resources has cognitive complexity 30 (threshold 15). Drivers by points: ternaries 4 (14 pts), if/else 2 (6 pts), loops 3 (6 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.
CountdownTask::run (cognitive 29) src/datanode/src/alive_keeper.rs:414— 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:933— 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.
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:1885— 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:1702— 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:442— 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.
MetasrvBuilder::build (cognitive 27) src/meta-srv/src/metasrv/builder.rs:213— MetasrvBuilder::build has cognitive complexity 27 (threshold 15). Drivers by points: if/else 20 (22 pts), match/switch 3, boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
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:433— 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:563— 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.
Import::run (cognitive 26) src/cli/src/data/import_v2/command.rs:209— Import::run has cognitive complexity 26 (threshold 15). Drivers by points: if/else 15 (17 pts), loops 2 (5 pts), boolean chains 2, match/switch 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.
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.
ObjectStoreLogStore::read (cognitive 25) src/log-store/src/object_store_wal/store.rs:962— ObjectStoreLogStore::read has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (14 pts), match/switch 3 (7 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.
LocalGcWorker::do_region_gc (cognitive 25) src/mito2/src/gc.rs:422— 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.
FlatLastNonNull::dedup_by_partitions (cognitive 25) src/mito2/src/read/flat_dedup.rs:478— FlatLastNonNull::dedup_by_partitions has cognitive complexity 25 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 2 (5 pts), boolean chains 4 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
oswal-s3-bench-summary.image_ratios (cognitive 25) .github/scripts/oswal-s3-bench-summary.py:294— oswal-s3-bench-summary.image_ratios has cognitive complexity 25 (threshold 15). Drivers by points: ternaries 5 (15 pts), boolean chains 4, if/else 2 (3 pts), loops 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
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:136— 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.
oswal-s3-bench.main (cognitive 24) .github/scripts/oswal-s3-bench.py:433— oswal-s3-bench.main has cognitive complexity 24 (threshold 15). Drivers by points: if/else 6 (10 pts), loops 7 (8 pts), boolean chains 4, ternaries 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.
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.
SimplePredicate::cast_timestamp_unit (cognitive 23) src/common/recordbatch/src/filter/timestamp.rs:36— SimplePredicate::cast_timestamp_unit has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (16 pts), match/switch 3 (5 pts), loops 1 (2 pts) (nesting depth added 12). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
benchmark-version-comparison.traces (cognitive 23) .github/scripts/benchmark-version-comparison.py:84— benchmark-version-comparison.traces has cognitive complexity 23 (threshold 15). Drivers by points: if/else 3 (9 pts), boolean chains 8, loops 2 (3 pts), ternaries 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:1065— 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.
InvertedIndexApplierBuilder::expr_to_index_target (cognitive 22) src/mito2/src/sst/index/inverted_index/applier/builder.rs:238— InvertedIndexApplierBuilder::expr_to_index_target has cognitive complexity 22 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 4 (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.
WriteRetry::retry (cognitive 22) src/operator/src/write_dispatcher.rs:398— WriteRetry::retry has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 2 (4 pts), loops 2 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
KafkaLogStore::read (cognitive 21) src/log-store/src/kafka/log_store.rs:308— KafkaLogStore::read has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (20 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::prepare_or_submit_compaction (cognitive 21) src/mito2/src/compaction/scheduler/planning.rs:433— CompactionScheduler::prepare_or_submit_compaction has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (18 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.
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:1070— 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:413— 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.
benchmark-version-comparison.long_range (cognitive 21) .github/scripts/benchmark-version-comparison.py:113— benchmark-version-comparison.long_range has cognitive complexity 21 (threshold 15). Drivers by points: ternaries 4 (10 pts), loops 3 (6 pts), boolean chains 5 (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.
OpenDalStorage::prepare_export_chunk (cognitive 20) src/cli/src/data/snapshot_storage.rs:748— 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.
FlatProjectionMapper::convert (cognitive 20) src/mito2/src/read/flat_projection.rs:310— FlatProjectionMapper::convert has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (16 pts), boolean chains 3, 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.
FlatLastTimestampSelector::on_next (cognitive 20) src/mito2/src/read/last_row.rs:291— FlatLastTimestampSelector::on_next has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), loops 2, match/switch 1 (2 pts), boolean chains 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileMeta::is_index_consistent_with_region (cognitive 20) src/mito2/src/sst/file.rs:463— FileMeta::is_index_consistent_with_region has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (12 pts), boolean chains 7, 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.
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:257— 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.
TraceChunkRetry::try_new (cognitive 19) src/frontend/src/instance/otlp/trace_ingest.rs:384— 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:1120— 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.
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.
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.
Json2Options::fmt (cognitive 19) src/sql/src/statements/create.rs:180— Json2Options::fmt has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (12 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.
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.
ExportCreateCommand::build (cognitive 18) src/cli/src/data/export_v2/command.rs:343— ExportCreateCommand::build has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 2 (nesting depth added 2). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
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:804— 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.
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:1105— 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:1050— 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:507— 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.
IndexerBuilderImpl::collect_json_inverted_index_targets (cognitive 18) src/mito2/src/sst/index.rs:592— IndexerBuilderImpl::collect_json_inverted_index_targets has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (3 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.
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:861— 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:269— 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:68— 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.
WindowedSortPhysicalRule::do_optimize (cognitive 18) src/query/src/optimizer/windowed_sort.rs:68— WindowedSortPhysicalRule::do_optimize has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
oswal-s3-bench-summary.parse_metrics (cognitive 18) .github/scripts/oswal-s3-bench-summary.py:40— oswal-s3-bench-summary.parse_metrics has cognitive complexity 18 (threshold 15). Drivers by points: if/else 5 (10 pts), boolean chains 7, 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.
common_base::term_token::for_each_word_run (cognitive 17) src/common/base/src/term_token.rs:89— common_base::term_token::for_each_word_run has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
DatanodeBuilder::build_inner (cognitive 17) src/datanode/src/datanode.rs:317— DatanodeBuilder::build_inner has cognitive complexity 17 (threshold 15). Drivers by points: if/else 13 (14 pts), boolean chains 3 (nesting depth added 1). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Consumer::poll_next (cognitive 17) src/log-store/src/kafka/consumer.rs:192— 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.
Actor::on_delete_completed (cognitive 17) src/log-store/src/object_store_wal/store.rs:2560— Actor::on_delete_completed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 2 (4 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.
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.
MultiDimPartitionRule::split_record_batch (cognitive 17) src/partition/src/multi_dim.rs:259— MultiDimPartitionRule::split_record_batch has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9, loops 2 (4 pts), match/switch 3, 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.
RangeManipulateStream::manipulate (cognitive 17) src/promql/src/extension_plan/range_manipulate.rs:684— RangeManipulateStream::manipulate has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (11 pts), match/switch 1 (3 pts), loops 2, 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.
IDelta::calc (cognitive 17) src/promql/src/functions/idelta.rs:63— IDelta::calc has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 1 (3 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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:211— 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.
session::query_options::parse_query_option (cognitive 17) src/session/src/query_options.rs:37— session::query_options::parse_query_option has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (8 pts), match/switch 4 (7 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.
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.
tracesbench-summary.lifecycle (cognitive 17) .github/scripts/tracesbench-summary.py:122— tracesbench-summary.lifecycle has cognitive complexity 17 (threshold 15). Drivers by points: ternaries 2 (6 pts), if/else 2 (5 pts), boolean chains 3, 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.
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.
StateMergeHelper::split_aggr_node (cognitive 16) src/common/function/src/aggrs/aggr_wrapper.rs:171— StateMergeHelper::split_aggr_node has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (10 pts), loops 2 (4 pts), 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.
MatchesTermFunction::invoke_with_args (cognitive 16) src/common/function/src/scalars/matches_term.rs:115— 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:297— 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:946— 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:723— 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:197— 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:211— 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:555— 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:596— 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.
metric-snapshot-s3-ops.scrub (cognitive 16) .github/scripts/metric-snapshot-s3-ops.py:127— metric-snapshot-s3-ops.scrub has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (8 pts), loops 2 (4 pts), ternaries 1 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
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.
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-623 — 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:935— src/mito2/src/engine.rs:935-979 | src/mito2/src/engine.rs:1032-1095 — 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:163— src/catalog/src/system_schema/information_schema/cluster_info.rs:163-181 | src/catalog/src/system_schema/information_schema/columns.rs:184-202 | src/catalog/src/system_schema/information_schema/key_column_usage.rs:171-189 | src/catalog/src/system_schema/information_schema/partitions.rs:191-209 | src/catalog/src/system_schema/information_schema/procedure_info.rs:121-139 | src/catalog/src/system_schema/information_schema/recycle_bin.rs:142-160 | src/catalog/src/system_schema/information_schema/region_peers.rs:129-147 | src/catalog/src/system_schema/information_schema/region_statistics.rs:162-182 | src/catalog/src/system_schema/information_schema/schemata.rs:117-135 | src/catalog/src/system_schema/information_schema/statistics.rs:158-176 | src/catalog/src/system_schema/information_schema/table_constraints.rs:126-144 — 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-1200 | src/table/src/metadata.rs:1206-1271 | src/table/src/metadata.rs:1325-1376 | src/table/src/metadata.rs:1382-1419 — 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:765— src/common/meta/src/key.rs:765-826 | src/common/meta/src/key.rs:835-908 | src/common/meta/src/key.rs:1495-1547 | src/common/meta/src/key.rs:1557-1592 | src/common/meta/src/key.rs:1712-1761 | 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 (38–39 lines × 2) src/mito2/src/worker/handle_write.rs:340— src/mito2/src/worker/handle_write.rs:340-378 | src/mito2/src/worker/handle_write.rs:497-534 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
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 (32–35 lines × 2) src/mito2/src/worker/handle_write.rs:390— src/mito2/src/worker/handle_write.rs:390-424 | src/mito2/src/worker/handle_write.rs:536-567 — both copies are in the same file, so extract the block into 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:977— src/mito2/src/sst/parquet/reader.rs:977-1007 | src/mito2/src/sst/parquet/reader.rs:1238-1267 — both copies are in the same file, so extract the block into 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:1240-1267 — 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:182— src/common/meta/src/reconciliation/reconcile_catalog.rs:182-208 | src/common/meta/src/reconciliation/reconcile_database.rs:222-248 | src/common/meta/src/reconciliation/reconcile_logical_tables.rs:198-224 | src/common/meta/src/reconciliation/reconcile_table.rs:309-335 — 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 3 separate duplicated blocks between them, totalling at least 44 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 (22–25 lines × 2) src/cache/src/lib.rs:75— src/cache/src/lib.rs:75-96 | src/cache/src/lib.rs:138-162 — both copies are in the same file, so extract the block into 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–24 lines × 2) src/operator/src/expr_helper.rs:356— src/operator/src/expr_helper.rs:356-379 | src/query/src/sql/show_create_table.rs:151-170 — 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–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:1218— src/query/src/promql/planner.rs:1218-1240 | src/query/src/promql/planner.rs:1287-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 (23 lines × 2) src/servers/src/postgres/types.rs:1266— src/servers/src/postgres/types.rs:1266-1288 | src/servers/src/postgres/types.rs:1369-1391 — both copies are in the same file, so extract the block into 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:68-89 — `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:1584— src/mito2/src/flush.rs:1584-1603 | src/mito2/src/flush.rs:1624-1644 — both copies are in the same file, so extract the block into 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:1208— src/servers/src/otlp/metrics.rs:1208-1225 | src/servers/src/otlp/metrics.rs:1233-1253 — both copies are in the same file, so extract the block into 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:697-715 | src/mito2/src/sst/index/inverted_index/applier.rs:297-312 — `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 (16–19 lines × 2) src/servers/src/otlp/metrics.rs:1358— src/servers/src/otlp/metrics.rs:1358-1376 | src/servers/src/otlp/metrics.rs:1384-1399 — both copies are in the same file, so extract the block into 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 × 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:649— src/servers/src/postgres/types.rs:649-664 | src/servers/src/postgres/types.rs:693-708 | src/servers/src/postgres/types.rs:740-755 | src/servers/src/postgres/types.rs:808-824 | src/servers/src/postgres/types.rs:859-875 — 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 (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:69-85 — `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 (16–17 lines × 2) src/log-store/src/raft_engine/log_store.rs:366— src/log-store/src/raft_engine/log_store.rs:366-382 | src/log-store/src/raft_engine/log_store.rs:400-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–16 lines × 4) src/servers/src/otlp/metrics.rs:1207— src/servers/src/otlp/metrics.rs:1207-1221 | src/servers/src/otlp/metrics.rs:1232-1246 | src/servers/src/otlp/metrics.rs:1358-1372 | src/servers/src/otlp/metrics.rs:1384-1399 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (12–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–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:224— src/catalog/src/system_schema/information_schema/region_peers.rs:224-231 | src/catalog/src/system_schema/information_schema/tables.rs:301-313 — 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–13 lines × 2) src/frontend/src/instance.rs:319— src/frontend/src/instance.rs:319-331 | src/frontend/src/instance.rs:648-656 — both copies are in the same file, so extract the block into 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 × 11) src/catalog/src/system_schema/information_schema/cluster_info.rs:171— src/catalog/src/system_schema/information_schema/cluster_info.rs:171-181 | src/catalog/src/system_schema/information_schema/columns.rs:192-202 | src/catalog/src/system_schema/information_schema/key_column_usage.rs:179-189 | src/catalog/src/system_schema/information_schema/partitions.rs:199-209 | src/catalog/src/system_schema/information_schema/procedure_info.rs:129-139 | src/catalog/src/system_schema/information_schema/recycle_bin.rs:150-160 | src/catalog/src/system_schema/information_schema/region_peers.rs:137-147 | src/catalog/src/system_schema/information_schema/region_statistics.rs:171-182 | src/catalog/src/system_schema/information_schema/schemata.rs:125-135 | src/catalog/src/system_schema/information_schema/statistics.rs:166-176 | src/catalog/src/system_schema/information_schema/table_constraints.rs:134-144 — 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:682— src/servers/src/postgres/types.rs:682-690 | src/servers/src/postgres/types.rs:726-735 | src/servers/src/postgres/types.rs:792-801 | src/servers/src/postgres/types.rs:843-852 — 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–10 lines × 2) src/frontend/src/instance.rs:333— src/frontend/src/instance.rs:333-342 | src/frontend/src/instance.rs:916-923 — both copies are in the same file, so extract the block into 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 (9 lines × 5) src/catalog/src/system_schema/information_schema/flow_statistics.rs:140— src/catalog/src/system_schema/information_schema/flow_statistics.rs:140-148 | src/catalog/src/system_schema/information_schema/flows.rs:227-235 | src/catalog/src/system_schema/information_schema/table_semantics.rs:269-277 | src/catalog/src/system_schema/information_schema/tables.rs:173-181 | src/catalog/src/system_schema/information_schema/views.rs:136-144 — 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 (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:1117— src/common/query/src/native_histogram.rs:1117-1122 | src/servers/src/otlp/metrics.rs:815-823 — 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:1174-1181 | src/table/src/metadata.rs:1249-1256 | src/table/src/metadata.rs:1361-1368 | src/table/src/metadata.rs:1404-1411 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6–7 lines × 5) src/servers/src/postgres/types.rs:640— src/servers/src/postgres/types.rs:640-645 | src/servers/src/postgres/types.rs:681-687 | src/servers/src/postgres/types.rs:725-731 | src/servers/src/postgres/types.rs:791-797 | src/servers/src/postgres/types.rs:842-848 — 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:1745— src/query/src/promql/planner.rs:1745-1749 | src/query/src/promql/planner.rs:6274-6280 | src/query/src/promql/planner.rs:6568-6573 — 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 (4–6 lines × 3) REDACTED:850— REDACTED:850-855 | REDACTED:869-872 | REDACTED:882-887 — 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/timestamp.rs:29— src/common/recordbatch/src/filter/timestamp.rs:29-33 | src/mito2/src/compaction/reader.rs:238-240 | src/query/src/promql/label_values.rs:69-73 — 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 (7 lines × 6) src/common/meta/src/key.rs:806— src/common/meta/src/key.rs:806-812 | src/common/meta/src/key.rs:888-894 | src/common/meta/src/key.rs:1534-1540 | src/common/meta/src/key.rs:1580-1586 | src/common/meta/src/key.rs:1748-1754 | 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.
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 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/failover/fuzz_failover_mito_regions.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (28–29 lines × 2) tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:194— tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:194-221 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:336-364 — 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 4 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (25–27 lines × 2) tests-integration/src/test_util.rs:1187— tests-integration/src/test_util.rs:1187-1213 | tests-integration/src/test_util.rs:1233-1257 — both copies are in the same file, so extract the block into 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:313-333 — 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 7 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. If that is what happened, the fix is to keep one copy and have the other call 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 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 5 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (15–18 lines × 2) tests-integration/src/test_util.rs:1083— tests-integration/src/test_util.rs:1083-1100 | tests-integration/src/test_util.rs:1136-1150 — both copies are in the same file, so extract the block into 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 (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 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–13 lines × 4) tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:206— tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:206-218 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:229-238 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:348-360 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:372-381 — 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 4 separate duplicated blocks between them, totalling at least 68 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. 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–12 lines × 3) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:283— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:283-294 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:417-428 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:375-382 — 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 22 separate duplicated blocks between them, totalling at least 227 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 11 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (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_alter_table.rs` and `tests-fuzz/targets/ddl/fuzz_create_table.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 (6–9 lines × 6) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:274— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:274-279 | tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:282-290 | tests-fuzz/targets/failover/fuzz_failover_mito_regions.rs:339-344 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:408-413 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:416-424 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:374-379 — before extracting anything, compare `tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs` and `tests-fuzz/targets/failover/fuzz_failover_mito_regions.rs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 46 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (8–9 lines × 3) tests-fuzz/targets/ddl/fuzz_repartition_metric_table.rs:178— tests-fuzz/targets/ddl/fuzz_repartition_metric_table.rs:178-186 | tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:199-206 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:206-213 — 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 22 separate duplicated blocks between them, totalling at least 227 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 (8 lines × 5) tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:165— tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:165-172 | tests-fuzz/targets/fuzz_insert.rs:140-147 | tests-fuzz/targets/fuzz_insert_logical_table.rs:209-216 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:164-171 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:286-293 — 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 11 separate duplicated blocks between them, totalling at least 101 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (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:212-214 — 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 6 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 (5–8 lines × 2) tests-fuzz/targets/ddl/fuzz_create_table.rs:96— tests-fuzz/targets/ddl/fuzz_create_table.rs:96-103 | tests-fuzz/targets/ddl/fuzz_repartition_table.rs:253-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 (6 lines × 11) 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_create_logical_table.rs:86-91 | tests-fuzz/targets/ddl/fuzz_create_table.rs:94-99 | 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.rs:131-136 | tests-fuzz/targets/fuzz_insert_logical_table.rs:142-147 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:110-115 | tests-fuzz/targets/migration/fuzz_migrate_mito_regions.rs:300-305 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:256-261 — 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 6 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 (6 lines × 5) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:156— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:156-161 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:130-135 | tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:203-208 | tests-fuzz/targets/fuzz_insert_logical_table.rs:250-255 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:210-215 — 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 9 separate duplicated blocks between them, totalling at least 107 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–6 lines × 2) tests-fuzz/targets/ddl/fuzz_create_table.rs:112— tests-fuzz/targets/ddl/fuzz_create_table.rs:112-116 | tests-fuzz/targets/fuzz_insert.rs:204-209 — 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 4 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. 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 × 14) tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:125— tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:125-129 | tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:156-160 | tests-fuzz/targets/ddl/fuzz_alter_logical_table.rs:180-184 | tests-fuzz/targets/ddl/fuzz_alter_table.rs:231-235 | tests-fuzz/targets/ddl/fuzz_alter_table.rs:250-254 | tests-fuzz/targets/ddl/fuzz_create_database.rs:76-80 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:87-91 | tests-fuzz/targets/ddl/fuzz_create_logical_table.rs:130-134 | tests-fuzz/targets/ddl/fuzz_create_table.rs:95-99 | tests-fuzz/targets/ddl/fuzz_repartition_table.rs:252-256 | tests-fuzz/targets/failover/fuzz_failover_metric_regions.rs:112-116 | tests-fuzz/targets/fuzz_insert_logical_table.rs:143-147 | tests-fuzz/targets/migration/fuzz_migrate_metric_regions.rs:111-115 | tests-fuzz/targets/wal/fuzz_remote_wal_logical_prune.rs:257-262 — 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 6 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.
Orphaned file src/datatypes/src/vectors/decimal.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/common/function/src/scalars/primary_key.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/sql/src/statements/transform/expand_interval.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/index/src/inverted_index/search/index_apply/predicates_apply.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/common/decimal/src/decimal128.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/pipeline/src/etl/processor/digest.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/index/src/inverted_index/search/fst_apply/intersection_apply.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/puffin/src/puffin_manager/tests.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/puffin/src/puffin_manager/fs_puffin_manager/reader.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/index/src/fulltext_index/create/tantivy.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/partition/src/subtask.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/cli/src/data/storage_export.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/partition/src/overlap.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/puffin/src/blob_metadata.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/index/src/inverted_index/search/fst_apply/keys_apply.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/common/macro/src/stack_trace_debug.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/common/function/src/aggrs/approximate/hll.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/common/meta/src/kv_backend/read_only.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/index/src/inverted_index/format/writer/blob.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/common/stat/src/cgroups.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/mito2/src/schedule/scheduler.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/datatypes/src/types/cast.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/index/src/inverted_index/format/reader/blob.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/common/base/src/range_read.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file src/catalog/src/system_schema/information_schema/procedure_info.rs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Interpolated log message defeats structured logging src/servers/src/addrs.rs:33— `warn!` at line 33 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/elasticsearch.rs:133— `debug!` at line 133 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/elasticsearch.rs:358— `debug!` at line 358 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/grpc.rs:109— `info!` at line 109 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/grpc.rs:113— `error!` at line 113 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/grpc.rs:387— `info!` at line 387 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/grpc.rs:412— `warn!` at line 412 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `warn!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/http.rs:1655— `info!` at line 1655 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/http.rs:1706— `info!` at line 1706 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/otel_arrow.rs:131— `error!` at line 131 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/server.rs:103— `info!` at line 103 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/server.rs:126— `info!` at line 126 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/server.rs:175— `error!` at line 175 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/server.rs:180— `info!` at line 180 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/server.rs:207— `info!` at line 207 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/postgres/handler.rs:854— `debug!` at line 854 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/postgres/handler.rs:855— `info!` at line 855 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/postgres/server.rs:108— `debug!` at line 108 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/postgres/server.rs:112— `debug!` at line 112 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/postgres/utils.rs:27— `debug!` at line 27 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/postgres/copy_in/mod.rs:534— `info!` at line 534 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `info!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/mysql/handler.rs:316— `debug!` at line 316 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/mysql/handler.rs:342— `debug!` at line 342 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/mysql/handler.rs:347— `debug!` at line 347 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `debug!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Interpolated log message defeats structured logging src/servers/src/mysql/handler.rs:482— `error!` at line 482 is handed a format string with `{…}` values in it, so tracing records one finished `message` field — the values in it cannot be queried, filtered or aggregated as fields, and every occurrence reads as a different message. Record the values as fields beside a constant message instead: `error!(order_id = %order_id, status = ?status, "order status updated")` (`%` records a value by its `Display`, `?` by its `Debug`, a bare name as itself), which a JSON subscriber, OpenTelemetry or a log store keeps as queryable keys. An error goes in as a field too: `error = %err`.
Classify ADR enforcement: Summary docs/rfcs/2022-12-20-promql-in-rust/rfc.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2023-01-03-procedure-framework.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Table Compaction docs/rfcs/2023-02-01-table-compaction.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2023-03-08-region-fault-tolerance.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2023-05-09-distributed-planner.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2023-07-06-table-engine-refactor.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2023-07-10-metric-engine.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2023-08-04-table-trait-refactor.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2023-08-13-metadata-txn.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2023-11-03-inverted-index.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2023-11-07-region-migration.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2023-12-22-enclose-column-id.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2024-01-17-dataflow-framework.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2024-08-06-json-datatype.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2025-02-06-remote-wal-purge.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2025-06-20-repartition.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2025-07-04-compatibility-test-framework.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Global GC Worker docs/rfcs/2025-07-23-global-gc-worker.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2025-08-16-async-index-build.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: laminar Flow docs/rfcs/2025-09-08-laminar-flow.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2025-12-05-vector-index.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2025-12-30-export-import-v2.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2026-03-16-flow-inc-query.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2026-05-28-table-semantic-layer.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Classify ADR enforcement: Summary docs/rfcs/2026-06-25-entity-relationships-and-graph-query.md— This record carries no `enforcement:` field, so nothing says whether the decision is checked by anything or is upheld by convention alone — and an unclassified record is counted as UNENFORCED in this dimension's score, which is the same bucket as a rule known to have no check behind it. If this is a mechanizable rule, add an analyzer/test (or `enforcement: analyzer|test`); if it's a design decision, mark `enforcement: not-applicable` so it isn't counted as unenforced.
Duplicated predicate .github/runner-scale-sets/query-regression/ecs-image/build-ecs-image.py:192— `instances and instances[0].status == wanted` appears character-identically in 2 files — .github/runner-scale-sets/query-regression/ecs-image/build-ecs-image.py, .github/scripts/aliyun-ecs-runner-provision.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 .github/scripts/agent-observability-summary.py:76— `isinstance(v, (int, float)) and math.isfinite(v)` appears character-identically in 2 files — .github/scripts/agent-observability-summary.py, .github/scripts/tracesbench-summary.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 .github/scripts/benchmark-version-comparison.py:50— `isinstance(value, (int, float)) and not isinstance(value, bool) and math.isfinite(value) and value >= 0` appears character-identically in 2 files — .github/scripts/benchmark-version-comparison.py, .github/scripts/benchmark_resource_summary.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 .github/scripts/aliyun-ecs-runner-provision.py:253— `not access_key_id or not access_key_secret` appears character-identically in 2 files — .github/scripts/aliyun-ecs-runner-provision.py, .github/scripts/aliyun-ecs-runner-teardown.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 .github/scripts/agent-observability-summary.py:27— `not isinstance(ms, (int, float)) or not math.isfinite(ms) or ms < 0` appears character-identically in 2 files — .github/scripts/agent-observability-summary.py, .github/scripts/tracesbench-summary.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 src/mito2/src/engine.rs:791— `!edit.files_to_add.is_empty() || !edit.files_to_remove.is_empty()` appears character-identically in 2 files — src/mito2/src/engine.rs, src/mito2/src/region/version.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/datanode/src/greptimedb_telemetry.rs:59— `!enable || cfg!(test) || cfg!(debug_assertions)` appears character-identically in 2 files — src/datanode/src/greptimedb_telemetry.rs, src/meta-srv/src/greptimedb_telemetry.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/common/meta/src/ddl/drop_flow.rs:88— `!exists && self.data.task.drop_if_exists` appears character-identically in 2 files — src/common/meta/src/ddl/drop_flow.rs, src/common/meta/src/ddl/drop_view.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/common/meta/src/kv_backend/etcd.rs:500— `!tls_config.cert_path.is_empty() && !tls_config.key_path.is_empty()` appears character-identically in 3 files — src/common/meta/src/kv_backend/etcd.rs, src/common/meta/src/kv_backend/rds/postgres.rs, src/meta-srv/src/utils/mysql.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/common/function/src/scalars/vector/impl_conv.rs:69— `!trimmed.starts_with('[') || !trimmed.ends_with(']')` appears character-identically in 2 files — src/common/function/src/scalars/vector/impl_conv.rs, src/datatypes/src/types/vector_type.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/promql/src/functions/changes.rs:56— `current != previous && !(current.is_nan() && previous.is_nan())` appears character-identically in 2 files — src/promql/src/functions/changes.rs, src/promql/src/functions/native_histogram.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/common/function/src/scalars/anomaly/iqr.rs:127— `current_idx >= array.len() || !array.is_valid(current_idx) || !array.value(current_idx).is_finite()` appears character-identically in 3 files — src/common/function/src/scalars/anomaly/iqr.rs, src/common/function/src/scalars/anomaly/mad.rs, src/common/function/src/scalars/anomaly/zscore.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/mito2/src/series_index/writer.rs:301— `end < primary_keys.len() && primary_keys.value(end) == primary_key` appears character-identically in 2 files — src/mito2/src/series_index/writer.rs, src/mito2/src/sst/range_index/writer.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/meta-srv/src/procedure/region_migration/downgrade_leader_region.rs:356— `err.is_retryable() && retry < self.optimistic_retry` appears character-identically in 2 files — src/meta-srv/src/procedure/region_migration/downgrade_leader_region.rs, src/meta-srv/src/procedure/region_migration/upgrade_candidate_region.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/servers/src/http/prometheus.rs:703— `err.status_code() == StatusCode::TableNotFound || err.status_code() == StatusCode::TableColumnNotFound` appears character-identically in 2 files — src/servers/src/http/prometheus.rs, src/servers/src/http/result/prometheus_resp.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/mito2/src/sst/index.rs:614— `hint.data_type.is_numeric() || hint.data_type.is_boolean() || hint.data_type.is_string()` appears character-identically in 2 files — src/mito2/src/sst/index.rs, src/mito2/src/sst/index/inverted_index/applier/builder.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/mito2/src/read/seq_scan.rs:91— `input.append_mode && input.total_rows_is_exact()` appears character-identically in 3 files — src/mito2/src/read/seq_scan.rs, src/mito2/src/read/series_scan.rs, src/mito2/src/read/unordered_scan.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/mito2/src/manifest/manager.rs:705— `is_delta_file(file_name) || is_checkpoint_file(file_name)` appears character-identically in 3 files — src/mito2/src/manifest/manager.rs, src/mito2/src/manifest/storage.rs, src/mito2/src/test_util.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/servers/src/hint_headers.rs:64— `key.eq_ignore_ascii_case("query_parallelism") && value == "0"` appears character-identically in 2 files — src/servers/src/hint_headers.rs, src/session/src/context.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/servers/src/hint_headers.rs:32— `key_lower.starts_with("query.") || key_lower.starts_with("datafusion.")` appears character-identically in 2 files — src/servers/src/hint_headers.rs, src/session/src/query_options.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/datatypes/src/arrow_array.rs:160— `key_type.is_integer() && value_type.is_string()` appears character-identically in 2 files — src/datatypes/src/arrow_array.rs, src/metric-engine/src/batch_modifier.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/common/meta/src/key/table_repart.rs:355— `new_value.src_to_dst.is_empty() && current.is_none()` appears character-identically in 2 files — src/common/meta/src/key/table_repart.rs, src/meta-srv/src/gc/procedure.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/meta-srv/src/selector/lease_based.rs:78— `opts.affinity.is_some() && ctx.affinity_fallback == AffinityFallback::Unconstrained && available < required` appears character-identically in 3 files — src/meta-srv/src/selector/lease_based.rs, src/meta-srv/src/selector/load_based.rs, src/meta-srv/src/selector/round_robin.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/common/meta/src/ddl/alter_logical_tables/validator.rs:52— `pair[0].catalog_name == pair[1].catalog_name && pair[0].schema_name == pair[1].schema_name` appears character-identically in 2 files — src/common/meta/src/ddl/alter_logical_tables/validator.rs, src/common/meta/src/reconciliation/reconcile_logical_tables/reconciliation_start.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate src/sql/src/parsers/create_parser.rs:1024— `parser.peek_token().token && word.value.eq_ignore_ascii_case(INVERTED)` appears character-identically in 2 files — src/sql/src/parsers/create_parser.rs, src/sql/src/parsers/create_parser/json.rs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 53 significant file(s) lose their only recent owner: src/common/meta/src/reconciliation/utils.rs, src/partition/src/utils/split.rs, src/operator/src/req_convert/common/partitioner.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/common/telemetry/src/logging/file_retention.rs, src/meta-srv/src/procedure/repartition/group.rs (+45 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, 31 significant file(s) lose their only recent owner: src/log-store/src/object_store_wal/store.rs, src/cli/src/data/export_v2/command.rs, src/cli/src/data/snapshot_storage.rs, src/log-store/src/object_store_wal/format.rs, src/operator/src/statement/export_logical_tables/tests.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 (+23 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 12 significant file(s) lose their only recent owner: src/mito2/src/series_index/tests.rs, src/mito2/src/series_index/task.rs, src/mito2/src/series_index/bucket.rs, src/mito2/src/series_index/builder.rs, src/cmd/src/datanode/parquet_rewrite.rs, src/mito2/src/series_index/maintenance.rs, src/mito2/src/series_index/catalog.rs, src/cmd/src/datanode/parquet_meta.rs (+4 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #5 — If anonymized user #5 becomes unavailable, 12 significant file(s) lose their only recent owner: src/common/function/src/uddsketch_compat.rs, REDACTED, src/mito2/src/compaction/last_non_null.rs, src/mito2/src/compaction/scheduler/planning.rs, src/mito2/src/compaction/scheduler/state.rs, src/common/function/src/scalars/ai.rs, src/mito2/src/compaction/overlap.rs, src/mito2/src/compaction/picker.rs (+4 more). 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/operator/src/statement/semantic_graph/relationships.rs, src/operator/src/statement/semantic_graph.rs, src/catalog/src/system_schema/semantic_graph.rs, src/common/function/src/scalars/json/json_object.rs, src/cmd/src/user.rs, scripts/check-enterprise-license.py, src/promql/src/functions/vector_matching.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, 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 #9 — If anonymized user #9 becomes unavailable, 4 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. Pair on, review, or document these before any departure.
D20 · ADR Quality· ADR has no Decision and Consequences section · ×9
ADR has no Decision and Consequences section docs/rfcs/2022-12-20-promql-in-rust/rfc.md:11— docs/rfcs/2022-12-20-promql-in-rust/rfc.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/rfcs/2023-01-03-procedure-framework.md:11— docs/rfcs/2023-01-03-procedure-framework.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/rfcs/2023-12-22-enclose-column-id.md:8— docs/rfcs/2023-12-22-enclose-column-id.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/rfcs/2024-08-06-json-datatype.md:8— docs/rfcs/2024-08-06-json-datatype.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/rfcs/2025-02-06-remote-wal-purge.md:8— docs/rfcs/2025-02-06-remote-wal-purge.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/rfcs/2025-06-20-repartition.md:8— docs/rfcs/2025-06-20-repartition.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/rfcs/2025-07-04-compatibility-test-framework.md:8— docs/rfcs/2025-07-04-compatibility-test-framework.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/rfcs/2025-08-16-async-index-build.md:8— docs/rfcs/2025-08-16-async-index-build.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
ADR has no Decision and Consequences section docs/rfcs/2025-12-05-vector-index.md:8— docs/rfcs/2025-12-05-vector-index.md has no Decision and Consequences section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
Silent fallback default on Err src/common/query/src/native_histogram.rs:1318— `get_bound` turns every `Err` into `Some(0.0)` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err src/servers/src/mysql/handler.rs:378— `version` turns every `Err` into `"8.4.2".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err tests-fuzz/src/utils.rs:162— `get_gt_fuzz_dump_dir` turns every `Err` into `"/tmp/greptime-fuzz-dumps".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on Err tests-fuzz/src/utils.rs:168— `get_gt_fuzz_dump_suffix` turns every `Err` into `".repartition-metric-csv".to_string()` — a failure becomes a plausible value and a silent behavior change with no trail. Log the error or propagate it with `?`. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the arm or in the doc comment, and the row stops firing.
Silent fallback default on parse failure .github/scripts/jsonbench-summary.py:41— `format_gb` returns `'N/A'` when `ValueError` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure .github/scripts/query-regression-summary.py:31— `fmt_ms` returns `'N/A'` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Silent fallback default on parse failure .github/scripts/query-regression-summary.py:64— `regression_pct` returns `'N/A'` when `(TypeError, ValueError)` is raised, with no log or raise — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer rather than a stand-in for a value that could not be read, say so in a comment on the handler or in the docstring, and the row stops firing.
Subsumed condition operand src/query/src/dist_plan/analyzer/test.rs:3125— `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) — 7 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 (163 single-owned of 1634 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1634 of the 2013 production source files in this repository met that bar). They are anonymized user #10 (2 file(s)), 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)) (+1 more) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: src/mito2/src/wal/encoder.rs, src/servers/src/prom_remote_write/row_builder.rs, src/promql/src/range_array.rs, src/query/src/optimizer/promql_tsid_narrow_join.rs, src/common/meta/src/reconciliation/event.rs, src/catalog/src/system_schema/predicate.rs, src/common/time/src/duration.rs, src/common/function/src/scalars/json/json_object_keys.rs (+1 more).
D20 · ADR Quality· ADR considers only one option · ×1
ADR considers only one option docs/rfcs/2023-05-09-distributed-planner.md:133— `docs/rfcs/2023-05-09-distributed-planner.md:133` lists one option, one sub-heading, so the record shows no choice being made. List the alternatives that were rejected and why, or remove the section.
D20 · ADR Quality· ADR has no Decision section · ×1
ADR has no Decision section docs/rfcs/2025-07-23-global-gc-worker.md:8— docs/rfcs/2025-07-23-global-gc-worker.md has no Decision section (a heading such as `## Decision`, or the MADR equivalent). A decision record states the context that forced it, the decision and its consequences, so a reader can tell later whether it still holds.
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 10 of 69 project(s) overshoot their size bounds, lowering Project Cohesion to 7.1/10. The most over is `src/mito2` (142095 LoC, 413 module-visible types across 27 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) — 108 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/datatypes/src/vectors/decimal.rs, src/common/function/src/scalars/primary_key.rs, src/sql/src/statements/transform/expand_interval.rs, src/index/src/inverted_index/search/index_apply/predicates_apply.rs, src/common/decimal/src/decimal128.rs, src/pipeline/src/etl/processor/digest.rs, src/index/src/inverted_index/search/fst_apply/intersection_apply.rs, src/puffin/src/puffin_manager/tests.rs (and 100 more) (111 orphaned of 1634 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated, example/demo and scaffolding-template trees and test files identified by path convention, largest first; 1634 of the 2013 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 REDACTED:2— The workload runs a container with no seccomp profile in force (neither RuntimeDefault nor a Localhost profile, on the container or the pod), so Kubernetes runs it Unconfined. Seccomp blocks the syscalls a container never needs, shrinking the kernel attack surface a container escape would use.
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.)
No security response headers detected — None of the 11 security response headers the OWASP Secure Headers Project recommends (Content-Security-Policy, Strict-Transport-Security, X-Content-Type-Options, X-Frame-Options, …) is set on a response this repository's Rust server sends — defense in depth, even when a proxy could set them. (−2.0 on this card.) The server: `axum::serve(` (src/servers/src/http.rs:1680).
X5 · Nullable reference types· Strict null checking is not enabled everywhere the repository type-checks · ×1
Strict null checking is not enabled everywhere the repository type-checks — 0/1 of this repository's type-checking configuration(s) turn on strict null checking (`"strict": true`, or `"strictNullChecks": true`). A configuration that states neither is counted as OFF, because off is tsc's own default; a solution-style one whose `"files"` is empty and whose `"references"` point at other projects is in neither number, because it checks no source itself. Where it is off, `string` admits `null` and `undefined`: passing a value that is null compiles silently and throws on the first property access.
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.5.0 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.3 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.51 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-recursion — `async-recursion` is locked at 1.1.1 but 1.2.0 is the current stable release on crates.io, and it already satisfies the `"1.0"` requirement declared in src/query/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-recursion` and commit the updated REDACTED.
Outdated: async-trait — `async-trait` is locked at 0.1.89 but 0.1.92 is the current stable release on crates.io, and it already satisfies the `"0.1"` requirement declared in tests-fuzz/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p async-trait` 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: auto_impl — `auto_impl` is locked at 1.3.0 but 1.4.0 is the current stable release on crates.io, and it already satisfies the `"1.2.0"` requirement declared in src/puffin/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p auto_impl` and commit the updated REDACTED.
Outdated: axum — `axum` is locked at 0.8.4 but 0.8.9 is the current stable release on crates.io, and it already satisfies the `"0.8"` requirement declared in tests-fuzz/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p axum` and commit the updated REDACTED.
Outdated: axum-macros — `axum-macros` is locked at 0.5.0 but 0.5.1 is the current stable release on crates.io, and it already satisfies the `"0.5"` requirement declared in src/meta-srv/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p axum-macros` and commit the updated REDACTED.
Outdated: backtrace — `backtrace` is locked at 0.3.75 but 0.3.77 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: bigdecimal — `bigdecimal` is locked at 0.4.8 but 0.4.11 is the current stable release on crates.io, and it already satisfies the `"0.4.2"` requirement declared in src/common/decimal/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bigdecimal` and commit the updated REDACTED.
Outdated: bitflags — `bitflags` is locked at 2.12.1 but 2.13.2 is the current stable release on crates.io, and it already satisfies the `"2.4.1"` requirement declared in src/puffin/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bitflags` 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: bytemuck — `bytemuck` is locked at 1.23.1 but 1.25.2 is the current stable release on crates.io, and it already satisfies the `"1.12"` requirement declared in src/index/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bytemuck` and commit the updated REDACTED.
Outdated: bytes — `bytes` is locked at 1.11.1 but 1.12.1 is the current stable release on crates.io, and it already satisfies the `"1.11"` requirement declared in src/catalog/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p bytes` and commit the updated REDACTED.
Outdated: cap-std — `cap-std` is locked at 4.0.2 but 4.0.3 is the current stable release on crates.io, and it already satisfies the `"4.0"` requirement declared in src/object-store/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p cap-std` and commit the updated REDACTED.
Outdated: clap — `clap` is locked at 4.5.40 but 4.6.7 is the current stable release on crates.io, and it already satisfies the `"4.4"` requirement declared in tests-fuzz/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p clap` and commit the updated REDACTED.
Outdated: const_format — `const_format` is locked at 0.2.34 but 0.2.37 is the current stable release on crates.io, and it already satisfies the `"0.2"` requirement declared in src/common/catalog/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p const_format` and commit the updated REDACTED.
Outdated: crc32fast — `crc32fast` is locked at 1.4.2 but 1.5.3 is the current stable release on crates.io, and it already satisfies the `"1"` requirement declared in src/log-store/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crc32fast` and commit the updated REDACTED.
Outdated: crossbeam-utils — `crossbeam-utils` is locked at 0.8.21 but 0.8.23 is the current stable release on crates.io, and it already satisfies the `"0.8"` requirement declared in src/mito2/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p crossbeam-utils` 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: deadpool-postgres — `deadpool-postgres` is locked at 0.14.1 but 0.14.2 is the current stable release on crates.io, and it already satisfies the `"0.14"` requirement declared in src/meta-srv/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p deadpool-postgres` and commit the updated REDACTED.
Outdated: derive_more — `derive_more` is locked at 2.1.0 but 2.1.1 is the current stable release on crates.io, and it already satisfies the `"2.1"` requirement declared in src/mito2/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p derive_more` and commit the updated REDACTED.
Outdated: either — `either` is locked at 1.15.0 but 1.19.0 is the current stable release on crates.io, and it already satisfies the `"1.15"` requirement declared in src/datanode/Cargo.toml — so the lockfile is behind this repository's own declared range. Run `cargo update -p either` and commit the updated REDACTED.
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: 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: 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.
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 01a17e63-1325-7ced-8fff-6e9a76bcbcef · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 515 · Warnings: 2274 · Recommendations: 256 · Info: 89 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 27-10-2026 @ 17:23 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.