Public report of neondatabase/neon, published 26 October 2026. It has the same score, grades and number of
findings as the full report. The details of security findings (where they are in the code, which known
vulnerabilities and which passwords or keys were found) are left out, so nobody can use them against the project.
Public
Executive reportMeasured under the Code Assurance Index, an open standard for code quality, using its published scoring rules (rubric version 2026.10.5). Watchdog signed this survey and filed it in the standard's public register, where anyone can look it up by its survey ID. Check this survey →
Signed and filed in the standard's public register, 26 October 2026, 03:39 UTC · Survey ID cd_8111771bb5664e988cae8ff26fc465b2
neondatabase/neon
Measured 26 October 2026, 03:38 UTC, at code version fa50421
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.
Code coverage is not measured: No coverage collector is wired up.
CAI scoreAt riskDown 1 since the last survey
The score is built from these lenses. Each lens grades one area of the code, such as how easy it is to change or how well it is protected. The weakest lens counts most, so one weak area pulls the score down instead of being averaged away.
A large codebase: 296,388 lines of product code in 49 projects, tests not counted · Estimated rebuild effort: about 2.0 person-years · Weakest lens: Security and Compliance, 38
Findings by how serious they are
134 critical965 serious615 minor
8 dimensions are left out of the score. For each one, Watchdog either couldn't measure it in this code, or found no evidence of the safeguard it looks for, such as a tested backup restore. They count neither for nor against the score, and Limitations lists each one with its reason.
This survey was produced by
Watchdog
Producer
Canine Development
Analyzer
Watchdog engine 1.0.0
Measured
26 October 2026, 03:38 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.
A critical security finding is open, such as a library with a known critical vulnerability or a password or key found in the code. The score itself is unchanged, but its band shows At risk until the finding is fixed. See the Security and Compliance lens.
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 ▸
73of 73 dimensions measured by tools.
1690of 1714 findings point to an exact file and line, so you can open each one in the code. The other 24 concern the repository as a whole, such as missing documentation.
73dimensions across 8 lenses, read from 296,388 lines of product code in 49 projects.
neondatabase/neon is rated At risk because critical security findings are open, most of them in the build pipeline. Its score is held back because five of the dependencies have a known vulnerability and it has secrets exposed to more of the pipeline than needed. It scores 58 out of 100, which the At risk rating leaves unchanged.
Security and Compliance, at 38, is the weakest lens and counts most in the score. The best first step is replacing the eight exposed passwords or keys and switching the old ones off, worth about 7 points. Fixing the runtime or framework that no longer gets security updates comes next, worth about 3 points. Raising Security and Compliance to 70 would lift the score to about 70.
Thirty-nine secrets can leak from the build pipeline. Thirty-six known security holes in the packages the code depends on can be used by attackers. Limiting each secret to its own step and updating the vulnerable packages would close both risks. Pinning each tool to an exact version would fix the 30 pipeline tools referenced by a changeable name, and the nine unsafe settings in infrastructure or container files need changing to safe values. Moving the write out of the read operation would take care of the two read operations that also write data.
The product code is 296,388 lines, about €290,000 to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
Watchdog compares every finding with the previous survey's. A finding that has only moved to another line in the same file counts as the same finding, so only new findings appear here. Advisory notes from the AI model are left out, because the model words them afresh in every survey.
Fixed since the last survey: 23 findings
These 23 critical or serious findings were in the previous survey, on 12 October 2026, and are gone from this one.
Dependency Vulnerabilities · High CVE: REDACTED REDACTED
Dependency Vulnerabilities · High CVE: REDACTED REDACTED
Dependency Vulnerabilities · High CVE: REDACTED REDACTED
Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
Dependency Vulnerabilities · High CVE: [GHSA redacted] REDACTED
Dependency Vulnerabilities · Medium CVE: [GHSA redacted] REDACTED
Dependency Vulnerabilities · Medium CVE: REDACTED REDACTED
€98,000 to €490,000, for 1,633 to 5,151 hours of work, about 2.0 person-years for 1 to 4 engineers
Difficulty of the problem
Low, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.8 at a score of 58. Better code takes more work to write, so the factor is ×1.0 at a score of 70, lower below it and higher above it.
Size
Large: 296,388 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.
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 8 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (4), REDACTED (2), REDACTED (2).
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 €290,000 to build again, about 2.0 person-years of work. Its weakest lens is Security and Compliance, at 38 (Weak). Security and Compliance is about how well the product is protected, and how it handles personal data. Because the weakest lens counts most in the score, work on Security and Compliance also moves the score most.
Based on: the rebuild estimate · the Security and Compliance grade · how much each lens counts
What to do: Start with the Security and Compliance actions in Top priorities.
If you do one thing first · First action
Resolve the 8 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 7 points for low effort, because it clears the 8 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.
630 modules, with 2333 dependencies between them. 6 loops run through 233 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 590 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.
pageserver_api.key uses neon_shmem.shmem, so a change to neon_shmem.shmem can break pageserver_api.key, while a change to pageserver_api.key can't break neon_shmem.shmem.
Position
Below the diagonal: pageserver_api.key uses a module listed above it, which is the healthy direction.
9→13 pageserver_api.key uses pageserver_api.shardpart of a loop✕
Connections
1 pair of types, where a type in pageserver_api.key uses a type in pageserver_api.shard.
pageserver_api.key uses pageserver_api.shard, so a change to pageserver_api.shard can break pageserver_api.key, while a change to pageserver_api.key can't break pageserver_api.shard.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
1 pair of types, where a type in utils.sync.spsc_fold uses a type in desim.chan.
The types involved
utils.sync.spsc_fold.Inner → desim.chan.State
Direction
utils.sync.spsc_fold uses desim.chan, so a change to desim.chan can break utils.sync.spsc_fold, while a change to utils.sync.spsc_fold can't break desim.chan.
Position
Below the diagonal: utils.sync.spsc_fold uses a module listed above it, which is the healthy direction.
pageserver.tenant.remote_timeline_client.index uses utils.id, so a change to utils.id can break pageserver.tenant.remote_timeline_client.index, while a change to pageserver.tenant.remote_timeline_client.index can't break utils.id.
Position
Below the diagonal: pageserver.tenant.remote_timeline_client.index uses a module listed above it, which is the healthy direction.
pageserver.tenant.remote_timeline_client.index uses utils.shard, so a change to utils.shard can break pageserver.tenant.remote_timeline_client.index, while a change to pageserver.tenant.remote_timeline_client.index can't break utils.shard.
Position
Below the diagonal: pageserver.tenant.remote_timeline_client.index uses a module listed above it, which is the healthy direction.
12→30 pageserver.tenant.remote_timeline_client.index uses pageserver_api.modelspart of a loop✕
Connections
2 pairs of types, where a type in pageserver.tenant.remote_timeline_client.index uses a type in pageserver_api.models.
pageserver.tenant.remote_timeline_client.index uses pageserver_api.models, so a change to pageserver_api.models can break pageserver.tenant.remote_timeline_client.index, while a change to pageserver.tenant.remote_timeline_client.index can't break pageserver_api.models.
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→37 pageserver.tenant.remote_timeline_client.index uses utils.lsnpart of a loop✕
Connections
3 pairs of types, where a type in pageserver.tenant.remote_timeline_client.index uses a type in utils.lsn.
pageserver.tenant.remote_timeline_client.index uses utils.lsn, so a change to utils.lsn can break pageserver.tenant.remote_timeline_client.index, while a change to pageserver.tenant.remote_timeline_client.index can't break utils.lsn.
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.
pageserver_api.shard uses pageserver_api.key, so a change to pageserver_api.key can break pageserver_api.shard, while a change to pageserver_api.shard can't break pageserver_api.key.
Position
Below the diagonal: pageserver_api.shard uses a module listed above it, which is the healthy direction.
pageserver_api.shard uses utils.shard, so a change to utils.shard can break pageserver_api.shard, while a change to pageserver_api.shard can't break utils.shard.
Position
Below the diagonal: pageserver_api.shard uses a module listed above it, which is the healthy direction.
13→30 pageserver_api.shard uses pageserver_api.modelspart of a loop✕
Connections
1 pair of types, where a type in pageserver_api.shard uses a type in pageserver_api.models.
pageserver_api.shard uses pageserver_api.models, so a change to pageserver_api.models can break pageserver_api.shard, while a change to pageserver_api.shard can't break pageserver_api.models.
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.
tokio_postgres2.client uses utils.sync.spsc_fold, so a change to utils.sync.spsc_fold can break tokio_postgres2.client, while a change to tokio_postgres2.client can't break utils.sync.spsc_fold.
Position
Below the diagonal: tokio_postgres2.client uses a module listed above it, which is the healthy direction.
compute_tools.bin.fast_import uses utils.shard, so a change to utils.shard can break compute_tools.bin.fast_import, while a change to compute_tools.bin.fast_import can't break utils.shard.
Position
Below the diagonal: compute_tools.bin.fast_import uses a module listed above it, which is the healthy direction.
compute_tools.bin.fast_import uses tokio_postgres2.client, so a change to tokio_postgres2.client can break compute_tools.bin.fast_import, while a change to compute_tools.bin.fast_import can't break tokio_postgres2.client.
Position
Below the diagonal: compute_tools.bin.fast_import uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.image_layer uses neon_shmem.shmem, so a change to neon_shmem.shmem can break pageserver.tenant.storage_layer.image_layer, while a change to pageserver.tenant.storage_layer.image_layer can't break neon_shmem.shmem.
Position
Below the diagonal: pageserver.tenant.storage_layer.image_layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.image_layer uses utils.id, so a change to utils.id can break pageserver.tenant.storage_layer.image_layer, while a change to pageserver.tenant.storage_layer.image_layer can't break utils.id.
Position
Below the diagonal: pageserver.tenant.storage_layer.image_layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.image_layer uses utils.sync.gate, so a change to utils.sync.gate can break pageserver.tenant.storage_layer.image_layer, while a change to pageserver.tenant.storage_layer.image_layer can't break utils.sync.gate.
Position
Below the diagonal: pageserver.tenant.storage_layer.image_layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.image_layer uses pageserver_api.key, so a change to pageserver_api.key can break pageserver.tenant.storage_layer.image_layer, while a change to pageserver.tenant.storage_layer.image_layer can't break pageserver_api.key.
Position
Below the diagonal: pageserver.tenant.storage_layer.image_layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.image_layer uses utils.shard, so a change to utils.shard can break pageserver.tenant.storage_layer.image_layer, while a change to pageserver.tenant.storage_layer.image_layer can't break utils.shard.
Position
Below the diagonal: pageserver.tenant.storage_layer.image_layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.image_layer uses pageserver_api.shard, so a change to pageserver_api.shard can break pageserver.tenant.storage_layer.image_layer, while a change to pageserver.tenant.storage_layer.image_layer can't break pageserver_api.shard.
Position
Below the diagonal: pageserver.tenant.storage_layer.image_layer uses a module listed above it, which is the healthy direction.
16→23 pageserver.tenant.storage_layer.image_layer uses pageserver.contextpart of a loop✕
Connections
5 pairs of types, where a type in pageserver.tenant.storage_layer.image_layer uses a type in pageserver.context.
pageserver.tenant.storage_layer.image_layer uses pageserver.context, so a change to pageserver.context can break pageserver.tenant.storage_layer.image_layer, while a change to pageserver.tenant.storage_layer.image_layer can't break pageserver.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→26 pageserver.tenant.storage_layer.image_layer uses pageserver.tenant.storage_layer.layerpart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.storage_layer.image_layer uses a type in pageserver.tenant.storage_layer.layer.
pageserver.tenant.storage_layer.image_layer uses pageserver.tenant.storage_layer.layer, so a change to pageserver.tenant.storage_layer.layer can break pageserver.tenant.storage_layer.image_layer, while a change to pageserver.tenant.storage_layer.image_layer can't break pageserver.tenant.storage_layer.layer.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→32 pageserver.tenant.storage_layer.image_layer uses pageserver_api.configpart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.storage_layer.image_layer uses a type in pageserver_api.config.
pageserver.tenant.storage_layer.image_layer uses pageserver_api.config, so a change to pageserver_api.config can break pageserver.tenant.storage_layer.image_layer, while a change to pageserver.tenant.storage_layer.image_layer can't break pageserver_api.config.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→34 pageserver.tenant.storage_layer.image_layer uses control_plane.local_envpart of a loop✕
Connections
3 pairs of types, where a type in pageserver.tenant.storage_layer.image_layer uses a type in control_plane.local_env.
pageserver.tenant.storage_layer.image_layer uses control_plane.local_env, so a change to control_plane.local_env can break pageserver.tenant.storage_layer.image_layer, while a change to pageserver.tenant.storage_layer.image_layer can't break control_plane.local_env.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
16→37 pageserver.tenant.storage_layer.image_layer uses utils.lsnpart of a loop✕
Connections
5 pairs of types, where a type in pageserver.tenant.storage_layer.image_layer uses a type in utils.lsn.
pageserver.tenant.storage_layer.image_layer uses utils.lsn, so a change to utils.lsn can break pageserver.tenant.storage_layer.image_layer, while a change to pageserver.tenant.storage_layer.image_layer can't break utils.lsn.
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.
pageserver.tenant.timeline.handle uses utils.id, so a change to utils.id can break pageserver.tenant.timeline.handle, while a change to pageserver.tenant.timeline.handle can't break utils.id.
Position
Below the diagonal: pageserver.tenant.timeline.handle uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline.handle uses utils.shard, so a change to utils.shard can break pageserver.tenant.timeline.handle, while a change to pageserver.tenant.timeline.handle can't break utils.shard.
Position
Below the diagonal: pageserver.tenant.timeline.handle uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline.handle uses pageserver_api.shard, so a change to pageserver_api.shard can break pageserver.tenant.timeline.handle, while a change to pageserver.tenant.timeline.handle can't break pageserver_api.shard.
Position
Below the diagonal: pageserver.tenant.timeline.handle uses a module listed above it, which is the healthy direction.
17→21 pageserver.tenant.timeline.handle uses pageserver.tenant.mgrpart of a loop✕
Connections
3 pairs of types, where a type in pageserver.tenant.timeline.handle uses a type in pageserver.tenant.mgr.
pageserver.tenant.timeline.handle uses pageserver.tenant.mgr, so a change to pageserver.tenant.mgr can break pageserver.tenant.timeline.handle, while a change to pageserver.tenant.timeline.handle can't break pageserver.tenant.mgr.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
17→28 pageserver.tenant.timeline.handle uses pagebench.cmd.basebackuppart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.timeline.handle uses a type in pagebench.cmd.basebackup.
pageserver.tenant.timeline.handle uses pagebench.cmd.basebackup, so a change to pagebench.cmd.basebackup can break pageserver.tenant.timeline.handle, while a change to pageserver.tenant.timeline.handle can't break pagebench.cmd.basebackup.
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.
pageserver.tenant.remote_timeline_client uses remote_storage, so a change to remote_storage can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break remote_storage.
Position
Below the diagonal: pageserver.tenant.remote_timeline_client uses a module listed above it, which is the healthy direction.
pageserver.tenant.remote_timeline_client uses utils.id, so a change to utils.id can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break utils.id.
Position
Below the diagonal: pageserver.tenant.remote_timeline_client uses a module listed above it, which is the healthy direction.
pageserver.tenant.remote_timeline_client uses utils.sync.gate, so a change to utils.sync.gate can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break utils.sync.gate.
Position
Below the diagonal: pageserver.tenant.remote_timeline_client uses a module listed above it, which is the healthy direction.
pageserver.tenant.remote_timeline_client uses utils.shard, so a change to utils.shard can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break utils.shard.
Position
Below the diagonal: pageserver.tenant.remote_timeline_client uses a module listed above it, which is the healthy direction.
pageserver.tenant.remote_timeline_client uses utils.sync.spsc_fold, so a change to utils.sync.spsc_fold can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break utils.sync.spsc_fold.
Position
Below the diagonal: pageserver.tenant.remote_timeline_client uses a module listed above it, which is the healthy direction.
pageserver.tenant.remote_timeline_client uses pageserver.tenant.remote_timeline_client.index, so a change to pageserver.tenant.remote_timeline_client.index can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break pageserver.tenant.remote_timeline_client.index.
Position
Below the diagonal: pageserver.tenant.remote_timeline_client uses a module listed above it, which is the healthy direction.
pageserver.tenant.remote_timeline_client uses pageserver.tenant.timeline.handle, so a change to pageserver.tenant.timeline.handle can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break pageserver.tenant.timeline.handle.
Position
Below the diagonal: pageserver.tenant.remote_timeline_client uses a module listed above it, which is the healthy direction.
18→22 pageserver.tenant.remote_timeline_client uses pageserver.metricspart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.remote_timeline_client uses a type in pageserver.metrics.
pageserver.tenant.remote_timeline_client uses pageserver.metrics, so a change to pageserver.metrics can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break pageserver.metrics.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
18→23 pageserver.tenant.remote_timeline_client uses pageserver.contextpart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.remote_timeline_client uses a type in pageserver.context.
pageserver.tenant.remote_timeline_client uses pageserver.context, so a change to pageserver.context can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break pageserver.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
18→26 pageserver.tenant.remote_timeline_client uses pageserver.tenant.storage_layer.layerpart of a loop✕
Connections
2 pairs of types, where a type in pageserver.tenant.remote_timeline_client uses a type in pageserver.tenant.storage_layer.layer.
pageserver.tenant.remote_timeline_client uses pageserver.tenant.storage_layer.layer, so a change to pageserver.tenant.storage_layer.layer can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break pageserver.tenant.storage_layer.layer.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
18→30 pageserver.tenant.remote_timeline_client uses pageserver_api.modelspart of a loop✕
Connections
3 pairs of types, where a type in pageserver.tenant.remote_timeline_client uses a type in pageserver_api.models.
pageserver.tenant.remote_timeline_client uses pageserver_api.models, so a change to pageserver_api.models can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break pageserver_api.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
18→34 pageserver.tenant.remote_timeline_client uses control_plane.local_envpart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.remote_timeline_client uses a type in control_plane.local_env.
pageserver.tenant.remote_timeline_client uses control_plane.local_env, so a change to control_plane.local_env can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break control_plane.local_env.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
18→37 pageserver.tenant.remote_timeline_client uses utils.lsnpart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.remote_timeline_client uses a type in utils.lsn.
pageserver.tenant.remote_timeline_client uses utils.lsn, so a change to utils.lsn can break pageserver.tenant.remote_timeline_client, while a change to pageserver.tenant.remote_timeline_client can't break utils.lsn.
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.
pageserver.tenant.timeline uses neon_shmem.shmem, so a change to neon_shmem.shmem can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break neon_shmem.shmem.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline uses postgres_versioninfo, so a change to postgres_versioninfo can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break postgres_versioninfo.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline uses remote_storage, so a change to remote_storage can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break remote_storage.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline uses utils.id, so a change to utils.id can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break utils.id.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline uses utils.sync.gate, so a change to utils.sync.gate can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break utils.sync.gate.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline uses pageserver_api.key, so a change to pageserver_api.key can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pageserver_api.key.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline uses utils.shard, so a change to utils.shard can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break utils.shard.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline uses utils.sync.spsc_fold, so a change to utils.sync.spsc_fold can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break utils.sync.spsc_fold.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline uses pageserver.tenant.remote_timeline_client.index, so a change to pageserver.tenant.remote_timeline_client.index can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pageserver.tenant.remote_timeline_client.index.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline uses pageserver_api.shard, so a change to pageserver_api.shard can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pageserver_api.shard.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline uses pageserver.tenant.storage_layer.image_layer, so a change to pageserver.tenant.storage_layer.image_layer can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pageserver.tenant.storage_layer.image_layer.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline uses pageserver.tenant.timeline.handle, so a change to pageserver.tenant.timeline.handle can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pageserver.tenant.timeline.handle.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
pageserver.tenant.timeline uses pageserver.tenant.remote_timeline_client, so a change to pageserver.tenant.remote_timeline_client can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pageserver.tenant.remote_timeline_client.
Position
Below the diagonal: pageserver.tenant.timeline uses a module listed above it, which is the healthy direction.
19→20 pageserver.tenant.timeline uses pageserver.tenantpart of a loop✕
Connections
5 pairs of types, where a type in pageserver.tenant.timeline uses a type in pageserver.tenant.
pageserver.tenant.timeline uses pageserver.tenant, so a change to pageserver.tenant can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pageserver.tenant.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→22 pageserver.tenant.timeline uses pageserver.metricspart of a loop✕
Connections
2 pairs of types, where a type in pageserver.tenant.timeline uses a type in pageserver.metrics.
pageserver.tenant.timeline uses pageserver.metrics, so a change to pageserver.metrics can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pageserver.metrics.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→23 pageserver.tenant.timeline uses pageserver.contextpart of a loop✕
Connections
2 pairs of types, where a type in pageserver.tenant.timeline uses a type in pageserver.context.
pageserver.tenant.timeline uses pageserver.context, so a change to pageserver.context can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pageserver.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→26 pageserver.tenant.timeline uses pageserver.tenant.storage_layer.layerpart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.timeline uses a type in pageserver.tenant.storage_layer.layer.
pageserver.tenant.timeline uses pageserver.tenant.storage_layer.layer, so a change to pageserver.tenant.storage_layer.layer can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pageserver.tenant.storage_layer.layer.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→28 pageserver.tenant.timeline uses pagebench.cmd.basebackuppart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.timeline uses a type in pagebench.cmd.basebackup.
pageserver.tenant.timeline uses pagebench.cmd.basebackup, so a change to pagebench.cmd.basebackup can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pagebench.cmd.basebackup.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→30 pageserver.tenant.timeline uses pageserver_api.modelspart of a loop✕
Connections
13 pairs of types, where a type in pageserver.tenant.timeline uses a type in pageserver_api.models.
pageserver.tenant.timeline uses pageserver_api.models, so a change to pageserver_api.models can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pageserver_api.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→32 pageserver.tenant.timeline uses pageserver_api.configpart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.timeline uses a type in pageserver_api.config.
pageserver.tenant.timeline uses pageserver_api.config, so a change to pageserver_api.config can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break pageserver_api.config.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→34 pageserver.tenant.timeline uses control_plane.local_envpart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.timeline uses a type in control_plane.local_env.
pageserver.tenant.timeline uses control_plane.local_env, so a change to control_plane.local_env can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break control_plane.local_env.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
19→37 pageserver.tenant.timeline uses utils.lsnpart of a loop✕
Connections
11 pairs of types, where a type in pageserver.tenant.timeline uses a type in utils.lsn.
pageserver.tenant.timeline uses utils.lsn, so a change to utils.lsn can break pageserver.tenant.timeline, while a change to pageserver.tenant.timeline can't break utils.lsn.
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.
pageserver.tenant uses endpoint_storage.main, so a change to endpoint_storage.main can break pageserver.tenant, while a change to pageserver.tenant can't break endpoint_storage.main.
Position
Below the diagonal: pageserver.tenant uses a module listed above it, which is the healthy direction.
pageserver.tenant uses postgres_versioninfo, so a change to postgres_versioninfo can break pageserver.tenant, while a change to pageserver.tenant can't break postgres_versioninfo.
Position
Below the diagonal: pageserver.tenant uses a module listed above it, which is the healthy direction.
pageserver.tenant uses remote_storage, so a change to remote_storage can break pageserver.tenant, while a change to pageserver.tenant can't break remote_storage.
Position
Below the diagonal: pageserver.tenant uses a module listed above it, which is the healthy direction.
pageserver.tenant uses utils.sync.gate, so a change to utils.sync.gate can break pageserver.tenant, while a change to pageserver.tenant can't break utils.sync.gate.
Position
Below the diagonal: pageserver.tenant uses a module listed above it, which is the healthy direction.
pageserver.tenant uses pageserver_api.key, so a change to pageserver_api.key can break pageserver.tenant, while a change to pageserver.tenant can't break pageserver_api.key.
Position
Below the diagonal: pageserver.tenant uses a module listed above it, which is the healthy direction.
pageserver.tenant uses utils.shard, so a change to utils.shard can break pageserver.tenant, while a change to pageserver.tenant can't break utils.shard.
Position
Below the diagonal: pageserver.tenant uses a module listed above it, which is the healthy direction.
pageserver.tenant uses utils.sync.spsc_fold, so a change to utils.sync.spsc_fold can break pageserver.tenant, while a change to pageserver.tenant can't break utils.sync.spsc_fold.
Position
Below the diagonal: pageserver.tenant uses a module listed above it, which is the healthy direction.
pageserver.tenant uses pageserver.tenant.remote_timeline_client.index, so a change to pageserver.tenant.remote_timeline_client.index can break pageserver.tenant, while a change to pageserver.tenant can't break pageserver.tenant.remote_timeline_client.index.
Position
Below the diagonal: pageserver.tenant uses a module listed above it, which is the healthy direction.
pageserver.tenant uses pageserver_api.shard, so a change to pageserver_api.shard can break pageserver.tenant, while a change to pageserver.tenant can't break pageserver_api.shard.
Position
Below the diagonal: pageserver.tenant uses a module listed above it, which is the healthy direction.
pageserver.tenant uses pageserver.tenant.timeline.handle, so a change to pageserver.tenant.timeline.handle can break pageserver.tenant, while a change to pageserver.tenant can't break pageserver.tenant.timeline.handle.
Position
Below the diagonal: pageserver.tenant uses a module listed above it, which is the healthy direction.
pageserver.tenant uses pageserver.tenant.remote_timeline_client, so a change to pageserver.tenant.remote_timeline_client can break pageserver.tenant, while a change to pageserver.tenant can't break pageserver.tenant.remote_timeline_client.
Position
Below the diagonal: pageserver.tenant uses a module listed above it, which is the healthy direction.
pageserver.tenant uses pageserver.tenant.timeline, so a change to pageserver.tenant.timeline can break pageserver.tenant, while a change to pageserver.tenant can't break pageserver.tenant.timeline.
Position
Below the diagonal: pageserver.tenant uses a module listed above it, which is the healthy direction.
20→23 pageserver.tenant uses pageserver.contextpart of a loop✕
Connections
2 pairs of types, where a type in pageserver.tenant uses a type in pageserver.context.
pageserver.tenant uses pageserver.context, so a change to pageserver.context can break pageserver.tenant, while a change to pageserver.tenant can't break pageserver.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
20→30 pageserver.tenant uses pageserver_api.modelspart of a loop✕
Connections
10 pairs of types, where a type in pageserver.tenant uses a type in pageserver_api.models.
pageserver.tenant uses pageserver_api.models, so a change to pageserver_api.models can break pageserver.tenant, while a change to pageserver.tenant can't break pageserver_api.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
20→32 pageserver.tenant uses pageserver_api.configpart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant uses a type in pageserver_api.config.
pageserver.tenant uses pageserver_api.config, so a change to pageserver_api.config can break pageserver.tenant, while a change to pageserver.tenant can't break pageserver_api.config.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
20→34 pageserver.tenant uses control_plane.local_envpart of a loop✕
Connections
3 pairs of types, where a type in pageserver.tenant uses a type in control_plane.local_env.
pageserver.tenant uses control_plane.local_env, so a change to control_plane.local_env can break pageserver.tenant, while a change to pageserver.tenant can't break control_plane.local_env.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
20→37 pageserver.tenant uses utils.lsnpart of a loop✕
Connections
4 pairs of types, where a type in pageserver.tenant uses a type in utils.lsn.
pageserver.tenant.mgr uses utils.id, so a change to utils.id can break pageserver.tenant.mgr, while a change to pageserver.tenant.mgr can't break utils.id.
Position
Below the diagonal: pageserver.tenant.mgr uses a module listed above it, which is the healthy direction.
pageserver.tenant.mgr uses utils.shard, so a change to utils.shard can break pageserver.tenant.mgr, while a change to pageserver.tenant.mgr can't break utils.shard.
Position
Below the diagonal: pageserver.tenant.mgr uses a module listed above it, which is the healthy direction.
pageserver.tenant.mgr uses pageserver_api.shard, so a change to pageserver_api.shard can break pageserver.tenant.mgr, while a change to pageserver.tenant.mgr can't break pageserver_api.shard.
Position
Below the diagonal: pageserver.tenant.mgr uses a module listed above it, which is the healthy direction.
pageserver.tenant.mgr uses pageserver.tenant, so a change to pageserver.tenant can break pageserver.tenant.mgr, while a change to pageserver.tenant.mgr can't break pageserver.tenant.
Position
Below the diagonal: pageserver.tenant.mgr uses a module listed above it, which is the healthy direction.
21→23 pageserver.tenant.mgr uses pageserver.contextpart of a loop✕
Connections
2 pairs of types, where a type in pageserver.tenant.mgr uses a type in pageserver.context.
pageserver.tenant.mgr uses pageserver.context, so a change to pageserver.context can break pageserver.tenant.mgr, while a change to pageserver.tenant.mgr can't break pageserver.context.
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.
21→30 pageserver.tenant.mgr uses pageserver_api.modelspart of a loop✕
Connections
2 pairs of types, where a type in pageserver.tenant.mgr uses a type in pageserver_api.models.
pageserver.tenant.mgr uses pageserver_api.models, so a change to pageserver_api.models can break pageserver.tenant.mgr, while a change to pageserver.tenant.mgr can't break pageserver_api.models.
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.
21→34 pageserver.tenant.mgr uses control_plane.local_envpart of a loop✕
Connections
2 pairs of types, where a type in pageserver.tenant.mgr uses a type in control_plane.local_env.
pageserver.tenant.mgr uses control_plane.local_env, so a change to control_plane.local_env can break pageserver.tenant.mgr, while a change to pageserver.tenant.mgr can't break control_plane.local_env.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
pageserver.metrics uses utils.shard, so a change to utils.shard can break pageserver.metrics, while a change to pageserver.metrics can't break utils.shard.
Position
Below the diagonal: pageserver.metrics uses a module listed above it, which is the healthy direction.
pageserver.metrics uses pageserver.tenant.mgr, so a change to pageserver.tenant.mgr can break pageserver.metrics, while a change to pageserver.metrics can't break pageserver.tenant.mgr.
Position
Below the diagonal: pageserver.metrics uses a module listed above it, which is the healthy direction.
22→23 pageserver.metrics uses pageserver.contextpart of a loop✕
Connections
1 pair of types, where a type in pageserver.metrics uses a type in pageserver.context.
pageserver.metrics uses pageserver.context, so a change to pageserver.context can break pageserver.metrics, while a change to pageserver.metrics can't break pageserver.context.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
22→32 pageserver.metrics uses pageserver_api.configpart of a loop✕
Connections
1 pair of types, where a type in pageserver.metrics uses a type in pageserver_api.config.
pageserver.metrics uses pageserver_api.config, so a change to pageserver_api.config can break pageserver.metrics, while a change to pageserver.metrics can't break pageserver_api.config.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
22→34 pageserver.metrics uses control_plane.local_envpart of a loop✕
Connections
1 pair of types, where a type in pageserver.metrics uses a type in control_plane.local_env.
pageserver.metrics uses control_plane.local_env, so a change to control_plane.local_env can break pageserver.metrics, while a change to pageserver.metrics can't break control_plane.local_env.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
pageserver.context uses utils.shard, so a change to utils.shard can break pageserver.context, while a change to pageserver.context can't break utils.shard.
Position
Below the diagonal: pageserver.context uses a module listed above it, which is the healthy direction.
pageserver.context uses pageserver.tenant.timeline.handle, so a change to pageserver.tenant.timeline.handle can break pageserver.context, while a change to pageserver.context can't break pageserver.tenant.timeline.handle.
Position
Below the diagonal: pageserver.context uses a module listed above it, which is the healthy direction.
pageserver.context uses pageserver.metrics, so a change to pageserver.metrics can break pageserver.context, while a change to pageserver.context can't break pageserver.metrics.
Position
Below the diagonal: pageserver.context uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.delta_layer uses neon_shmem.shmem, so a change to neon_shmem.shmem can break pageserver.tenant.storage_layer.delta_layer, while a change to pageserver.tenant.storage_layer.delta_layer can't break neon_shmem.shmem.
Position
Below the diagonal: pageserver.tenant.storage_layer.delta_layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.delta_layer uses utils.id, so a change to utils.id can break pageserver.tenant.storage_layer.delta_layer, while a change to pageserver.tenant.storage_layer.delta_layer can't break utils.id.
Position
Below the diagonal: pageserver.tenant.storage_layer.delta_layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.delta_layer uses utils.sync.gate, so a change to utils.sync.gate can break pageserver.tenant.storage_layer.delta_layer, while a change to pageserver.tenant.storage_layer.delta_layer can't break utils.sync.gate.
Position
Below the diagonal: pageserver.tenant.storage_layer.delta_layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.delta_layer uses pageserver_api.key, so a change to pageserver_api.key can break pageserver.tenant.storage_layer.delta_layer, while a change to pageserver.tenant.storage_layer.delta_layer can't break pageserver_api.key.
Position
Below the diagonal: pageserver.tenant.storage_layer.delta_layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.delta_layer uses utils.shard, so a change to utils.shard can break pageserver.tenant.storage_layer.delta_layer, while a change to pageserver.tenant.storage_layer.delta_layer can't break utils.shard.
Position
Below the diagonal: pageserver.tenant.storage_layer.delta_layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.delta_layer uses pageserver.context, so a change to pageserver.context can break pageserver.tenant.storage_layer.delta_layer, while a change to pageserver.tenant.storage_layer.delta_layer can't break pageserver.context.
Position
Below the diagonal: pageserver.tenant.storage_layer.delta_layer uses a module listed above it, which is the healthy direction.
24→26 pageserver.tenant.storage_layer.delta_layer uses pageserver.tenant.storage_layer.layerpart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.storage_layer.delta_layer uses a type in pageserver.tenant.storage_layer.layer.
pageserver.tenant.storage_layer.delta_layer uses pageserver.tenant.storage_layer.layer, so a change to pageserver.tenant.storage_layer.layer can break pageserver.tenant.storage_layer.delta_layer, while a change to pageserver.tenant.storage_layer.delta_layer can't break pageserver.tenant.storage_layer.layer.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→32 pageserver.tenant.storage_layer.delta_layer uses pageserver_api.configpart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.storage_layer.delta_layer uses a type in pageserver_api.config.
pageserver.tenant.storage_layer.delta_layer uses pageserver_api.config, so a change to pageserver_api.config can break pageserver.tenant.storage_layer.delta_layer, while a change to pageserver.tenant.storage_layer.delta_layer can't break pageserver_api.config.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→34 pageserver.tenant.storage_layer.delta_layer uses control_plane.local_envpart of a loop✕
Connections
3 pairs of types, where a type in pageserver.tenant.storage_layer.delta_layer uses a type in control_plane.local_env.
pageserver.tenant.storage_layer.delta_layer uses control_plane.local_env, so a change to control_plane.local_env can break pageserver.tenant.storage_layer.delta_layer, while a change to pageserver.tenant.storage_layer.delta_layer can't break control_plane.local_env.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
24→37 pageserver.tenant.storage_layer.delta_layer uses utils.lsnpart of a loop✕
Connections
5 pairs of types, where a type in pageserver.tenant.storage_layer.delta_layer uses a type in utils.lsn.
pageserver.tenant.storage_layer.delta_layer uses utils.lsn, so a change to utils.lsn can break pageserver.tenant.storage_layer.delta_layer, while a change to pageserver.tenant.storage_layer.delta_layer can't break utils.lsn.
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.
pageserver.virtual_file.owned_buffers_io.write.flush uses neon_shmem.shmem, so a change to neon_shmem.shmem can break pageserver.virtual_file.owned_buffers_io.write.flush, while a change to pageserver.virtual_file.owned_buffers_io.write.flush can't break neon_shmem.shmem.
Position
Below the diagonal: pageserver.virtual_file.owned_buffers_io.write.flush uses a module listed above it, which is the healthy direction.
pageserver.virtual_file.owned_buffers_io.write.flush uses utils.sync.gate, so a change to utils.sync.gate can break pageserver.virtual_file.owned_buffers_io.write.flush, while a change to pageserver.virtual_file.owned_buffers_io.write.flush can't break utils.sync.gate.
Position
Below the diagonal: pageserver.virtual_file.owned_buffers_io.write.flush uses a module listed above it, which is the healthy direction.
pageserver.virtual_file.owned_buffers_io.write.flush uses utils.sync.spsc_fold, so a change to utils.sync.spsc_fold can break pageserver.virtual_file.owned_buffers_io.write.flush, while a change to pageserver.virtual_file.owned_buffers_io.write.flush can't break utils.sync.spsc_fold.
Position
Below the diagonal: pageserver.virtual_file.owned_buffers_io.write.flush uses a module listed above it, which is the healthy direction.
pageserver.virtual_file.owned_buffers_io.write.flush uses pageserver.context, so a change to pageserver.context can break pageserver.virtual_file.owned_buffers_io.write.flush, while a change to pageserver.virtual_file.owned_buffers_io.write.flush can't break pageserver.context.
Position
Below the diagonal: pageserver.virtual_file.owned_buffers_io.write.flush uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses utils.id, so a change to utils.id can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break utils.id.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses utils.sync.gate, so a change to utils.sync.gate can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break utils.sync.gate.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses utils.shard, so a change to utils.shard can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break utils.shard.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses utils.sync.spsc_fold, so a change to utils.sync.spsc_fold can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break utils.sync.spsc_fold.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses pageserver.tenant.remote_timeline_client.index, so a change to pageserver.tenant.remote_timeline_client.index can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break pageserver.tenant.remote_timeline_client.index.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses pageserver_api.shard, so a change to pageserver_api.shard can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break pageserver_api.shard.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses pageserver.tenant.storage_layer.image_layer, so a change to pageserver.tenant.storage_layer.image_layer can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break pageserver.tenant.storage_layer.image_layer.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses pageserver.tenant.timeline.handle, so a change to pageserver.tenant.timeline.handle can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break pageserver.tenant.timeline.handle.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses pageserver.tenant.timeline, so a change to pageserver.tenant.timeline can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break pageserver.tenant.timeline.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses pageserver.tenant, so a change to pageserver.tenant can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break pageserver.tenant.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses pageserver.tenant.mgr, so a change to pageserver.tenant.mgr can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break pageserver.tenant.mgr.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses pageserver.context, so a change to pageserver.context can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break pageserver.context.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
pageserver.tenant.storage_layer.layer uses pageserver.tenant.storage_layer.delta_layer, so a change to pageserver.tenant.storage_layer.delta_layer can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break pageserver.tenant.storage_layer.delta_layer.
Position
Below the diagonal: pageserver.tenant.storage_layer.layer uses a module listed above it, which is the healthy direction.
26→30 pageserver.tenant.storage_layer.layer uses pageserver_api.modelspart of a loop✕
Connections
3 pairs of types, where a type in pageserver.tenant.storage_layer.layer uses a type in pageserver_api.models.
pageserver.tenant.storage_layer.layer uses pageserver_api.models, so a change to pageserver_api.models can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break pageserver_api.models.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
26→34 pageserver.tenant.storage_layer.layer uses control_plane.local_envpart of a loop✕
Connections
3 pairs of types, where a type in pageserver.tenant.storage_layer.layer uses a type in control_plane.local_env.
pageserver.tenant.storage_layer.layer uses control_plane.local_env, so a change to control_plane.local_env can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break control_plane.local_env.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
26→36 pageserver.tenant.storage_layer.layer uses pageserver.page_servicepart of a loop✕
Connections
2 pairs of types, where a type in pageserver.tenant.storage_layer.layer uses a type in pageserver.page_service.
pageserver.tenant.storage_layer.layer uses pageserver.page_service, so a change to pageserver.page_service can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break pageserver.page_service.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
26→37 pageserver.tenant.storage_layer.layer uses utils.lsnpart of a loop✕
Connections
1 pair of types, where a type in pageserver.tenant.storage_layer.layer uses a type in utils.lsn.
pageserver.tenant.storage_layer.layer uses utils.lsn, so a change to utils.lsn can break pageserver.tenant.storage_layer.layer, while a change to pageserver.tenant.storage_layer.layer can't break utils.lsn.
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.
utils.logging uses pageserver.tenant.storage_layer.layer, so a change to pageserver.tenant.storage_layer.layer can break utils.logging, while a change to utils.logging can't break pageserver.tenant.storage_layer.layer.
Position
Below the diagonal: utils.logging uses a module listed above it, which is the healthy direction.
pagebench.cmd.basebackup uses utils.id, so a change to utils.id can break pagebench.cmd.basebackup, while a change to pagebench.cmd.basebackup can't break utils.id.
Position
Below the diagonal: pagebench.cmd.basebackup uses a module listed above it, which is the healthy direction.
pagebench.cmd.basebackup uses utils.sync.spsc_fold, so a change to utils.sync.spsc_fold can break pagebench.cmd.basebackup, while a change to pagebench.cmd.basebackup can't break utils.sync.spsc_fold.
Position
Below the diagonal: pagebench.cmd.basebackup uses a module listed above it, which is the healthy direction.
pagebench.cmd.basebackup uses tokio_postgres2.client, so a change to tokio_postgres2.client can break pagebench.cmd.basebackup, while a change to pagebench.cmd.basebackup can't break tokio_postgres2.client.
Position
Below the diagonal: pagebench.cmd.basebackup uses a module listed above it, which is the healthy direction.
pagebench.cmd.basebackup uses compute_tools.bin.fast_import, so a change to compute_tools.bin.fast_import can break pagebench.cmd.basebackup, while a change to pagebench.cmd.basebackup can't break compute_tools.bin.fast_import.
Position
Below the diagonal: pagebench.cmd.basebackup uses a module listed above it, which is the healthy direction.
pagebench.cmd.basebackup uses utils.logging, so a change to utils.logging can break pagebench.cmd.basebackup, while a change to pagebench.cmd.basebackup can't break utils.logging.
Position
Below the diagonal: pagebench.cmd.basebackup uses a module listed above it, which is the healthy direction.
28→37 pagebench.cmd.basebackup uses utils.lsnpart of a loop✕
Connections
4 pairs of types, where a type in pagebench.cmd.basebackup uses a type in utils.lsn.
pagebench.cmd.basebackup uses utils.lsn, so a change to utils.lsn can break pagebench.cmd.basebackup, while a change to pagebench.cmd.basebackup can't break utils.lsn.
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.
storage_controller.metrics uses utils.logging, so a change to utils.logging can break storage_controller.metrics, while a change to storage_controller.metrics can't break utils.logging.
Position
Below the diagonal: storage_controller.metrics uses a module listed above it, which is the healthy direction.
29→33 storage_controller.metrics uses storage_controller.persistencepart of a loop✕
Connections
2 pairs of types, where a type in storage_controller.metrics uses a type in storage_controller.persistence.
storage_controller.metrics uses storage_controller.persistence, so a change to storage_controller.persistence can break storage_controller.metrics, while a change to storage_controller.metrics can't break storage_controller.persistence.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
29→35 storage_controller.metrics uses storage_controller.servicepart of a loop✕
Connections
2 pairs of types, where a type in storage_controller.metrics uses a type in storage_controller.service.
storage_controller.metrics uses storage_controller.service, so a change to storage_controller.service can break storage_controller.metrics, while a change to storage_controller.metrics can't break storage_controller.service.
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.
pageserver_api.models uses postgres_versioninfo, so a change to postgres_versioninfo can break pageserver_api.models, while a change to pageserver_api.models can't break postgres_versioninfo.
Position
Below the diagonal: pageserver_api.models uses a module listed above it, which is the healthy direction.
pageserver_api.models uses utils.id, so a change to utils.id can break pageserver_api.models, while a change to pageserver_api.models can't break utils.id.
Position
Below the diagonal: pageserver_api.models uses a module listed above it, which is the healthy direction.
pageserver_api.models uses pageserver_api.key, so a change to pageserver_api.key can break pageserver_api.models, while a change to pageserver_api.models can't break pageserver_api.key.
Position
Below the diagonal: pageserver_api.models uses a module listed above it, which is the healthy direction.
pageserver_api.models uses utils.shard, so a change to utils.shard can break pageserver_api.models, while a change to pageserver_api.models can't break utils.shard.
Position
Below the diagonal: pageserver_api.models uses a module listed above it, which is the healthy direction.
pageserver_api.models uses pageserver_api.shard, so a change to pageserver_api.shard can break pageserver_api.models, while a change to pageserver_api.models can't break pageserver_api.shard.
Position
Below the diagonal: pageserver_api.models uses a module listed above it, which is the healthy direction.
pageserver_api.models uses pagebench.cmd.basebackup, so a change to pagebench.cmd.basebackup can break pageserver_api.models, while a change to pageserver_api.models can't break pagebench.cmd.basebackup.
Position
Below the diagonal: pageserver_api.models uses a module listed above it, which is the healthy direction.
30→32 pageserver_api.models uses pageserver_api.configpart of a loop✕
Connections
2 pairs of types, where a type in pageserver_api.models uses a type in pageserver_api.config.
pageserver_api.models uses pageserver_api.config, so a change to pageserver_api.config can break pageserver_api.models, while a change to pageserver_api.models can't break pageserver_api.config.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
30→37 pageserver_api.models uses utils.lsnpart of a loop✕
Connections
7 pairs of types, where a type in pageserver_api.models uses a type in utils.lsn.
pageserver_api.models uses utils.lsn, so a change to utils.lsn can break pageserver_api.models, while a change to pageserver_api.models can't break utils.lsn.
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.
proxy.auth.backend uses proxy.config, so a change to proxy.config can break proxy.auth.backend, while a change to proxy.auth.backend can't break proxy.config.
Position
Below the diagonal: proxy.auth.backend uses a module listed above it, which is the healthy direction.
proxy.auth.backend uses pageserver.context, so a change to pageserver.context can break proxy.auth.backend, while a change to proxy.auth.backend can't break pageserver.context.
Position
Below the diagonal: proxy.auth.backend uses a module listed above it, which is the healthy direction.
proxy.auth.backend uses pagebench.cmd.basebackup, so a change to pagebench.cmd.basebackup can break proxy.auth.backend, while a change to proxy.auth.backend can't break pagebench.cmd.basebackup.
Position
Below the diagonal: proxy.auth.backend uses a module listed above it, which is the healthy direction.
pageserver_api.config uses utils.logging, so a change to utils.logging can break pageserver_api.config, while a change to pageserver_api.config can't break utils.logging.
Position
Below the diagonal: pageserver_api.config uses a module listed above it, which is the healthy direction.
pageserver_api.config uses pageserver_api.models, so a change to pageserver_api.models can break pageserver_api.config, while a change to pageserver_api.config can't break pageserver_api.models.
Position
Below the diagonal: pageserver_api.config uses a module listed above it, which is the healthy direction.
storage_controller.persistence uses utils.id, so a change to utils.id can break storage_controller.persistence, while a change to storage_controller.persistence can't break utils.id.
Position
Below the diagonal: storage_controller.persistence uses a module listed above it, which is the healthy direction.
storage_controller.persistence uses utils.shard, so a change to utils.shard can break storage_controller.persistence, while a change to storage_controller.persistence can't break utils.shard.
Position
Below the diagonal: storage_controller.persistence uses a module listed above it, which is the healthy direction.
storage_controller.persistence uses utils.logging, so a change to utils.logging can break storage_controller.persistence, while a change to storage_controller.persistence can't break utils.logging.
Position
Below the diagonal: storage_controller.persistence uses a module listed above it, which is the healthy direction.
storage_controller.persistence uses storage_controller.metrics, so a change to storage_controller.metrics can break storage_controller.persistence, while a change to storage_controller.persistence can't break storage_controller.metrics.
Position
Below the diagonal: storage_controller.persistence uses a module listed above it, which is the healthy direction.
storage_controller.persistence uses pageserver_api.models, so a change to pageserver_api.models can break storage_controller.persistence, while a change to storage_controller.persistence can't break pageserver_api.models.
Position
Below the diagonal: storage_controller.persistence uses a module listed above it, which is the healthy direction.
33→37 storage_controller.persistence uses utils.lsnpart of a loop✕
Connections
1 pair of types, where a type in storage_controller.persistence uses a type in utils.lsn.
storage_controller.persistence uses utils.lsn, so a change to utils.lsn can break storage_controller.persistence, while a change to storage_controller.persistence can't break utils.lsn.
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.
control_plane.local_env uses postgres_versioninfo, so a change to postgres_versioninfo can break control_plane.local_env, while a change to control_plane.local_env can't break postgres_versioninfo.
Position
Below the diagonal: control_plane.local_env uses a module listed above it, which is the healthy direction.
control_plane.local_env uses utils.id, so a change to utils.id can break control_plane.local_env, while a change to control_plane.local_env can't break utils.id.
Position
Below the diagonal: control_plane.local_env uses a module listed above it, which is the healthy direction.
control_plane.local_env uses tokio_postgres2.client, so a change to tokio_postgres2.client can break control_plane.local_env, while a change to control_plane.local_env can't break tokio_postgres2.client.
Position
Below the diagonal: control_plane.local_env uses a module listed above it, which is the healthy direction.
control_plane.local_env uses pageserver_api.config, so a change to pageserver_api.config can break control_plane.local_env, while a change to control_plane.local_env can't break pageserver_api.config.
Position
Below the diagonal: control_plane.local_env uses a module listed above it, which is the healthy direction.
storage_controller.service uses endpoint_storage.main, so a change to endpoint_storage.main can break storage_controller.service, while a change to storage_controller.service can't break endpoint_storage.main.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
storage_controller.service uses neon_shmem.shmem, so a change to neon_shmem.shmem can break storage_controller.service, while a change to storage_controller.service can't break neon_shmem.shmem.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
storage_controller.service uses postgres_versioninfo, so a change to postgres_versioninfo can break storage_controller.service, while a change to storage_controller.service can't break postgres_versioninfo.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
storage_controller.service uses utils.id, so a change to utils.id can break storage_controller.service, while a change to storage_controller.service can't break utils.id.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
storage_controller.service uses utils.sync.gate, so a change to utils.sync.gate can break storage_controller.service, while a change to storage_controller.service can't break utils.sync.gate.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
storage_controller.service uses utils.shard, so a change to utils.shard can break storage_controller.service, while a change to storage_controller.service can't break utils.shard.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
storage_controller.service uses utils.sync.spsc_fold, so a change to utils.sync.spsc_fold can break storage_controller.service, while a change to storage_controller.service can't break utils.sync.spsc_fold.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
storage_controller.service uses pageserver_api.shard, so a change to pageserver_api.shard can break storage_controller.service, while a change to storage_controller.service can't break pageserver_api.shard.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
storage_controller.service uses tokio_postgres2.client, so a change to tokio_postgres2.client can break storage_controller.service, while a change to storage_controller.service can't break tokio_postgres2.client.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
storage_controller.service uses pageserver.tenant, so a change to pageserver.tenant can break storage_controller.service, while a change to storage_controller.service can't break pageserver.tenant.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
storage_controller.service uses pageserver_api.models, so a change to pageserver_api.models can break storage_controller.service, while a change to storage_controller.service can't break pageserver_api.models.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
storage_controller.service uses pageserver_api.config, so a change to pageserver_api.config can break storage_controller.service, while a change to storage_controller.service can't break pageserver_api.config.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
storage_controller.service uses storage_controller.persistence, so a change to storage_controller.persistence can break storage_controller.service, while a change to storage_controller.service can't break storage_controller.persistence.
Position
Below the diagonal: storage_controller.service uses a module listed above it, which is the healthy direction.
35→37 storage_controller.service uses utils.lsnpart of a loop✕
Connections
1 pair of types, where a type in storage_controller.service uses a type in utils.lsn.
storage_controller.service uses utils.lsn, so a change to utils.lsn can break storage_controller.service, while a change to storage_controller.service can't break utils.lsn.
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.
pageserver.page_service uses utils.id, so a change to utils.id can break pageserver.page_service, while a change to pageserver.page_service can't break utils.id.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses utils.sync.gate, so a change to utils.sync.gate can break pageserver.page_service, while a change to pageserver.page_service can't break utils.sync.gate.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses utils.shard, so a change to utils.shard can break pageserver.page_service, while a change to pageserver.page_service can't break utils.shard.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses pageserver_api.shard, so a change to pageserver_api.shard can break pageserver.page_service, while a change to pageserver.page_service can't break pageserver_api.shard.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses pageserver.tenant.timeline.handle, so a change to pageserver.tenant.timeline.handle can break pageserver.page_service, while a change to pageserver.page_service can't break pageserver.tenant.timeline.handle.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses pageserver.tenant.timeline, so a change to pageserver.tenant.timeline can break pageserver.page_service, while a change to pageserver.page_service can't break pageserver.tenant.timeline.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses pageserver.tenant.mgr, so a change to pageserver.tenant.mgr can break pageserver.page_service, while a change to pageserver.page_service can't break pageserver.tenant.mgr.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses pageserver.metrics, so a change to pageserver.metrics can break pageserver.page_service, while a change to pageserver.page_service can't break pageserver.metrics.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses pageserver.context, so a change to pageserver.context can break pageserver.page_service, while a change to pageserver.page_service can't break pageserver.context.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses pageserver.virtual_file.owned_buffers_io.write.flush, so a change to pageserver.virtual_file.owned_buffers_io.write.flush can break pageserver.page_service, while a change to pageserver.page_service can't break pageserver.virtual_file.owned_buffers_io.write.flush.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses pageserver.tenant.storage_layer.layer, so a change to pageserver.tenant.storage_layer.layer can break pageserver.page_service, while a change to pageserver.page_service can't break pageserver.tenant.storage_layer.layer.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses pagebench.cmd.basebackup, so a change to pagebench.cmd.basebackup can break pageserver.page_service, while a change to pageserver.page_service can't break pagebench.cmd.basebackup.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses pageserver_api.config, so a change to pageserver_api.config can break pageserver.page_service, while a change to pageserver.page_service can't break pageserver_api.config.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses control_plane.local_env, so a change to control_plane.local_env can break pageserver.page_service, while a change to pageserver.page_service can't break control_plane.local_env.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
pageserver.page_service uses storage_controller.service, so a change to storage_controller.service can break pageserver.page_service, while a change to pageserver.page_service can't break storage_controller.service.
Position
Below the diagonal: pageserver.page_service uses a module listed above it, which is the healthy direction.
36→37 pageserver.page_service uses utils.lsnpart of a loop✕
Connections
5 pairs of types, where a type in pageserver.page_service uses a type in utils.lsn.
pageserver.page_service uses utils.lsn, so a change to utils.lsn can break pageserver.page_service, while a change to pageserver.page_service can't break utils.lsn.
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.
utils.lsn uses pageserver.page_service, so a change to pageserver.page_service can break utils.lsn, while a change to utils.lsn can't break pageserver.page_service.
Position
Below the diagonal: utils.lsn uses a module listed above it, which is the healthy direction.
compute_tools.compute uses endpoint_storage.main, so a change to endpoint_storage.main can break compute_tools.compute, while a change to compute_tools.compute can't break endpoint_storage.main.
Position
Below the diagonal: compute_tools.compute uses a module listed above it, which is the healthy direction.
compute_tools.compute uses neon_shmem.shmem, so a change to neon_shmem.shmem can break compute_tools.compute, while a change to compute_tools.compute can't break neon_shmem.shmem.
Position
Below the diagonal: compute_tools.compute uses a module listed above it, which is the healthy direction.
compute_tools.compute uses remote_storage, so a change to remote_storage can break compute_tools.compute, while a change to compute_tools.compute can't break remote_storage.
Position
Below the diagonal: compute_tools.compute uses a module listed above it, which is the healthy direction.
compute_tools.compute uses utils.id, so a change to utils.id can break compute_tools.compute, while a change to compute_tools.compute can't break utils.id.
Position
Below the diagonal: compute_tools.compute uses a module listed above it, which is the healthy direction.
compute_tools.compute uses utils.sync.spsc_fold, so a change to utils.sync.spsc_fold can break compute_tools.compute, while a change to compute_tools.compute can't break utils.sync.spsc_fold.
Position
Below the diagonal: compute_tools.compute uses a module listed above it, which is the healthy direction.
compute_tools.compute uses compute_tools.bin.fast_import, so a change to compute_tools.bin.fast_import can break compute_tools.compute, while a change to compute_tools.compute can't break compute_tools.bin.fast_import.
Position
Below the diagonal: compute_tools.compute uses a module listed above it, which is the healthy direction.
compute_tools.compute uses utils.lsn, so a change to utils.lsn can break compute_tools.compute, while a change to compute_tools.compute can't break utils.lsn.
Position
Below the diagonal: compute_tools.compute uses a module listed above it, which is the healthy direction.
safekeeper.timeline uses remote_storage, so a change to remote_storage can break safekeeper.timeline, while a change to safekeeper.timeline can't break remote_storage.
Position
Below the diagonal: safekeeper.timeline uses a module listed above it, which is the healthy direction.
safekeeper.timeline uses utils.sync.gate, so a change to utils.sync.gate can break safekeeper.timeline, while a change to safekeeper.timeline can't break utils.sync.gate.
Position
Below the diagonal: safekeeper.timeline uses a module listed above it, which is the healthy direction.
safekeeper.timeline uses utils.sync.spsc_fold, so a change to utils.sync.spsc_fold can break safekeeper.timeline, while a change to safekeeper.timeline can't break utils.sync.spsc_fold.
Position
Below the diagonal: safekeeper.timeline uses a module listed above it, which is the healthy direction.
safekeeper.timeline uses pageserver.tenant.timeline.handle, so a change to pageserver.tenant.timeline.handle can break safekeeper.timeline, while a change to safekeeper.timeline can't break pageserver.tenant.timeline.handle.
Position
Below the diagonal: safekeeper.timeline uses a module listed above it, which is the healthy direction.
safekeeper.timeline uses pagebench.cmd.basebackup, so a change to pagebench.cmd.basebackup can break safekeeper.timeline, while a change to safekeeper.timeline can't break pagebench.cmd.basebackup.
Position
Below the diagonal: safekeeper.timeline uses a module listed above it, which is the healthy direction.
safekeeper.timeline uses pageserver_api.models, so a change to pageserver_api.models can break safekeeper.timeline, while a change to safekeeper.timeline can't break pageserver_api.models.
Position
Below the diagonal: safekeeper.timeline uses a module listed above it, which is the healthy direction.
safekeeper.timeline uses utils.lsn, so a change to utils.lsn can break safekeeper.timeline, while a change to safekeeper.timeline can't break utils.lsn.
Position
Below the diagonal: safekeeper.timeline uses a module listed above it, which is the healthy direction.
39→40 safekeeper.timeline uses safekeeper.debug_dumppart of a loop✕
Connections
1 pair of types, where a type in safekeeper.timeline uses a type in safekeeper.debug_dump.
safekeeper.timeline uses safekeeper.debug_dump, so a change to safekeeper.debug_dump can break safekeeper.timeline, while a change to safekeeper.timeline can't break safekeeper.debug_dump.
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.
safekeeper.debug_dump uses endpoint_storage.main, so a change to endpoint_storage.main can break safekeeper.debug_dump, while a change to safekeeper.debug_dump can't break endpoint_storage.main.
Position
Below the diagonal: safekeeper.debug_dump uses a module listed above it, which is the healthy direction.
safekeeper.debug_dump uses remote_storage, so a change to remote_storage can break safekeeper.debug_dump, while a change to safekeeper.debug_dump can't break remote_storage.
Position
Below the diagonal: safekeeper.debug_dump uses a module listed above it, which is the healthy direction.
safekeeper.debug_dump uses utils.id, so a change to utils.id can break safekeeper.debug_dump, while a change to safekeeper.debug_dump can't break utils.id.
Position
Below the diagonal: safekeeper.debug_dump uses a module listed above it, which is the healthy direction.
safekeeper.debug_dump uses compute_tools.bin.fast_import, so a change to compute_tools.bin.fast_import can break safekeeper.debug_dump, while a change to safekeeper.debug_dump can't break compute_tools.bin.fast_import.
Position
Below the diagonal: safekeeper.debug_dump uses a module listed above it, which is the healthy direction.
safekeeper.debug_dump uses pageserver.tenant.timeline.handle, so a change to pageserver.tenant.timeline.handle can break safekeeper.debug_dump, while a change to safekeeper.debug_dump can't break pageserver.tenant.timeline.handle.
Position
Below the diagonal: safekeeper.debug_dump uses a module listed above it, which is the healthy direction.
safekeeper.debug_dump uses utils.lsn, so a change to utils.lsn can break safekeeper.debug_dump, while a change to safekeeper.debug_dump can't break utils.lsn.
Position
Below the diagonal: safekeeper.debug_dump uses a module listed above it, which is the healthy direction.
safekeeper.debug_dump uses safekeeper.timeline, so a change to safekeeper.timeline can break safekeeper.debug_dump, while a change to safekeeper.debug_dump can't break safekeeper.timeline.
Position
Below the diagonal: safekeeper.debug_dump uses a module listed above it, which is the healthy direction.
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
A02:2025 — Security Misconfiguration
127
High / Critical
A03:2025 — Software Supply Chain Failures
122
High / Critical
A05:2025 — Injection
89
High / Critical
A07:2025 — Authentication Failures
11
High / Critical
Roadmap
Immediately address the eight leaked secrets in configuration files and resolve the 73 medium-severity infrastructure-as-code issues, particularly within Dockerfiles. Next, update the end-of-life Rust toolchain and remediate the 45 low-severity container security recommendations. Finally, eliminate the 30 static analysis findings related to secret inheritance in the build and test pipelines.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Resolve the 8 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (4), REDACTED (2), REDACTED (2).
Resolve the 7 REDACTED finding(s) charged to Static Analysis (SAST) — the other 4 are reported here at file:line but scored by D36 (supply-chain provenance), which charges them once.
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 — 134
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 — 965
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 — 615
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 8
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. 73 of 73 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 — 73 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, 1690 of 1714 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.
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) and this repository declares a Python test suite (repository root, 200 test files), but it was not re-run: no test result was produced. Not scored — this is a gap in the analyzer's language coverage, not a finding about this repository.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Cargo manifest, but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its Cargo dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares a Python pyproject.toml/requirements.txt (pip/uv/Poetry), but the licence verdict published here was taken over its NuGet package dependencies. Nothing was read about its Python dependencies' licensing in either direction, and a clean score on this card must not be read as covering them.
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 REDACTED, but the licence verdict published here was taken over its NuGet package 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.
D17 Explicit Debt — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 1 deducted marker(s) and the 0.1/KLoC density on this row were taken over this repository's .NET projects ALONE: .rs (255,291 lines, 87% of production source) went unread, because every marker collector on this path is reached through a C# workspace. A read-only sweep of that source finds at least 750 task marker(s) (TODO/FIXME/HACK/XXX) across 242 file(s) that this score does not count — a floor, since only line comments are read there and D17's other eight marker kinds (suppressions, NoWarn, editorconfig severities, empty catches, commented-out code, Obsolete, dead code, preprocessor branches) need a compiler we do not have for that language. The debt in that source is UNMEASURED — its absence from the score above is a gap in this analyzer's language coverage, not a finding that the code carries none.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. Each ecosystem's manifests (what makes a folder runnable or a published package) need their own proof before D19 judges its units. Until then those folders' READMEs are judged only as documents (boilerplate, structure), never counted as complete.
D19 Documentation Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This kind did not reach the 95 % precision gate in three adjudicated runs (docs/plans/deterministic-engine/adjudication/D19-sample3-v3.md), so by the pre-registered fallback it publishes no row until a re-measurement shows it does. The candidates are counted here, not reported as findings, and the score does not include them.
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. Each source language's comment syntax, and the code a comment annotates in it, needs its own proof before D24 judges it. Until then those comments are left unread, not counted as clean.
D27 Navigability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Navigability is taken over call sites whose callee resolved. For C# that population includes calls into referenced assemblies; for this language only calls declared inside the repository count, so the abstention threshold reads the repository's use of its standard library as a resolution failure. That is a limit of this analyzer, not a build problem in this repository.
D39 IL Efficiency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. IL NOT MEASURED: the analyzer's own build of this repository failed for an ENVIRONMENT reason (exit 1) — MSBuild's engine or the CLR gave up, or our image does not carry the SDK band/targeting pack this repository needs. This is OUR limitation, not a defect in the repo, and it is not a statement that this repository fails to build. D18 owns the question of whether this repository builds; it was not answered here.
AXR1 Runtime accessibility — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Render strategy: boot via DockerCompose (REDACTED). compose up failed (exit 18 — an image could not be pulled) — minio_create_buckets Error context canceled compute1 Warning context canceled minio Error context canceled storage_broker Error context canceled safekeeper3 Error context canceled safekeeper1 Error context canceled safekeeper2 Error context canceled pageserver Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: compute_is_ready Error Get "https://registry-1.docker.io/v2/": Forbidden minio_create_buckets Error context canceled minio Error context canceled pageserver Error context canceled compute1 Warning context canceled WARNING: Some service image(s) must be built from source by running: docker compose build compute1 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.
ED5 Idempotency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. This check decides whether a handler's mutation is safe to re-run by recognising its persistence writes (a database save, a repository write, an event publish) and its guards. Those markers are .NET member names, so in this repository's language a write such as `repository.save(order)` is not recognised and a same-named call on an unrelated library type could be. The handlers were found; their idempotency was neither confirmed nor ruled out.
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.
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.
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.
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.
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.
93 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was Timeline::compact_with_gc_inner at 86. A further 7 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 Message::parse at 38 — they are counted neither in the figure above nor in this dimension's score. 4 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: libs/proxy/postgres-protocol2/src/message/backend.rs (Message::parse at 38), libs/proxy/tokio-postgres2/src/error/mod.rs (DbError::parse at 22), pageserver/client_grpc/src/retry.rs (Retry::should_retry at 17), proxy/src/auth/mod.rs (AuthError::to_string_client at 16). 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.
+ 40 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 60 down to 60 or less in Cyclomatic Complexity — start with Timeline::compact_with_gc_inner (cyclomatic 86), storcon_cli::main (cyclomatic 80), MetadataRecord::decode_heapam_record (cyclomatic 74). — 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 3 together lifts Cyclomatic Complexity from 6.2 to about 6.5/10, projected with the scoring formula itself and assuming each lands exactly at 60; a cleaner split scores higher.
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.
+ 86 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 3 bodies over 120 down to 120 or less in Cognitive Complexity — start with MetadataRecord::decode_heapam_record (cognitive 196), Timeline::compact_with_gc_inner (cognitive 154), Timeline::compact_level0_phase1 (cognitive 122). — 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 3 together lifts Cognitive Complexity from 4.5 to about 5.2/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes8.4 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
+ 2 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 63 FileTooLong finding(s) in God Classes — start with lib.rs (3), timeline.rs (2), metrics.rs (2). — One of this dimension's main actionable groups (63 warning-level).
Resolve the 55 MethodTooLong finding(s) in God Classes — start with service.rs (8), compaction.rs (6), page_service.rs (5). — One of this dimension's main actionable groups (55 warning-level).
Resolve the 43 FunctionTooLong finding(s) in God Classes — start with main.rs (3), proxy.rs (3), neon_local.rs (2). — One of this dimension's main actionable groups (43 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.
232 duplicated block group(s) detected. A further 15 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted.
+ 75 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 20 Duplicated block (8 lines × 2) finding(s) in Code Duplication — start with monitor.rs, pg_isready.rs, background_process.rs. — One of this dimension's main actionable groups (20 warning-level).
Resolve the 18 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with pgdatadir_mapping.rs (3), gcs_bucket.rs (2), mgmt_api.rs (2). — One of this dimension's main actionable groups (18 warning-level).
Resolve the 14 Duplicated block (10 lines × 2) finding(s) in Code Duplication — start with http.rs (5), delta_layer.rs (2), neon_local.rs. — One of this dimension's main actionable groups (14 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling8.9 / 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.
49 production modules (Cargo), 0 dependency cycle(s), 0 unstable depended-on module(s). Read from the build's own module declarations; 7 module(s) off the main sequence, with abstractness counted on 46 of the 49 (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: pageserver_page_api · ×7
What to do
Resolve the 7 Off the main sequence finding(s) in Coupling. — One of this dimension's main actionable groups (7 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 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with timeline.rs, mod.rs, jemalloc.rs. — One of this dimension's main actionable groups (4 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.
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.
1504 test methods: 1461 unit, 43 integration, 0 BDD, 0 e2e. The Rust suite contributes 837 `#[test]` function(s) across 202 file(s) declaring at least one; its unit/integration split is Cargo's own — 13 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 667 test function(s) across 200 file(s) declaring at least one — every `def test…` in a file pytest or unittest would collect, which is those frameworks' own definition of a case; a parametrize table counts once, so this is a floor. Its tier split is read from file names and paths only.
What it measures: Whether 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.
1 outdated direct SwiftPM dependencies, 0 pinning defect(s). 1 of 2 direct dependencies had their releases listed (0 naming no readable repository, 1 pinned to a branch or a revision rather than a version). SwiftPM has no package registry: a dependency is a repository URL and its releases are that repository's semver tags, so currency is answered by listing tags rather than by querying an index. Only a newer tag on the SAME MAJOR is reported — a `from:` requirement admits everything below the next major and nothing above it, so a major crossing needs a Package.swift edit rather than an update, and naming the update as its remedy would be wrong. Whether any dependency is DEPRECATED or ABANDONED is not graded and cannot be: a repository publishes no such marker, and there is no registry that could carry one. Known CVEs in this dependency graph are D30's question.
Outdated: postgres-nio
What to do
Maintain Dependency Hygiene — already on the Gold path. — No findings, and enforcement is at this dimension's ceiling.
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 8 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (4), REDACTED (2), REDACTED (2). — One of this dimension's main actionable groups (8 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 88 packages use a banned license. ★ DEPTH: this repository's MSBuild projects declare 1 direct `PackageReference`(s), and 87 further package(s) were reached beyond them by closing the graph over nuget.org's own nuspec dependency graph — so a banned licence pulled in only by a dependency's OWN dependencies is inside this verdict. A package whose licence nuget.org could not be asked for is not graded, and version ranges are taken at their lower bound, so this is the closure as that graph states it rather than a restored consumer's exact resolution. ★ COVERAGE OF THIS VERDICT: it grades this repository's NuGet package dependencies and nothing else. The repository also declares a Cargo manifest, a Python pyproject.toml/requirements.txt (pip/uv/Poetry) and REDACTED, and the licences of those dependency graphs were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
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.
19 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is libs/remote_storage/src/gcs_bucket.rs. Counted over 484 of the 660 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Off-boarding risk: anonymized user #1 · ×3
Further sole-owners (lower concentration)
✓ On the Gold path — maintain.
Detailed fixes: d16_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Acknowledged debt left in the code — TODOs, dead code, suppressed warnings.
Method: Roslyn syntactic debt markers (suppressions/TODO/FIXME/HACK/empty-catch/commented-code/Obsolete) plus SymbolFinder dead-code analysis; weighted-debt-per-KLoC density deducted 2.0x per unit. Deterministic, exhaustive.
1 deducted debt markers + 0 dead symbols across 15 LoC in the .NET projects (0.1/KLoC) → score 9.8. Measured on the .NET source only: .rs (87% of production source) was not read, and carries at least 750 uncounted task marker(s) in 242 file(s).
CommentedOutCodeREDACTED:1176
What to do
Resolve the 1 CommentedOutCode finding(s) in Explicit Debt — start with REDACTED. — One of this dimension's main actionable groups (1 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. 66 document(s) read across 2 unit(s).
✓ On the Gold path — maintain.
Detailed fixes: d19_recommendation.md.
Do you agree with this assessment?
D20 · ADR Quality9.6 / 10Exemplary✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
4 of 58 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 · ×2docs/rfcs/037-storage-controller-restarts.md:1detected by adr-integrity
ADR has no Consequences sectiondocs/rfcs/022-pageserver-delete-from-s3.md:1detected by adr-integrity
ADR considers only one optiondocs/rfcs/037-storage-controller-restarts.md:237detected by adr-integrity
ADR has no titledocs/rfcs/041-sharded-ingest.md:1detected by adr-integrity
✓ On the Gold path — maintain.
Detailed fixes: d20_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets were ever committed — scanned across the full git history, not just now.
Method: REDACTED scan via TWO gitleaks detect passes in an isolated checkout — the full git history, then a second --no-git pass over the working tree as it stands — merged and de-duplicated by (rule, file, line); each match flagged High. Both invocations are recorded in the audit trail. Exhaustive; when the tool is absent, or when its output cannot be parsed into the expected shape, the dimension is WITHHELD as an explicit measurement gap on our side — unscored and excluded from the lens, never a hedged middling score.
2 finding(s): 0 critical, 2 high, 0 medium, 0 low. Remediation for historically-committed secrets is credential rotation — they remain in history regardless of later deletion.
REDACTED
REDACTED
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 High secret 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).
89 finding(s): 0 critical, 76 high, 4 medium, 9 low. 4 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 19 file(s) — `REDACTED`, `compute_tools/src/spec_apply.rs` (line 454, line 455, line 456, …), `docker-compose/docker_compose_test.sh` (line 59), `docker-compose/ext-src/alter_db.sh` (line 9), `pageserver/src/tenant/layer_map.rs` (line 1305), … (+14 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 17 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
+ 9 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 30 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (14), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (30 issue-level).
Resolve the 19 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED (9), REDACTED, REDACTED. — One of this dimension's main actionable groups (19 issue-level).
Resolve the 7 REDACTED finding(s) charged to Static Analysis (SAST) — the other 4 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 (11 issue-level, 7 of them charged here).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
+ 5 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 25 High CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (15), REDACTED (6), REDACTED (4). — One of this dimension's main actionable groups (25 issue-level).
Resolve the 5 Critical CVE finding(s) in Dependency Vulnerabilities — start with REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (5 issue-level).
Resolve the 5 High vulnerability finding(s) in Dependency Vulnerabilities — start with REDACTED (2), REDACTED (2), REDACTED. — 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 73 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (60), REDACTED (11), REDACTED. — One of this dimension's main actionable groups (73 warning-level).
Resolve the 45 Low IaC finding(s) in IaC & Container Security — start with REDACTED (40), REDACTED (5). — One of this dimension's main actionable groups (45 recommendation-level).
Resolve the 9 High IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (3), REDACTED (2). — One of this dimension's main actionable groups (9 issue-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.
480 of 484 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is pageserver/src/tenant.rs. Counted over 484 of the 660 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Most significant orphaned file · ×3pageserver/src/tenant.rs:1
Concentrated knowledge decay
What to do
Resolve the 477 Orphaned file finding(s) in Knowledge Freshness — start with lib.rs (23), mod.rs (18), metrics.rs (8). — One of this dimension's main actionable groups (477 recommendation-level).
Resolve the 3 Most significant orphaned file finding(s) in Knowledge Freshness — start with tenant.rs, service.rs, timeline.rs. — One of this dimension's main actionable groups (3 recommendation-level).
Resolve the 1 Concentrated knowledge decay 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 1 Boundary-crossing change coupling finding(s) in Change Coupling — start with compute.rs. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 9 Change coupling finding(s) in Change Coupling — start with mod.rs (2), neon_local.rs, proxy.rs. — One of this dimension's main actionable groups (9 warning-level).
Resolve the 2 Change-coupling hub finding(s) in Change Coupling — start with mod.rs, config.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 8 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (8 warning-level).
Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
Resolve the 3 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (3 warning-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency the repository declares is published as MALICIOUS rather than merely vulnerable — a package that is an attacker's work, in any ecosystem osv-scanner reads. Scored apart from D30 because the answer is binary: there is no safe version to upgrade to, and the fix is to remove the package and rotate every credential it could have read.
Method: The same dependency scan D30 reads, partitioned on the scanner's own classification rather than rescanned: a row is MALICIOUS when its id is in the `MAL-` space (the ossf/malicious-packages feed) OR its `database_specific.cwe_ids` carries `CWE-506` ("Embedded Malicious Code"). Both channels are structural; the summary text is deliberately NOT read, because a malicious-package record whose summary says only "Critical severity vulnerability" is a real shape ([GHSA redacted]) and a text matcher misses it. Scored BINARY: any surviving row is 0, whatever its severity and however many CVEs sit beside it — a hostile dependency is not a quantity. Applicability and degradation are D30's: NotApplicable only when no ecosystem is readable, and an unscannable ecosystem degrades rather than reading clean. SCORED, not informational.
What it measures: Whether anyone still ships security patches for the platform this repository RUNS ON — the runtime it pins and the framework majors its own constraints hold it to. Separate from D12 because the question differs: a current Django on an end-of-life Python is perfectly up to date and completely unsupported, and the fix is a migration rather than a version bump. What the repository says it merely SUPPORTS is never charged.
Method: End-of-life PLATFORM read from the repository's own declarations and graded against a FROZEN, dated table of vendor support dates — no network, no feed, no API, so this dimension answers identically inside a closed scan fence. Two subjects: a RUNTIME the project pins (a single or all-end-of-life TargetFramework, a .nvmrc or .python-version, a requires-python CAP) and a FRAMEWORK major a dependency constraint cannot move off (a caret, tilde or exact version; `vue@^2.7.16` pins Vue 2). A FLOOR is deliberately never charged — `requires-python = ">=3.8"` states what a package SUPPORTS, not what it runs on — and a multi-target project is charged only when EVERY target is out of support. Runtime 4.0/product capped 8.0, framework 1.5 capped 4.5. The table is safe to freeze because a statement about support that ended in the past cannot become false: it loses recall as it ages, never precision, and a test asserts every entry predates the freeze date. Disjoint from D31 (a container image's OS layer) and D29 (the toolchain a CI workflow installs). Abstains when the repository declares no platform this pass reads — never scores it clean.
1 end-of-life runtime(s) and 0 end-of-life framework(s), read from 2 platform declaration(s) and 46 dependency declaration(s). This dimension reads what the repository says about ITSELF — a pinned target framework, a version file, a capped requires-python, a Rust toolchain pin, a framework major a constraint cannot move off. A FLOOR is deliberately never charged: `requires-python = ">=3.8"` states what the package SUPPORTS, not what it runs on, and a well-maintained library declares exactly that while running its own CI on a current release. The end-of-life facts are FROZEN and dated, so this dimension needs no network and answers identically inside a closed scan fence; as the table ages it loses recall and never precision, because a statement about support that ended in the past cannot become false. The OS layer of a container image is D31's question and the toolchain a CI workflow installs is D29's; this row is neither.
Resolve the 1 End-of-life runtime finding(s) in Platform End-of-Life — start with rust-toolchain.toml. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d44_recommendation.md · top locations in Appendix A, every location in findings.md.
Other · Architecture — How the codebase splits by code ROLE — domain, application, infrastructure, test, generated. The significance map behind the knowledge/coupling weighting, and a DDD signal in its own right: a thin domain core under fat infrastructure is the anemic-domain smell, quantified. How each file's role is decided, because the split is only as good as that: a generated name or a build-output tree makes it Generated, a test project makes it Test, and otherwise the file's NAMESPACE and PATH words are matched against fixed vocabularies in a fixed ORDER — domain, then infrastructure, then application — so a file whose words hit two layers is counted under the earlier one. A production file matching none of them counts as application, so that share reads 'application or unclassified' rather than a measured application layer. Roles come from naming convention, never from what the code does.
Method: Roslyn line-count by code ROLE: every source file classified Domain/Application/Infrastructure/Test/Generated by namespace + path convention (the shared CodeRoleClassifier), then significant lines summed per role. Deterministic; the advisory score is the business-logic (domain+application) share of production code.
Coverage: Population: ALL source files, each bucketed into ONE of five roles (Domain/Application/Infrastructure/Test/Generated) by namespace + path convention — a file whose layer isn't named in the convention falls to Application (the neutral default), and the split is line-count, not semantic depth or business value.
What to do
The domain core is a small share of production code, but most of the rest matched no layer vocabulary at all — so this is not yet an anemic-domain finding. The namespace/path convention could not place that code, which makes the composition above a statement about the naming, not about the design. Name the layers (or check that the repository's conventions differ from the ones this check knows) before reading a thin domain into it.
Other · Architecture — Whether the project-reference graph is acyclic (cycles block independent build/deploy and signal eroding boundaries).
Method: Project reference cycles via elementary-DFS over real .csproj references, using the engine shared with D5/D7; cyclic versus acyclic. Exhaustive, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Do you agree with this assessment?
AX8 · Test isolation10.0 / 10Exemplary✓ Tool-verified
Other · Architecture — Whether production projects stay free of references to test projects — tests may depend on production, never the reverse.
Method: Csproj graph: each production project checked for references to test projects (identified by test-framework presence, not name). Zero violations is clean. Deterministic.
Other · Architecture — Whether read (query) handlers stay side-effect-free — a query that writes persistent state or raises events breaks CQS and makes reads unsafe to retry, cache, or route to a read replica.
Method: Roslyn scan: CQRS handlers classified query-vs-command by interface (IQueryHandler/ICommandHandler/IRequestHandler<TQuery,TResult>) and name convention (*Query/Get*/Find* vs *Command); each query handler's body checked for persistent-state writes (SaveChanges/repository Add-Update) or event publishes by resolved invocation. Deterministic, type-level, exhaustive over the detected handlers.
Coverage: Population: CQRS handlers identified by IQueryHandler/ICommandHandler/IRequestHandler interface + *Query/Get*/Find*/*Command NAME convention; query purity then checked exhaustively within that set — a query handler using neither convention is invisible, and mutation is a resolved persistence/publish CALL, not full dataflow.
`spec_apply$module.get_operations` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — compute_tools/src/spec_apply.rs:671
`Timeline.get_current_logical_size_non_incremental` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command. — pageserver/src/tenant/timeline.rs:1381
What to do
Keep query handlers read-only — move the writes/event-publishes into a command handler so reads stay safe to retry, cache, and route to a read replica.
Do you agree with this assessment?
DM4 · Rich vs anemic domain model10.0 / 10Exemplary✓ Tool-verified
Other · Domain Modelling — Whether domain entities own their behaviour (invariant-enforcing commands) rather than being data-only structs driven by a foreign service.
Method: Roslyn (DDD-gated): entity method BODIES classified mutator-vs-query — only methods that mutate the entity's own declared state count as invariant-protecting behaviour, so a getter/passthrough doesn't rescue an anemic class. Deterministic, exhaustive over domain-layer entities.
Coverage: Population: entities by name/base convention; rich-vs-anemic judged by classifying each method body mutator-vs-query — logic-bearing domain types outside the convention are invisible.
Other · Domain Modelling — Whether a domain type's identity-bearing field stays immutable — a `pub` mutable field under a hand-rolled Hash/PartialEq breaks the value-identity invariant.
Method: Roslyn (DDD-gated): entities scanned for publicly writable state — public setters, and (C#/VB) own mutable collections handed out through an auto-property, a public field or a bare-field expression getter, where a computed/copying getter is never charged. One finding per entity; score softened when Marten/EF rehydration frameworks present. Deterministic, framework-aware.
Coverage: Population: entities by convention; encapsulation (setter shape) checked exhaustively within the set.
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.
Other · Code Health — Unreviewed-generation residue: shipped members still throwing NotImplementedException, and placeholder string literals left in non-test, non-generated code. Scored as a quality signature, never as a claim about authorship.
Method: Roslyn syntax scan: NotImplementedException throws and placeholder string literals in non-test, non-generated shipped code. Deterministic, code-shape signature.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a README to the 1 of 1 project(s) that lack one — worth up to 2 pts.
Maturity · Maturity — Whether the README actually describes the code that exists (LLM-judged, advisory).
Method: Judged by language model at low temperature: README accuracy versus actual projects, within a disclosed tolerance. Advisory, not a measured number.
Readiness · Readiness — Whether an automated pipeline builds and tests every change.
Method: Filesystem scan: CI workflow files (.github/workflows, .gitlab-ci.yml, etc.) for build and test stages. Exhaustive, deterministic.
Do you agree with this assessment?
P10 · Library API & versioning10.0 / 10Exemplary○ Nothing flagged
Readiness · Readiness — For a library: a deliberate (small) public API surface and explicit semantic versioning so consumers can depend on it safely.
Method: Roslyn scan: public API surface area and semantic-versioning markers (SemVer attributes, changelog entries) for libraries; off .NET, a library is the ecosystem's publication act (an npm package that is not private and names an entry point, a PyPI distribution with a build system, a Rust library crate, a Maven/Gradle module that publishes, a Go module with no package main, a gemspec, a Composer library, a SwiftPM library product, a pub.dev or Hex package), its surface is the share of types the language model records as public (Rust, Swift, Java, Kotlin, Go, Dart; not measured where the model records no type visibility or, as in TypeScript, only module-level export), and its version is read from the manifest, a semver CHANGELOG, release tooling or semver git tags. Exhaustive, deterministic.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Enable Dependabot/Renovate or a dependency-review gate.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
What to do
Add a `healthcheck:` to the served compose service — probing the endpoint it already answers on where it has one — with `depends_on: condition: service_healthy` on whatever waits for it, and keep the deployed image tag immutable and recorded so rolling back is re-pointing at the previous tag rather than rebuilding.
Do you agree with this assessment?
P5 · DR & Backup4.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
Document RTO/RPO and a tested restore procedure (a backup config alone isn't disaster recovery).
No persistence guard on critical data stores — use Docker named volumes (or your orchestrator's persistent-volume equivalent) so the data store can't be wiped by a container recreate (or, in cloud, set purge-protection / soft-delete / prevent_destroy).
Readiness · Readiness — Whether database schema changes go through versioned migrations rather than being auto-created from the model at startup.
Method: Roslyn scan: EF Core DbContext for a versioned migrations directory versus bare EnsureCreated usage; off .NET, a file scan of dependency manifests, migration histories (Flyway, Liquibase, Alembic, Django, Rails, Prisma, TypeORM, Knex/Sequelize, golang-migrate, goose, Laravel, Doctrine, Diesel/sqlx) and schema auto-create in production source or config. Exhaustive, deterministic.
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.
`new` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs. — libs/remote_storage/src/s3_bucket.rs:72
What to do
Rust: `.await` the future instead of `block_on` (on a Tokio runtime thread it panics outright) and use `tokio::time::sleep(..).await` instead of `std::thread::sleep`; where synchronous code must run, move it to `tokio::task::spawn_blocking` or `block_in_place`.
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 an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `ArgumentNullException` tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a `when` guard is free of side effects — a guard that increments a counter or assigns while deciding whether its arm matches applies that change during PATTERN MATCHING, on an arm that may not be selected, and skips it entirely when a short-circuit to its left answers first.
Method: Roslyn syntax: `when` guards on case labels and switch-expression arms, read for a mutation (`++`/`--`/assignment) sitting in a position the guard's own `&&`/`||`/`??`/`?:`/`?.` can skip. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a method that TAKES a lock or semaphore and gives it back from a flag-guarded `finally` returns the value that flag implies — reporting success while the guard hands the primitive back admits a second caller the exclusion was there to keep out, and reporting failure while the guard keeps it leaves nothing to ever give it back.
Method: Roslyn syntax: `try` statements whose `finally` releases a synchronisation primitive under a bare local-bool guard, where the method also TOOK that same primitive before the `try`, checked for a `return` of a bool literal whose value disagrees with the flag state the method's own straight-line assignments put it in. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether the work a diagnostic log line costs is paid only when that line is wanted — C# evaluates a call's arguments BEFORE the call, so a trace/debug message joined or projected out of a collection is built in full on every pass, and then discarded by a sink the shipped configuration leaves switched off.
Method: Roslyn syntax: log calls at a diagnostic level (a `Log`-prefixed method naming Trace/Debug/Verbose, or a bare `Debug`/`Trace`/`Verbose` on a receiver named for a logger), whose argument list is read for a call whose cost scales with a sequence — a LINQ operator, a materialisation, `string.Join`, a serializer — with no enclosing level check or conditional-compilation region. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `debug`/`trace`/`verbose` call on a receiver named for a logger, or a `log`-prefixed method naming the level, whose argument calls an array operator (`map`/`filter`/`reduce`/`sort`/…), `Array.from`, `Object.keys/values/entries`, `JSON.stringify`/`util.inspect` over anything but a literal, or an array `join` — outside any arrow or function passed as an argument, which the logger calls only when the level is on — with no enclosing `if`, `&&` or `?:` whose condition names a level, a level string, or the `NODE_ENV`/`__DEV__`/`DEV` build switch. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X24 · Document value interpolated into markup unescaped10.0 / 10Exemplary○ Nothing flagged
Other · Security — Whether text read out of the document being converted is escaped before it is written into generated markup — a value the document's author chose, interpolated into an attribute the surrounding literal delimits, can close that attribute and open another.
Method: Roslyn semantic model over the whole compilation: a string-typed `Value`/`InnerText`/`InnerXml`/`Text` member declared inside `DocumentFormat.OpenXml` or `System.Xml` is a taint SOURCE, propagated through assignments, returns, arguments, tuple elements and string composition to its transitive closure, then read at interpolated-string holes that sit in a markup position the surrounding literal itself delimits. Escaper/encoder calls and enclosing validator conditions cut the flow. Flow- and container-insensitive by construction. A second arm needs no provenance at all and reports a type that CONTRADICTS ITSELF — the same expression escaped at one delimited markup hole and interpolated raw at another hole in the same markup position of the same type, which the type's own escaping proves is a defect without knowing where the value came from. On a repository with no .NET source it reads JavaScript/TypeScript off the token stream with the same rule: a DOM read of raw document text (`getAttribute`, `textContent`, `innerText`, `nodeValue`) is the source, propagated through local bindings and string composition, and judged at template-literal and concatenation holes in the same two delimited markup positions; escapers and validating conditions cut it, and documentation-site, test, vendored and minified scripts are not read. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value the caller is invited to supply is the value the type actually uses — a constructor parameter stored in a private field that nothing ever reads while the default it was given is spelled out a second time at the site that should have read it, a keyed lookup that falls back to a different setting than the one its key names while the same type falls back to the matching one for that same key, or a culture-sensitive parse given no format provider by a type that feeds its own settable culture to the same kind of parse elsewhere, or a number an entry point writes to standard output under the host's culture while the same entry point formats with the invariant culture elsewhere. Either way, every caller who supplies a value silently gets something else.
Method: Roslyn syntax: private instance fields of a non-partial type assigned in a constructor from one of its own parameters with a `??` fallback, checked for whether anything in the type body reads the field and whether that same fallback expression is spelled out again outside the constructor; and `??` fallbacks onto a member access from a lookup call carrying exactly one string literal, grouped by that key across the type and checked for a fallback member whose folded name disagrees with the key while a sibling site for the same key agrees with it. On a repository with no .NET source the first two arms read JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `#x`, `private` or `private` parameter-property instance field filled in the constructor from a parameter (or one member of one) through `??`/`||` or a parameter default, never read anywhere in the file by name, whose constructed default is spelled again in the class body; and `lookup("key") ?? s.member` grouped by key per class, or per module outside every class. The culture arm has no JavaScript counterpart: its parses take no locale. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether a value handed from a callback to the body that waits on it crosses on something built to be crossed — a `Queue<T>`/`List<T>`/`Dictionary<K,V>` written inside an event handler and read back outside it is mutated by two flows at once, and the semaphore or completion source beside it orders how MANY items exist while leaving the collection's own head, tail and backing array unprotected.
Method: Roslyn syntax: method, accessor, local-function and lambda bodies that declare BOTH a non-thread-safe generic collection (`Queue`/`Stack`/`List`/`Dictionary`/`HashSet`/`Sorted*`/`LinkedList`) and a synchronisation primitive (`SemaphoreSlim`/`TaskCompletionSource`/`ManualResetEvent(Slim)`/`AutoResetEvent`/`CountdownEvent`) as locals, then read for a `+=`-registered lambda that raises that primitive while the body outside every lambda waits on it — and, in that scope, a mutating call on the collection inside the lambda paired with a mention of it outside. Any `lock` in the scope abstains it. On a repository with no .NET source the same handoff is read in Java off the engine’s own token stream (test source sets, vendored and demonstration paths not): an `ArrayList`/`LinkedList`/`ArrayDeque`/`PriorityQueue`/`Hash*`/`LinkedHash*`/`Tree*` local and a `CountDownLatch`/`Semaphore`/`CompletableFuture` local, a lambda or anonymous class that raises the primitive and mutates the collection, and a wait outside it; any `synchronized` or `lock()` abstains the body. Because each of those primitives orders what the callback wrote before raising it, only a touch that provably overlaps the callback is convicted: one after the registration and before the next wait, or one in a loop registered-before, waiting on every pass and not declaring the collection. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X27 · Collection changed while being enumerated10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a `foreach` leaves the collection it is walking alone — a body that adds to or removes from the very collection the loop is enumerating invalidates the enumerator it is holding, so the next `MoveNext` throws `InvalidOperationException` and the remaining items are never seen.
Method: Roslyn syntax + semantics: `foreach` statements whose body calls a structural mutator (`Add`/`Remove`/`Clear`/`Insert`/…) on the very expression the loop is enumerating. Two arms. ARM A — the source is a concrete fragile BCL collection, or a live `Keys`/`Values` view over one, and the mutator resolves to that same collection's own member; concurrent and immutable collections and arrays are outside the population by construction, since their enumerators survive a structural change. ARM B — the source is an argument-less accessor CALL on a receiver whose body is in source: the accessor must return a stored field VERBATIM and a sibling member must structurally change that same field, both read off the implementations rather than from the members' names. A mutation the loop provably exits immediately after (`break`/`return`/`throw`/`goto`), or one written inside a nested loop or a lambda, is counted and never reported. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X28 · Index access outside its own emptiness guard10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a condition that tests a value for emptiness indexes that same value only where the test holds — an `||` written one parenthesis too far to the left leaves an index access outside the guard beside it, so the empty case the guard exists to anticipate reaches the index and throws.
Method: Roslyn syntax only, no semantic model: the OUTERMOST `&&`/`||` of every boolean condition, read for a symbol the condition tests for emptiness (`string.IsNullOrEmpty`/`IsNullOrWhiteSpace`, a `Length`/`Count` comparison against a literal, `Any()`, a `Length`/`Count` pattern, or a comparison against `""`) and ALSO indexes. Each `symbol[...]` access is placed by a boolean-reachability walk from the access up to the outermost connective: an access is COVERED when some enclosing step has it in the right operand and the left operand, under the truth value that step forces, proves the symbol non-empty — a recursion over `&&`/`||` whose true- and false-directions are asymmetric. A finding needs BOTH an uncovered access and a covered one on the same symbol in the same condition, which is the agreeing twin that separates a misplaced parenthesis from an unrelated length test. Bare index accesses with no emptiness test in the condition are neither counted nor reported; a non-identifier receiver and a lambda nested inside the condition are outside the population. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a decision taken once per element is taken ABOUT that element — a test inside a counted loop that reads a fixed subscript of the very collection its guarded statement indexes by the loop variable applies element zero's answer to all of them, so the elements that differ from it are all handled wrongly, and in the same direction.
Method: Roslyn syntax only, no semantic model: every `for` statement declaring exactly ONE loop variable, and every `if` inside its body that is not under a nested loop or a lambda. A site enters the population when the `if`’s condition never mentions the loop variable while the statement it guards indexes some collection by that variable ALONE (`c[i]`; `c[i + 1]` and `c[i, j]` are outside it). A finding additionally needs the AGREEING TWIN at the same-collection grain: the condition must read THAT SAME collection at a subscript that does not move — written into the condition, or reached through a local declared BEFORE the loop, so an alias bound inside the body is not followed. Both collection expressions must be simple identifiers. On a repository with no .NET source the same rule reads JavaScript/TypeScript off the engine’s own token stream (tests included, bundles and vendored paths not): a `for (let|var|const x = …; …; …)` with one declarator and a braced body, an alias followed only when it is declared before the loop in a block that encloses it and never assigned inside the loop. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X32 · Type resolved by simple name across every loaded assembly10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a plugin lookup names the type it means — searching every assembly loaded into the process for a candidate whose SIMPLE name equals a string supplied at runtime, and taking the first one found, is decided by assembly LOAD ORDER rather than by this source, so the same name can resolve to a different type on the next run.
Method: Roslyn syntax only, no semantic model: every invocation of `First`/`FirstOrDefault`/`Single`/`SingleOrDefault` whose OWN expression subtree contains both a `GetAssemblies()` call and a `GetTypes()`/`GetExportedTypes()` call — a single-element pick out of every type loaded into the process. A nested selector in the same chain sees no `GetAssemblies()` in its own subtree and is outside the population, so one lookup counts once however many links its chain has. A finding additionally needs both remaining halves: the selector must be `First`/`FirstOrDefault` (`Single`/`SingleOrDefault` reports the ambiguity rather than resolving it, and is counted and never reported), and the chain must carry an `==` comparison of `<lambda parameter>.Name` against something that is not a literal. The receiver must be a plain identifier bound by one of the chain’s own lambdas, which places `assembly.GetName().Name == "X"` outside the rule by construction. One exemption: a `.Name` test joined by `&&` to a `FullName`/`AssemblyQualifiedName` test on the same identifier is spared; joined by `||` it is not. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `REDACTED` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
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.
SC1 Supply-chain hygiene — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X10 Duplicated predicate — 4 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 1 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 1 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
P6 Release Hygiene — not evidenced — no changelog, version stamp or semver release tag in the repo
Not included — 51 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC2 Forms & labels — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC3 Page structure — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC4 Keyboard semantics — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC5 ARIA correctness — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC6 Visual & motion safety — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AC7 A11y enforcement — No user-facing web UI (the repo is a library/CLI/worker/headless service) — accessibility is not applicable.
AX1 Captive dependencies — no DI registrations detected
AX2 Stateful singletons — no singleton implementations detected
AX4 Dependency direction — not applicable to a transaction-script/CRUD architecture (the inward-dependency rule is for layered/clean styles)
AX6 Interface segregation — no public interfaces
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) — minio_create_buckets Error context canceled compute1 Warning context canceled minio Error context canceled storage_broker Error context canceled safekeeper3 Error context canceled safekeeper1 Error context canceled safekeeper2 Error context canceled pageserver Error context canceled Error response from daemon: Get "https://registry-1.docker.io/v2/": Forbidden; the earlier `compose pull` step reported: compute_is_ready Error Get "https://registry-1.docker.io/v2/": Forbidden minio_create_buckets Error context canceled minio Error context canceled pageserver Error context canceled compute1 Warning context canceled WARNING: Some service image(s) must be built from source by running: docker compose build compute1 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 the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C2 Access Controls — No access-control surface detected in the analyzed source — no web/app surface to authorize (no HTTP API or web-UI project) and no authorization code at all (no [Authorize]/policies, no imperative guard methods). Access control is therefore N/A here — this is a library/CLI, which is authorized by its CALLER, not by itself. If this codebase grows request handlers, the dimension reactivates and a default-deny posture is expected then.
C3 Audit Trail — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C4 Data Retention — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
C5 Data-Subject Rights — No personal data detected in the analyzed source — no PII-typed entity/column names (Email, FirstName, DateOfBirth, …), no ASP.NET Identity / user-account model, and no stored user credentials. GDPR data-protection controls are therefore N/A here. If this is intentional, record the no-PII posture in an ADR; if the app does process personal data, name those fields conventionally so this dimension activates.
D10 Test Quality — ~56962 lines of test source are present (.rs, .py) but no test cases reached the test census for this repository — no test root we could resolve declared them, or the files we read declare no cases in a test framework we recognise — so skipped/assertion-free tests couldn't be counted. Not scored — this is a gap in the analyzer, not a finding about this repository.
D11 Test Reliability — Test reliability not included — the .py suite was found but not re-run
D18 Solution Shape — D18 scores the shape of a .NET solution, but this repository's production source is mostly .c, .java, .py, .rs, .swift — the .NET project files present are an immaterial minority — so the dimension does not apply.
D21 Naming Consistency — Naming consistency is measured on C# only; Java, JavaScript, Python, Rust, Swift not measured.
D22 Internal API Consistency — API consistency is measured on C# only; the exposed Rust surface was not measured.
D23 Boundary Type-Coupling — single shared-core project — no cross-context coupling to assess
D24 Comment Value — D24 reads C# and Visual Basic comments only; comments in this repository's .java, .py, .rs, .swift source were not judged.
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) — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
D37 Vulnerability-disclosure Policy — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
D39 IL Efficiency — IL not measured — the analyzer's build of the target did not succeed
D40 Network Egress Confinement — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
D41 Kernel & Syscall Confinement — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
D42 Runtime Threat Enforcement — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
D8 Code Coverage — Coverage NOT MEASURED: `--collect:"XPlat Code Coverage"` names a data collector that ships in the `coverlet.collector` package, and this repository wires up none — no test project references it and no runsettings declares one. The absence of coverage here is therefore not evidence about the suite or about our analyzer environment: without a collector, `--collect` produces nothing even from a suite that builds and passes. Add a `coverlet.collector` PackageReference to the test project(s) (or commit the Cobertura/OpenCover/lcov report your CI produces) and real coverage will be measured. It is excluded from the score rather than counted as a near-zero defect.
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 this analysis resolves a call's owner only where the receiver's type is written down in the source. Reported as guidance rather than measured
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — Not assessed, and this one is on us: 3 command handler(s) or message consumer(s) were found here, but this check does not yet recognise persistence writes in this repository's language. Idempotency was neither confirmed nor ruled out — this is a limit of the analyzer, not a finding about your code.
IC1 Incompleteness & stubs — reported, not scored — this repository's C# declares no analysable method bodies (a constants, record or DTO assembly), and this score is a density of unfinished work per method, which has no denominator here. The file-level signals below were still collected and are shown in full
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.
P7 Outbound HTTP resilience — not applicable — this isn't a service/API/worker
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
PF1 Benchmark discipline — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
PF2 Allocation hygiene — Performance is assessed only for perf-relevant repos — a packaged library, one that ships benchmarks, or one already using allocation-aware APIs. This repo isn't one, so the Performance lens is not applicable and is excluded from the score.
S1 Web-Security Posture — No web surface detected in the analyzed source — no HTTP API or web-UI project (no controllers/minimal-API endpoints, no Razor/Blazor views) and no web middleware (HTTPS redirection, HSTS, security headers, cookies). Transport security, security headers, secure cookies, CSRF/input-validation and middleware-order controls are therefore N/A here — this is a library/CLI/worker, not a web app. Crypto hygiene was still checked and found nothing to flag. If this codebase becomes web-facing, the dimension reactivates automatically.
X2 Cancellation propagation — no async method does work a token could cancel
X9 Subsumed condition operand — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
Appendix A — Findings (grouped)
The findings behind the scores, grouped by severity, then by dimension and kind. The high-severity issues are enumerated in full below; items per group are capped at 25 with any overflow stated explicitly per group, never silently truncated. The complete machine-readable list of every finding (all severities) is the companion findings.md in this report's bundle.
AX9 · CQS / query purity· Query writes persistent state on the read path · ×2
Query writes persistent state on the read path: spec_apply$module.get_operations compute_tools/src/spec_apply.rs:671— `spec_apply$module.get_operations` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
Query writes persistent state on the read path: Timeline.get_current_logical_size_non_incremental pageserver/src/tenant/timeline.rs:1381— `Timeline.get_current_logical_size_non_incremental` is a read-named query yet it performs a durable write on the read path (a persist to a store/repository). A query must stay side-effect-free so reads are safe to retry, cache, and route to a read replica; move the write into a command.
Boundary-crossing change coupling: compute.rs ↔ requests.rs compute_tools/src/compute.rs:1— `compute_tools/src/compute.rs` (context compute_tools) and `libs/compute_api/src/requests.rs` (context compute_api) 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 `a7142f3b` Configure rsyslog for logs export using the spec (#11338); `db30e166` Add /configure_telemetry API endpoint (#11117); `3532ae76` compute_ctl: Add endpoint that allows extensions to be installed (#9344) — run `git show` on any of them.
FileTooLong: src/service.rs storage_controller/src/service.rs— FileTooLong — 6029 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 93% of them inside a single declaration: Service (2 blocks, 517-10218). The bar is 500 significant lines; this is 5529 over it, 12.06× 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: tenant/timeline.rs pageserver/src/tenant/timeline.rs— FileTooLong — 4289 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 3789 over it, 8.58× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/tenant.rs pageserver/src/tenant.rs— FileTooLong — 3364 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 2864 over it, 6.73× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/metrics.rs pageserver/src/metrics.rs— FileTooLong — 3057 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 2557 over it, 6.11× 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/routes.rs pageserver/src/http/routes.rs— FileTooLong — 2899 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 91 free functions. The bar is 500 significant lines; this is 2399 over it, 5.80× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: timeline/compaction.rs pageserver/src/tenant/timeline/compaction.rs— FileTooLong — 2877 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 61% of them inside a single declaration: Timeline (2 blocks, 1202-4192). The bar is 500 significant lines; this is 2377 over it, 5.75× 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/page_service.rs pageserver/src/page_service.rs— FileTooLong — 2828 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 2328 over it, 5.66× 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/pgdatadir_mapping.rs pageserver/src/pgdatadir_mapping.rs— FileTooLong — 1911 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 1411 over it, 3.82× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/persistence.rs storage_controller/src/persistence.rs— FileTooLong — 1832 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: Persistence (2 blocks, 76-2144). The bar is 500 significant lines; this is 1332 over it, 3.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/compute.rs compute_tools/src/compute.rs— FileTooLong — 1760 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 77% of them inside a single declaration: ComputeNode (2 blocks, 139-2844). The bar is 500 significant lines; this is 1260 over it, 3.52× 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/http.rs storage_controller/src/http.rs— FileTooLong — 1679 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), declaring 84 free functions. The bar is 500 significant lines; this is 1179 over it, 3.36× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: tenant/mgr.rs pageserver/src/tenant/mgr.rs— FileTooLong — 1667 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 60% of them inside a single declaration: TenantManager (2 blocks, 301-2523). The bar is 500 significant lines; this is 1167 over it, 3.33× the bar. Moving the declarations that sit BESIDE it into sibling files will not shorten this file. Extract from INSIDE that declaration instead: lift each cohesive group of its body — the parts that share the same inputs and are named together — into its own unit in a sibling file, and have the original call them.
FileTooLong: tenant/remote_timeline_client.rs pageserver/src/tenant/remote_timeline_client.rs— FileTooLong — 1535 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 88% of them inside a single declaration: RemoteTimelineClient (3 blocks, 349-2627). The bar is 500 significant lines; this is 1035 over it, 3.07× 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: bin/neon_local.rs control_plane/src/bin/neon_local.rs— FileTooLong — 1347 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 847 over it, 2.69× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: storage_layer/layer.rs pageserver/src/tenant/storage_layer/layer.rs— FileTooLong — 1265 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 765 over it, 2.53× 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/models.rs libs/pageserver_api/src/models.rs— FileTooLong — 1254 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 754 over it, 2.51× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/tenant_shard.rs storage_controller/src/tenant_shard.rs— FileTooLong — 1160 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 76% of them inside a single declaration: TenantShard (3 blocks, 59-2071). The bar is 500 significant lines; this is 660 over it, 2.32× 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: service/safekeeper_service.rs storage_controller/src/service/safekeeper_service.rs— FileTooLong — 1123 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 97% of them inside a single declaration: Service (42-1737). The bar is 500 significant lines; this is 623 over it, 2.25× 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/main.rs control_plane/storcon_cli/src/main.rs— FileTooLong — 1042 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 542 over it, 2.08× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: secondary/downloader.rs pageserver/src/tenant/secondary/downloader.rs— FileTooLong — 1013 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 513 over it, 2.03× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: storage_layer/delta_layer.rs pageserver/src/tenant/storage_layer/delta_layer.rs— FileTooLong — 1008 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 508 over it, 2.02× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: src/walingest.rs pageserver/src/walingest.rs— FileTooLong — 997 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 87% of them inside a single declaration: WalIngest (2 blocks, 95-1598). The bar is 500 significant lines; this is 497 over it, 1.99× 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/gcs_bucket.rs libs/remote_storage/src/gcs_bucket.rs— FileTooLong — 965 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), about 90% of them inside a single declaration: GCSBucket (3 blocks, 48-1389). The bar is 500 significant lines; this is 465 over it, 1.93× 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/safekeeper.rs safekeeper/src/safekeeper.rs— FileTooLong — 881 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 381 over it, 1.76× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: serverless/rest.rs proxy/src/serverless/rest.rs— FileTooLong — 876 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 376 over it, 1.75× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
MethodTooLong: Timeline.compact_with_gc_inner pageserver/src/tenant/timeline/compaction.rs:3236— MethodTooLong — compact_with_gc_inner runs 627 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 527 over it, 6.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Timeline.compact_level0_phase1 pageserver/src/tenant/timeline/compaction.rs:1883— MethodTooLong — compact_level0_phase1 runs 317 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 217 over it, 3.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Service.spawn storage_controller/src/service.rs:1671— MethodTooLong — spawn runs 234 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 134 over it, 2.34× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PageServerHandler.pagestream_read_message pageserver/src/page_service.rs:965— MethodTooLong — pagestream_read_message runs 228 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 128 over it, 2.28× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: StorageController.start control_plane/src/storage_controller.rs:348— MethodTooLong — start runs 227 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 127 over it, 2.27× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PageServerConf.parse_and_validate pageserver/src/config.rs:371— MethodTooLong — parse_and_validate runs 215 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 115 over it, 2.15× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RemoteTimelineClient.perform_upload_task pageserver/src/tenant/remote_timeline_client.rs:2100— MethodTooLong — perform_upload_task runs 209 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 109 over it, 2.09× 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: Timeline.generate_key_retention pageserver/src/tenant/timeline/compaction.rs:2637— MethodTooLong — generate_key_retention runs 209 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 109 over it, 2.09× 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: Endpoint.start control_plane/src/endpoint.rs:702— MethodTooLong — start runs 205 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 105 over it, 2.05× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: PageServerNode.parse_config control_plane/src/pageserver.rs:379— MethodTooLong — parse_config 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: MetadataRecord.decode_heapam_record libs/wal_decoder/src/decoder.rs:193— MethodTooLong — decode_heapam_record runs 195 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 95 over it, 1.95× 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: TenantConfig.apply_patch libs/pageserver_api/src/models.rs:789— MethodTooLong — apply_patch runs 191 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 91 over it, 1.91× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BeMessage.write libs/pq_proto/src/lib.rs:763— MethodTooLong — write runs 179 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 79 over it, 1.79× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Service.tenant_timeline_safekeeper_migrate storage_controller/src/service/safekeeper_service.rs:1127— MethodTooLong — tenant_timeline_safekeeper_migrate runs 177 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 77 over it, 1.77× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TenantManager.upsert_location pageserver/src/tenant/mgr.rs:842— MethodTooLong — upsert_location runs 176 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 76 over it, 1.76× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: TimelineCollector.new safekeeper/src/metrics.rs:567— MethodTooLong — new runs 171 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 71 over it, 1.71× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Service.do_tenant_shard_split storage_controller/src/service.rs:6366— MethodTooLong — do_tenant_shard_split runs 170 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 70 over it, 1.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ProposerAcceptorMessage.parse safekeeper/src/safekeeper.rs:487— MethodTooLong — parse runs 168 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 68 over it, 1.68× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: Basebackup.send_tarball pageserver/src/basebackup.rs:335— MethodTooLong — send_tarball runs 162 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 62 over it, 1.62× 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: SafekeeperPostgresHandler.handle_start_replication_guts safekeeper/src/send_wal.rs:477— MethodTooLong — handle_start_replication_guts runs 154 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 54 over it, 1.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: Timeline.compact_legacy pageserver/src/tenant/timeline/compaction.rs:1206— MethodTooLong — compact_legacy runs 149 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 49 over it, 1.49× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ComputeNode.start_compute compute_tools/src/compute.rs:793— MethodTooLong — start_compute 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.
MethodTooLong: Timeline.compact_shard_ancestors pageserver/src/tenant/timeline/compaction.rs:1523— MethodTooLong — compact_shard_ancestors 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.
MethodTooLong: PagestreamBeMessage.deserialize libs/pageserver_api/src/pagestream_api.rs:550— MethodTooLong — deserialize runs 133 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 33 over it, 1.33× 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: TimelineCollector.collect safekeeper/src/metrics.rs:810— MethodTooLong — collect runs 132 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 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: storcon_cli::main control_plane/storcon_cli/src/main.rs:443— FunctionTooLong — storcon_cli::main runs 717 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 617 over it, 7.17× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pageserver::bin::pageserver::start_pageserver pageserver/src/bin/pageserver.rs:337— FunctionTooLong — pageserver::bin::pageserver::start_pageserver runs 346 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 246 over it, 3.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: storage_controller::http::make_router storage_controller/src/http.rs:2185— FunctionTooLong — storage_controller::http::make_router runs 337 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 237 over it, 3.37× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: proxy::serverless::rest::handle_rest_inner proxy/src/serverless/rest.rs:771— FunctionTooLong — proxy::serverless::rest::handle_rest_inner runs 323 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 223 over it, 3.23× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pageserver::tenant::timeline::walreceiver::walreceiver_connection::handle_walreceiver_connection pageserver/src/tenant/timeline/walreceiver/walreceiver_connection.rs:116— FunctionTooLong — pageserver::tenant::timeline::walreceiver::walreceiver_connection::handle_walreceiver_connection runs 292 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 192 over it, 2.92× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: control_plane::bin::neon_local::handle_endpoint control_plane/src/bin/neon_local.rs:1319— FunctionTooLong — control_plane::bin::neon_local::handle_endpoint runs 231 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 131 over it, 2.31× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pageserver_compaction::simulator::draw::draw_history pageserver/compaction/src/simulator/draw.rs:91— FunctionTooLong — pageserver_compaction::simulator::draw::draw_history runs 230 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 130 over it, 2.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: pageserver::http::routes::make_router pageserver/src/http/routes.rs:3992— FunctionTooLong — pageserver::http::routes::make_router 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.
FunctionTooLong: storage_controller::async_main storage_controller/src/main.rs:348— FunctionTooLong — storage_controller::async_main 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.
FunctionTooLong: safekeeper::bin::safekeeper::start_safekeeper safekeeper/src/bin/safekeeper.rs:482— FunctionTooLong — safekeeper::bin::safekeeper::start_safekeeper runs 204 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 104 over it, 2.04× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: compute_tools::config::write_postgres_conf compute_tools/src/config.rs:49— FunctionTooLong — compute_tools::config::write_postgres_conf runs 197 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 97 over it, 1.97× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pagebench::cmd::getpage_latest_lsn::main_impl pageserver/pagebench/src/cmd/getpage_latest_lsn.rs:156— FunctionTooLong — pagebench::cmd::getpage_latest_lsn::main_impl runs 193 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pageserver::tenant::timeline::detach_ancestor::prepare pageserver/src/tenant/timeline/detach_ancestor.rs:284— FunctionTooLong — pageserver::tenant::timeline::detach_ancestor::prepare runs 193 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 93 over it, 1.93× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: proxy::binary::proxy::run proxy/src/binary/proxy.rs:336— FunctionTooLong — proxy::binary::proxy::run 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.
FunctionTooLong: safekeeper::control_file_upgrade::upgrade_control_file safekeeper/src/control_file_upgrade.rs:321— FunctionTooLong — safekeeper::control_file_upgrade::upgrade_control_file runs 170 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 70 over it, 1.70× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pageserver::walredo::apply_neon::apply_in_neon pageserver/src/walredo/apply_neon.rs:31— FunctionTooLong — pageserver::walredo::apply_neon::apply_in_neon 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.
FunctionTooLong: storage_scrubber::garbage::find_garbage_inner storage_scrubber/src/garbage.rs:157— FunctionTooLong — storage_scrubber::garbage::find_garbage_inner 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: pageserver::tenant::size::gather_inputs pageserver/src/tenant/size.rs:158— FunctionTooLong — pageserver::tenant::size::gather_inputs runs 153 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: safekeeper::pull_timeline::handle_request safekeeper/src/pull_timeline.rs:449— FunctionTooLong — safekeeper::pull_timeline::handle_request runs 153 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 53 over it, 1.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: storage_scrubber::scan_pageserver_metadata::scan_pageserver_metadata storage_scrubber/src/scan_pageserver_metadata.rs:138— FunctionTooLong — storage_scrubber::scan_pageserver_metadata::scan_pageserver_metadata runs 148 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 48 over it, 1.48× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pageserver::disk_usage_eviction_task::collect_eviction_candidates pageserver/src/disk_usage_eviction_task.rs:790— FunctionTooLong — pageserver::disk_usage_eviction_task::collect_eviction_candidates runs 147 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 47 over it, 1.47× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: storage_scrubber::main storage_scrubber/src/main.rs:129— FunctionTooLong — storage_scrubber::main 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: pageserver::tenant::timeline::detach_ancestor::detach_and_reparent pageserver/src/tenant/timeline/detach_ancestor.rs:975— FunctionTooLong — pageserver::tenant::timeline::detach_ancestor::detach_and_reparent runs 140 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted) in one body. The bar is 100 significant lines; this is 40 over it, 1.40× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: pageserver::shutdown_pageserver pageserver/src/lib.rs:88— FunctionTooLong — pageserver::shutdown_pageserver runs 132 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 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
FunctionTooLong: safekeeper::bin::safekeeper::main safekeeper/src/bin/safekeeper.rs:286— FunctionTooLong — safekeeper::bin::safekeeper::main runs 132 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 32 over it, 1.32× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Service::spawn_heartbeat_driver (cognitive 66) storage_controller/src/service.rs:1284— Service::spawn_heartbeat_driver has cognitive complexity 66 (threshold 15). Drivers by points: if/else 10 (32 pts), match/switch 5 (19 pts), loops 5 (14 pts), boolean chains 1 (nesting depth added 45). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::fill_node_plan (cognitive 41) storage_controller/src/service.rs:9774— Service::fill_node_plan has cognitive complexity 41 (threshold 15). Drivers by points: if/else 10 (27 pts), match/switch 3 (9 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::handle_node_availability_transition (cognitive 39) storage_controller/src/service.rs:7980— Service::handle_node_availability_transition has cognitive complexity 39 (threshold 15). Drivers by points: if/else 8 (26 pts), loops 3 (7 pts), match/switch 2 (6 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::fill_node (cognitive 39) storage_controller/src/service.rs:9914— Service::fill_node has cognitive complexity 39 (threshold 15). Drivers by points: if/else 9 (26 pts), match/switch 3 (9 pts), loops 3 (4 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.
Service::delete_node (cognitive 36) storage_controller/src/service.rs:7432— Service::delete_node has cognitive complexity 36 (threshold 15). Drivers by points: if/else 9 (19 pts), match/switch 4 (10 pts), loops 4 (7 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.
Service::spawn (cognitive 34) storage_controller/src/service.rs:1671— Service::spawn has cognitive complexity 34 (threshold 15). Drivers by points: if/else 13 (20 pts), loops 7 (8 pts), match/switch 2 (4 pts), boolean chains 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::drain_node (cognitive 32) storage_controller/src/service.rs:9586— Service::drain_node has cognitive complexity 32 (threshold 15). Drivers by points: match/switch 6 (16 pts), if/else 5 (12 pts), loops 3 (4 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.
Service::do_tenant_shard_split (cognitive 31) storage_controller/src/service.rs:6366— Service::do_tenant_shard_split has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (19 pts), loops 8 (10 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.
Service::startup_reconcile (cognitive 30) storage_controller/src/service.rs:783— Service::startup_reconcile has cognitive complexity 30 (threshold 15). Drivers by points: if/else 11 (18 pts), loops 7 (10 pts), match/switch 2 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::tenant_shard_migrate (cognitive 29) storage_controller/src/service.rs:6733— Service::tenant_shard_migrate has cognitive complexity 29 (threshold 15). Drivers by points: if/else 19 (27 pts), loops 1, match/switch 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::tenant_location_config (cognitive 28) storage_controller/src/service.rs:3145— Service::tenant_location_config has cognitive complexity 28 (threshold 15). Drivers by points: if/else 9 (21 pts), loops 2 (4 pts), match/switch 2, 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.
Service::tenant_remote_mutation_inner (cognitive 28) storage_controller/src/service.rs:5075— Service::tenant_remote_mutation_inner has cognitive complexity 28 (threshold 15). Drivers by points: if/else 7 (19 pts), match/switch 2 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::abort_tenant_shard_split (cognitive 28) storage_controller/src/service.rs:5722— Service::abort_tenant_shard_split has cognitive complexity 28 (threshold 15). Drivers by points: if/else 8 (17 pts), loops 4 (7 pts), match/switch 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.
Service::re_attach (cognitive 27) storage_controller/src/service.rs:2377— Service::re_attach has cognitive complexity 27 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::optimize_all_plan (cognitive 26) storage_controller/src/service.rs:8862— Service::optimize_all_plan has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (19 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::reconcile_all (cognitive 25) storage_controller/src/service.rs:8685— Service::reconcile_all has cognitive complexity 25 (threshold 15). Drivers by points: if/else 9 (21 pts), boolean chains 2, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::activate_timeline_post_import (cognitive 24) storage_controller/src/service.rs:4432— Service::activate_timeline_post_import has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (5 pts), match/switch 2 (5 pts) (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::prepare_tenant_shard_split (cognitive 24) storage_controller/src/service.rs:6215— Service::prepare_tenant_shard_split has cognitive complexity 24 (threshold 15). Drivers by points: if/else 12 (18 pts), match/switch 2 (4 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.
Service::optimize_all_validate (cognitive 24) storage_controller/src/service.rs:8959— Service::optimize_all_validate has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (13 pts), match/switch 3 (7 pts), boolean chains 2, loops 2 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::consistency_check (cognitive 21) storage_controller/src/service.rs:7138— Service::consistency_check has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 4 (6 pts), match/switch 1 (3 pts) (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Service::process_result (cognitive 20) storage_controller/src/service.rs:1469— Service::process_result has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (15 pts), match/switch 2 (3 pts), 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.
Service::node_register (cognitive 20) storage_controller/src/service.rs:7704— Service::node_register has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 4, 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.
Service::tenant_timeline_safekeeper_migrate (cognitive 18) storage_controller/src/service/safekeeper_service.rs:1127— Service::tenant_timeline_safekeeper_migrate has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 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.
Service::attach_hook (cognitive 18) storage_controller/src/service.rs:2038— Service::attach_hook has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10, match/switch 4 (8 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.
Service::tenant_timeline_create_safekeepers (cognitive 17) storage_controller/src/service/safekeeper_service.rs:282— Service::tenant_timeline_create_safekeepers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pageserver::tenant::timeline::walreceiver::walreceiver_connection::handle_walreceiver_connection (cognitive 104) pageserver/src/tenant/timeline/walreceiver/walreceiver_connection.rs:116— pageserver::tenant::timeline::walreceiver::walreceiver_connection::handle_walreceiver_connection has cognitive complexity 104 (threshold 15). Drivers by points: if/else 25 (72 pts), match/switch 12 (22 pts), boolean chains 6, loops 2 (4 pts) (nesting depth added 59). 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.
pageserver::tenant::timeline::walreceiver::connection_manager::connection_manager_loop_step (cognitive 59) pageserver/src/tenant/timeline/walreceiver/connection_manager.rs:56— pageserver::tenant::timeline::walreceiver::connection_manager::connection_manager_loop_step has cognitive complexity 59 (threshold 15). Drivers by points: match/switch 12 (32 pts), if/else 7 (19 pts), loops 3 (5 pts), boolean chains 3 (nesting depth added 34). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
pageserver::tenant::storage_layer::inmemory_layer::vectored_dio_read::execute (cognitive 49) pageserver/src/tenant/storage_layer/inmemory_layer/vectored_dio_read.rs:95— pageserver::tenant::storage_layer::inmemory_layer::vectored_dio_read::execute has cognitive complexity 49 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 7 (12 pts), match/switch 4 (10 pts) (nesting depth added 26). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pageserver::tenant::mgr::init_tenant_mgr (cognitive 41) pageserver/src/tenant/mgr.rs:505— pageserver::tenant::mgr::init_tenant_mgr has cognitive complexity 41 (threshold 15). Drivers by points: if/else 12 (23 pts), match/switch 5 (15 pts), loops 2, 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.
pageserver::tenant::timeline::detach_ancestor::prepare (cognitive 40) pageserver/src/tenant/timeline/detach_ancestor.rs:284— pageserver::tenant::timeline::detach_ancestor::prepare has cognitive complexity 40 (threshold 15). Drivers by points: if/else 15 (22 pts), match/switch 7 (12 pts), loops 5 (6 pts) (nesting depth added 13). Of this number, 39 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.
pageserver::disk_usage_eviction_task::collect_eviction_candidates (cognitive 34) pageserver/src/disk_usage_eviction_task.rs:790— pageserver::disk_usage_eviction_task::collect_eviction_candidates has cognitive complexity 34 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 4 (6 pts), match/switch 2 (4 pts) (nesting depth added 17). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pageserver::tenant::size::gather_inputs (cognitive 34) pageserver/src/tenant/size.rs:158— pageserver::tenant::size::gather_inputs has cognitive complexity 34 (threshold 15). Drivers by points: if/else 14 (27 pts), loops 4 (5 pts), boolean chains 2 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pageserver::walredo::apply_neon::apply_in_neon (cognitive 31) pageserver/src/walredo/apply_neon.rs:31— pageserver::walredo::apply_neon::apply_in_neon has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (24 pts), loops 3 (6 pts), match/switch 1 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
pageserver::disk_usage_eviction_task::disk_usage_eviction_task_iteration_impl (cognitive 30) pageserver/src/disk_usage_eviction_task.rs:357— pageserver::disk_usage_eviction_task::disk_usage_eviction_task_iteration_impl has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 5 (10 pts), boolean chains 2, loops 2 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pageserver::tenant::secondary::downloader::init_timeline_state (cognitive 29) pageserver/src/tenant/secondary/downloader.rs:1376— pageserver::tenant::secondary::downloader::init_timeline_state has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 3 (6 pts), boolean chains 1, loops 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pageserver::bin::pageserver::start_pageserver (cognitive 28) pageserver/src/bin/pageserver.rs:337— pageserver::bin::pageserver::start_pageserver has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 10 (14 pts), if/else 12, boolean chains 1, loops 1 (nesting depth added 4). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
pageserver::task_mgr::shutdown_tasks (cognitive 27) pageserver/src/task_mgr.rs:555— pageserver::task_mgr::shutdown_tasks has cognitive complexity 27 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 3 (6 pts), boolean chains 5, match/switch 1 (5 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.
pageserver::import_datadir::import_file (cognitive 25) pageserver/src/import_datadir.rs:504— pageserver::import_datadir::import_file has cognitive complexity 25 (threshold 15). Drivers by points: if/else 14 (17 pts), match/switch 4 (7 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
pageserver::tenant::timeline::detach_ancestor::detach_and_reparent (cognitive 24) pageserver/src/tenant/timeline/detach_ancestor.rs:975— pageserver::tenant::timeline::detach_ancestor::detach_and_reparent has cognitive complexity 24 (threshold 15). Drivers by points: if/else 7 (11 pts), match/switch 6 (9 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pageserver::tenant::checks::check_valid_layermap (cognitive 23) pageserver/src/tenant/checks.rs:34— pageserver::tenant::checks::check_valid_layermap has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pageserver::tenant::tasks::gc_loop (cognitive 22) pageserver/src/tenant/tasks.rs:343— pageserver::tenant::tasks::gc_loop has cognitive complexity 22 (threshold 15). Drivers by points: if/else 8 (17 pts), match/switch 1 (3 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.
pageserver::page_service::parse_options (cognitive 21) pageserver/src/page_service.rs:3044— pageserver::page_service::parse_options has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (19 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.
pageserver::tenant::size::fill_logical_sizes (cognitive 21) pageserver/src/tenant/size.rs:454— pageserver::tenant::size::fill_logical_sizes has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (16 pts), loops 3, 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.
pageserver::consumption_metrics::calculate_synthetic_size_worker (cognitive 19) pageserver/src/consumption_metrics.rs:367— pageserver::consumption_metrics::calculate_synthetic_size_worker has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 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.
pageserver::http::routes::post_top_tenants (cognitive 19) pageserver/src/http/routes.rs:3375— pageserver::http::routes::post_top_tenants has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (10 pts), match/switch 3 (5 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 9). Of this number, 18 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.
pageserver::tenant::timeline::detach_ancestor::check_no_archived_children_of_ancestor (cognitive 18) pageserver/src/tenant/timeline/detach_ancestor.rs:1284— pageserver::tenant::timeline::detach_ancestor::check_no_archived_children_of_ancestor has cognitive complexity 18 (threshold 15). Drivers by points: if/else 4 (13 pts), loops 2 (4 pts), match/switch 1 (nesting depth added 11). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
pageserver::consumption_metrics::collect_metrics (cognitive 17) pageserver/src/consumption_metrics.rs:155— pageserver::consumption_metrics::collect_metrics has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (11 pts), match/switch 3 (5 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.
pageserver::tenant::tasks::compaction_loop (cognitive 17) pageserver/src/tenant/tasks.rs:216— pageserver::tenant::tasks::compaction_loop has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 4 (10 pts), if/else 4 (6 pts), loops 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
D30 · Dependency Vulnerabilities· Medium CVE · ×23
ClassTooLong: Service storage_controller/src/service.rs:517— ClassTooLong — 5632 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 154 methods, 2 blocks, lines 517-10218. The bar is 400 significant lines; this is 5232 over it, 14.08× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PageServerHandler pageserver/src/page_service.rs:412— ClassTooLong — 1384 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 21 methods, 3 blocks, lines 412-3295. The bar is 400 significant lines; this is 984 over it, 3.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: ComputeNode compute_tools/src/compute.rs:139— ClassTooLong — 1359 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 67 methods, 2 blocks, lines 139-2844. The bar is 400 significant lines; this is 959 over it, 3.40× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RemoteTimelineClient pageserver/src/tenant/remote_timeline_client.rs:349— ClassTooLong — 1346 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 62 methods, 3 blocks, lines 349-2627. The bar is 400 significant lines; this is 946 over it, 3.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.
ClassTooLong: Persistence storage_controller/src/persistence.rs:76— ClassTooLong — 1305 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 57 methods, 2 blocks, lines 76-2144. The bar is 400 significant lines; this is 905 over it, 3.26× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TenantManager pageserver/src/tenant/mgr.rs:301— ClassTooLong — 1001 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 2 blocks, lines 301-2523. The bar is 400 significant lines; this is 601 over it, 2.50× 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: TenantShard storage_controller/src/tenant_shard.rs:59— ClassTooLong — 881 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 59-2071. The bar is 400 significant lines; this is 481 over it, 2.20× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GCSBucket libs/remote_storage/src/gcs_bucket.rs:48— ClassTooLong — 873 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 14 methods, 3 blocks, lines 48-1389. The bar is 400 significant lines; this is 473 over it, 2.18× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: WalIngest pageserver/src/walingest.rs:95— ClassTooLong — 868 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 26 methods, 2 blocks, lines 95-1598. The bar is 400 significant lines; this is 468 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: DatadirModification pageserver/src/pgdatadir_mapping.rs:1676— ClassTooLong — 813 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 48 methods, 2 blocks, lines 1676-3074. The bar is 400 significant lines; this is 413 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: S3Bucket libs/remote_storage/src/s3_bucket.rs:52— ClassTooLong — 687 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 3 blocks, lines 52-1133. The bar is 400 significant lines; this is 287 over it, 1.72× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: AzureBlobStorage libs/remote_storage/src/azure_blob.rs:51— ClassTooLong — 672 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 3 blocks, lines 51-1096. The bar is 400 significant lines; this is 272 over it, 1.68× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Client pageserver/client/src/mgmt_api.rs:21— 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), 53 methods, 2 blocks, lines 21-936. 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: StorageController control_plane/src/storage_controller.rs:37— ClassTooLong — 627 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 30 methods, 2 blocks, lines 37-1045. The bar is 400 significant lines; this is 227 over it, 1.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Reconciler storage_controller/src/reconciler.rs:33— ClassTooLong — 572 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, 2 blocks, lines 33-1230. The bar is 400 significant lines; this is 172 over it, 1.43× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: Endpoint control_plane/src/endpoint.rs:312— ClassTooLong — 551 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 312-1218. The bar is 400 significant lines; this is 151 over it, 1.38× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GrpcPageServiceHandler pageserver/src/page_service.rs:3300— ClassTooLong — 482 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 7 methods, 3 blocks, lines 3300-4109. The bar is 400 significant lines; this is 82 over it, 1.21× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: PageServerNode control_plane/src/pageserver.rs:42— ClassTooLong — 466 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 18 methods, 2 blocks, lines 42-668. The bar is 400 significant lines; this is 66 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.
ClassTooLong: DeltaLayerInner pageserver/src/tenant/storage_layer/delta_layer.rs:234— ClassTooLong — 465 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 234-1533. The bar is 400 significant lines; this is 65 over it, 1.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: TenantDownloader pageserver/src/tenant/secondary/downloader.rs:631— ClassTooLong — 460 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 9 methods, 2 blocks, lines 631-1373. The bar is 400 significant lines; this is 60 over it, 1.15× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LayerMap pageserver/src/tenant/layer_map.rs:71— ClassTooLong — 417 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, 3 blocks, lines 71-1200. The bar is 400 significant lines; this is 17 over it, 1.04× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: LocalEnv control_plane/src/local_env.rs:41— ClassTooLong — 407 significant lines (blank, comment-only and punctuation-only lines excluded, and inline test code — #[cfg(test)] modules and bare #[test] functions — not counted), 34 methods, 2 blocks, lines 41-1013. The bar is 400 significant lines; this is 7 over it, 1.02× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
Duplicated block (8 lines × 2) compute_tools/src/monitor.rs:278— compute_tools/src/monitor.rs:278-285 | compute_tools/src/monitor.rs:301-308 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) compute_tools/src/pg_isready.rs:11— compute_tools/src/pg_isready.rs:11-18 | compute_tools/src/swap.rs:20-27 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) control_plane/src/background_process.rs:124— control_plane/src/background_process.rs:124-131 | control_plane/src/endpoint.rs:921-928 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) libs/remote_storage/src/gcs_bucket.rs:665— libs/remote_storage/src/gcs_bucket.rs:665-672 | libs/remote_storage/src/gcs_bucket.rs:747-754 — both copies are in the same file, so extract the block into 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) pageserver/pagebench/src/cmd/getpage_latest_lsn.rs:177— pageserver/pagebench/src/cmd/getpage_latest_lsn.rs:177-184 | pageserver/pagebench/src/cmd/ondemand_download_churn.rs:94-101 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) pageserver/src/page_service.rs:2882— pageserver/src/page_service.rs:2882-2889 | pageserver/src/page_service.rs:2921-2928 — both copies are in the same file, so extract the block into 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) pageserver/src/pgdatadir_mapping.rs:2632— pageserver/src/pgdatadir_mapping.rs:2632-2639 | pageserver/src/pgdatadir_mapping.rs:2682-2689 — both copies are in the same file, so extract the block into 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) pageserver/src/tenant/storage_layer/delta_layer.rs:338— pageserver/src/tenant/storage_layer/delta_layer.rs:338-345 | pageserver/src/tenant/storage_layer/image_layer.rs:297-304 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) pageserver/src/tenant/storage_layer/layer_name.rs:40— pageserver/src/tenant/storage_layer/layer_name.rs:40-47 | pageserver/src/tenant/storage_layer/layer_name.rs:148-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 (8 lines × 2) pageserver/src/tenant/timeline.rs:1481— pageserver/src/tenant/timeline.rs:1481-1488 | pageserver/src/tenant/timeline.rs:1654-1661 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) proxy/src/auth/flow.rs:80— proxy/src/auth/flow.rs:80-87 | proxy/src/auth/flow.rs:103-110 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) proxy/src/binary/local_proxy.rs:120— proxy/src/binary/local_proxy.rs:120-127 | proxy/src/binary/proxy.rs:344-351 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) safekeeper/src/pull_timeline.rs:273— safekeeper/src/pull_timeline.rs:273-280 | safekeeper/src/pull_timeline.rs:340-347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) safekeeper/src/receive_wal.rs:77— safekeeper/src/receive_wal.rs:77-84 | safekeeper/src/send_wal.rs:76-83 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (8 lines × 2) storage_broker/src/bin/storage_broker.rs:527— storage_broker/src/bin/storage_broker.rs:527-534 | storage_broker/src/bin/storage_broker.rs:586-593 — both copies are in the same file, so extract the block into 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) storage_controller/src/main.rs:411— storage_controller/src/main.rs:411-418 | storage_scrubber/src/main.rs:153-160 — 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) storage_controller/src/persistence.rs:1833— storage_controller/src/persistence.rs:1833-1840 | storage_controller/src/persistence.rs:1926-1933 — both copies are in the same file, so extract the block into 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) libs/proxy/tokio-postgres2/src/error/mod.rs:145— libs/proxy/tokio-postgres2/src/error/mod.rs:145-152 | libs/proxy/tokio-postgres2/src/error/mod.rs:161-168 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) safekeeper/src/broker.rs:259— safekeeper/src/broker.rs:259-266 | safekeeper/src/broker.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) compute_tools/src/bin/fast_import.rs:378— compute_tools/src/bin/fast_import.rs:378-385 | compute_tools/src/bin/fast_import.rs:419-426 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Timeline::compact_with_gc_inner (cognitive 154) pageserver/src/tenant/timeline/compaction.rs:3236— Timeline::compact_with_gc_inner has cognitive complexity 154 (threshold 15). Drivers by points: if/else 69 (121 pts), loops 18, boolean chains 8, match/switch 4 (7 pts) (nesting depth added 55). Of this number, 153 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.
Timeline::compact_level0_phase1 (cognitive 122) pageserver/src/tenant/timeline/compaction.rs:1883— Timeline::compact_level0_phase1 has cognitive complexity 122 (threshold 15). Drivers by points: if/else 41 (100 pts), loops 8 (11 pts), boolean chains 10, match/switch 1 (nesting depth added 62). 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.
Timeline::generate_key_retention (cognitive 107) pageserver/src/tenant/timeline/compaction.rs:2637— Timeline::generate_key_retention has cognitive complexity 107 (threshold 15). Drivers by points: if/else 38 (74 pts), loops 15 (29 pts), boolean chains 4 (nesting depth added 50). Of this number, 93 points are the body's own statements and 14 belong to 2 function items inside it that branch. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Timeline::flush_loop (cognitive 64) pageserver/src/tenant/timeline.rs:4928— Timeline::flush_loop has cognitive complexity 64 (threshold 15). Drivers by points: if/else 13 (44 pts), match/switch 5 (16 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 43). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Timeline::create_image_layers (cognitive 64) pageserver/src/tenant/timeline.rs:5856— Timeline::create_image_layers has cognitive complexity 64 (threshold 15). Drivers by points: if/else 26 (53 pts), loops 3 (6 pts), boolean chains 3, match/switch 1 (2 pts) (nesting depth added 31). 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.
Timeline::compact_shard_ancestors (cognitive 45) pageserver/src/tenant/timeline/compaction.rs:1523— Timeline::compact_shard_ancestors has cognitive complexity 45 (threshold 15). Drivers by points: if/else 16 (29 pts), loops 4 (7 pts), match/switch 2 (5 pts), boolean chains 4 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Timeline::gc_compaction_split_jobs (cognitive 35) pageserver/src/tenant/timeline/compaction.rs:3050— Timeline::gc_compaction_split_jobs has cognitive complexity 35 (threshold 15). Drivers by points: if/else 16 (28 pts), loops 3 (4 pts), boolean chains 3 (nesting depth added 13). Of this number, 33 points are the body's own statements and 2 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Timeline::create_image_layer_for_rel_blocks (cognitive 35) pageserver/src/tenant/timeline.rs:5583— Timeline::create_image_layer_for_rel_blocks has cognitive complexity 35 (threshold 15). Drivers by points: if/else 8 (20 pts), loops 3 (7 pts), match/switch 1 (5 pts), boolean chains 3 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Timeline::get_rel_page_at_lsn_batched (cognitive 27) pageserver/src/pgdatadir_mapping.rs:313— Timeline::get_rel_page_at_lsn_batched has cognitive complexity 27 (threshold 15). Drivers by points: match/switch 5 (15 pts), loops 4 (8 pts), if/else 2 (4 pts) (nesting depth added 16). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Timeline::compact_legacy (cognitive 27) pageserver/src/tenant/timeline/compaction.rs:1206— Timeline::compact_legacy has cognitive complexity 27 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 5, match/switch 3 (4 pts) (nesting depth added 4). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Timeline::collect_keyspace (cognitive 26) pageserver/src/pgdatadir_mapping.rs:1458— Timeline::collect_keyspace has cognitive complexity 26 (threshold 15). Drivers by points: loops 9 (17 pts), if/else 4 (8 pts), boolean chains 1 (nesting depth added 12). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, 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.
Timeline::wait_lsn (cognitive 26) pageserver/src/tenant/timeline.rs:1782— Timeline::wait_lsn has cognitive complexity 26 (threshold 15). Drivers by points: if/else 11 (16 pts), match/switch 5 (9 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Timeline::gc_timeline (cognitive 24) pageserver/src/tenant/timeline.rs:6872— Timeline::gc_timeline has cognitive complexity 24 (threshold 15). Drivers by points: if/else 13 (23 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.
Timeline::shutdown (cognitive 21) pageserver/src/tenant/timeline.rs:2352— Timeline::shutdown has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (17 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.
Timeline::reconstruct_value (cognitive 21) pageserver/src/tenant/timeline.rs:7090— Timeline::reconstruct_value has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Timeline::get_vectored_impl (cognitive 19) pageserver/src/tenant/timeline.rs:1438— Timeline::get_vectored_impl has cognitive complexity 19 (threshold 15). Drivers by points: if/else 9 (11 pts), loops 3 (5 pts), match/switch 1 (2 pts), boolean chains 1 (nesting depth added 5). To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Timeline::maybe_freeze_ephemeral_layer (cognitive 18) pageserver/src/tenant/timeline.rs:2064— Timeline::maybe_freeze_ephemeral_layer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (16 pts), match/switch 1 (2 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Timeline::time_for_new_image_layer (cognitive 17) pageserver/src/tenant/timeline.rs:5507— Timeline::time_for_new_image_layer has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (13 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Timeline::download_all_remote_layers (cognitive 17) pageserver/src/tenant/timeline.rs:7250— Timeline::download_all_remote_layers has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (6 pts), loops 3 (5 pts), boolean chains 3, match/switch 1 (3 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (7 lines × 2) libs/http-utils/src/endpoint.rs:276— libs/http-utils/src/endpoint.rs:276-282 | safekeeper/src/http/routes.rs:654-660 — 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) libs/pageserver_api/src/pagestream_api.rs:452— libs/pageserver_api/src/pagestream_api.rs:452-458 | libs/pageserver_api/src/pagestream_api.rs:529-535 — both copies are in the same file, so extract the block into 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) libs/remote_storage/src/gcs_bucket.rs:639— libs/remote_storage/src/gcs_bucket.rs:639-645 | libs/remote_storage/src/gcs_bucket.rs:809-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 (7 lines × 2) libs/remote_storage/src/gcs_bucket.rs:803— libs/remote_storage/src/gcs_bucket.rs:803-809 | libs/remote_storage/src/s3_bucket.rs:265-271 — before extracting anything, compare `libs/remote_storage/src/gcs_bucket.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) pageserver/client/src/mgmt_api.rs:58— pageserver/client/src/mgmt_api.rs:58-64 | safekeeper/client/src/mgmt_api.rs:56-62 — 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) pageserver/client/src/mgmt_api.rs:56— pageserver/client/src/mgmt_api.rs:56-62 | storage_controller/src/peer_client.rs:45-51 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) pageserver/src/pgdatadir_mapping.rs:2203— pageserver/src/pgdatadir_mapping.rs:2203-2209 | pageserver/src/pgdatadir_mapping.rs:2730-2736 — both copies are in the same file, so extract the block into 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) pageserver/src/pgdatadir_mapping.rs:2714— pageserver/src/pgdatadir_mapping.rs:2714-2720 | pageserver/src/pgdatadir_mapping.rs:2727-2733 — both copies are in the same file, so extract the block into 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) pageserver/src/pgdatadir_mapping.rs:3016— pageserver/src/pgdatadir_mapping.rs:3016-3022 | pageserver/src/pgdatadir_mapping.rs:3120-3126 — both copies are in the same file, so extract the block into 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) pageserver/src/tenant/remote_timeline_client.rs:850— pageserver/src/tenant/remote_timeline_client.rs:850-856 | pageserver/src/tenant/remote_timeline_client.rs:881-888 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) safekeeper/src/http/mod.rs:15— safekeeper/src/http/mod.rs:15-21 | safekeeper/src/http/mod.rs:35-41 — both copies are in the same file, so extract the block into 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) storage_scrubber/src/checks.rs:414— storage_scrubber/src/checks.rs:414-420 | storage_scrubber/src/scan_safekeeper_metadata.rs:176-182 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) storage_scrubber/src/scan_pageserver_metadata.rs:165— storage_scrubber/src/scan_pageserver_metadata.rs:165-171 | storage_scrubber/src/tenant_snapshot.rs:244-251 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) pageserver/src/tenant/storage_layer/delta_layer.rs:119— pageserver/src/tenant/storage_layer/delta_layer.rs:119-125 | pageserver/src/tenant/storage_layer/image_layer.rs:118-124 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) pageserver/src/tenant/ephemeral_file.rs:200— pageserver/src/tenant/ephemeral_file.rs:200-206 | pageserver/src/virtual_file/owned_buffers_io/write.rs:256-262 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (7 lines × 2) storage_controller/src/service.rs:7185— storage_controller/src/service.rs:7185-7191 | storage_controller/src/service.rs:7220-7226 — both copies are in the same file, so extract the block into 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) libs/utils/src/shard.rs:373— libs/utils/src/shard.rs:373-379 | libs/utils/src/shard.rs:444-450 — both copies are in the same file, so extract the block into 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) compute_tools/src/bin/fast_import/child_stdio_to_log.rs:16— compute_tools/src/bin/fast_import/child_stdio_to_log.rs:16-22 | compute_tools/src/bin/fast_import/child_stdio_to_log.rs:26-32 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
D30 · Dependency Vulnerabilities· Medium vulnerability · ×15
TooManyFields: PageServerConf pageserver/src/config.rs:53— TooManyFields — 71 stored fields beside 17 methods. The bar is 30 stored fields; this is 41 over it, 2.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: Timeline pageserver/src/tenant/timeline.rs:206— TooManyFields — 68 stored fields beside 215 methods. The bar is 30 stored fields; this is 38 over it, 2.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: ConfigToml libs/pageserver_api/src/config.rs:184— TooManyFields — 68 stored fields. The bar is 30 stored fields; this is 38 over it, 2.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: ProxyCliArgs proxy/src/binary/proxy.rs:82— TooManyFields — 51 stored fields. 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: Args safekeeper/src/bin/safekeeper.rs:89— TooManyFields — 49 stored fields. The bar is 30 stored fields; this is 19 over it, 1.63× 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: Cli storage_controller/src/main.rs:62— TooManyFields — 41 stored fields. 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: TenantConfig libs/pageserver_api/src/models.rs:657— TooManyFields — 39 stored fields beside 2 methods. The bar is 30 stored fields; this is 9 over it, 1.30× 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: TenantConfigToml libs/pageserver_api/src/config.rs:515— TooManyFields — 39 stored fields. The bar is 30 stored fields; this is 9 over it, 1.30× 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: TenantConfigPatch libs/pageserver_api/src/models.rs:568— TooManyFields — 39 stored fields. The bar is 30 stored fields; this is 9 over it, 1.30× 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: StorageControllerMetricGroup storage_controller/src/metrics.rs:37— TooManyFields — 35 stored fields. The bar is 30 stored fields; this is 5 over it, 1.17× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: TenantShard pageserver/src/tenant.rs:261— TooManyFields — 33 stored fields beside 112 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.
TooManyFields: TimelineMetrics pageserver/src/metrics.rs:3231— TooManyFields — 32 stored fields beside 12 methods. The bar is 30 stored fields; this is 2 over it, 1.07× 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: TimelineInfo libs/pageserver_api/src/models.rs:1546— TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
TooManyFields: Config storage_controller/src/service.rs:370— TooManyFields — 31 stored fields. The bar is 30 stored fields; this is 1 over it, 1.03× the bar. This is width in DATA, not behaviour: every reader that takes the whole type couples to all of its fields, so a change to any one of them is a change every reader has to be checked against. To reduce it, group the fields that are read together by the same callers into a smaller type of their own, and have this one hold that type as a single member — each reader then names only the group it uses.
Duplicated block (10 lines × 2) control_plane/src/bin/neon_local.rs:1547— control_plane/src/bin/neon_local.rs:1547-1556 | control_plane/src/bin/neon_local.rs:1577-1587 — both copies are in the same file, so extract the block into 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) pageserver/src/disk_usage_eviction_task.rs:848— pageserver/src/disk_usage_eviction_task.rs:848-857 | pageserver/src/disk_usage_eviction_task.rs:866-875 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) pageserver/src/tenant/storage_layer/delta_layer.rs:780— pageserver/src/tenant/storage_layer/delta_layer.rs:780-789 | pageserver/src/tenant/storage_layer/image_layer.rs:366-375 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) pageserver/src/tenant/storage_layer/delta_layer.rs:792— pageserver/src/tenant/storage_layer/delta_layer.rs:792-801 | pageserver/src/tenant/storage_layer/image_layer.rs:378-387 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) storage_controller/src/heartbeater.rs:242— storage_controller/src/heartbeater.rs:242-251 | storage_controller/src/heartbeater.rs:385-394 — both copies are in the same file, so extract the block into 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) storage_controller/src/http.rs:339— storage_controller/src/http.rs:339-348 | storage_controller/src/http.rs:424-433 — both copies are in the same file, so extract the block into 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) storage_controller/src/http.rs:357— storage_controller/src/http.rs:357-366 | storage_controller/src/http.rs:452-461 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) storage_controller/src/http.rs:1105— storage_controller/src/http.rs:1105-1114 | storage_controller/src/http.rs:1269-1278 — both copies are in the same file, so extract the block into 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) storage_controller/src/http.rs:1589— storage_controller/src/http.rs:1589-1598 | storage_controller/src/http.rs:1604-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 (10 lines × 2) storage_controller/src/http.rs:1686— storage_controller/src/http.rs:1686-1695 | storage_controller/src/http.rs:1756-1765 — both copies are in the same file, so extract the block into 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) storage_controller/src/persistence.rs:1378— storage_controller/src/persistence.rs:1378-1387 | storage_controller/src/persistence.rs:1410-1419 — both copies are in the same file, so extract the block into 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) pageserver/src/virtual_file/owned_buffers_io/write.rs:195— pageserver/src/virtual_file/owned_buffers_io/write.rs:195-204 | pageserver/src/virtual_file/owned_buffers_io/write.rs:214-224 — both copies are in the same file, so extract the block into 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) pageserver/src/http/routes.rs:1042— pageserver/src/http/routes.rs:1042-1051 | pageserver/src/http/routes.rs:1117-1126 — both copies are in the same file, so extract the block into 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) proxy/src/config.rs:124— proxy/src/config.rs:124-133 | proxy/src/config.rs:262-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.
pageserver::tenant::timeline::walreceiver::walreceiver_connection::handle_walreceiver_connection (cyclomatic 47) pageserver/src/tenant/timeline/walreceiver/walreceiver_connection.rs:116— pageserver::tenant::timeline::walreceiver::walreceiver_connection::handle_walreceiver_connection has cyclomatic complexity 47 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pageserver::tenant::timeline::walreceiver::connection_manager::connection_manager_loop_step (cyclomatic 34) pageserver/src/tenant/timeline/walreceiver/connection_manager.rs:56— pageserver::tenant::timeline::walreceiver::connection_manager::connection_manager_loop_step 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.
pageserver::tenant::timeline::detach_ancestor::prepare (cyclomatic 31) pageserver/src/tenant/timeline/detach_ancestor.rs:284— pageserver::tenant::timeline::detach_ancestor::prepare 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.
pageserver::tenant::storage_layer::inmemory_layer::vectored_dio_read::execute (cyclomatic 25) pageserver/src/tenant/storage_layer/inmemory_layer/vectored_dio_read.rs:95— pageserver::tenant::storage_layer::inmemory_layer::vectored_dio_read::execute 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.
pageserver::bin::pageserver::start_pageserver (cyclomatic 23) pageserver/src/bin/pageserver.rs:337— pageserver::bin::pageserver::start_pageserver 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.
pageserver::import_datadir::import_file (cyclomatic 23) pageserver/src/import_datadir.rs:504— pageserver::import_datadir::import_file has cyclomatic complexity 23 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
pageserver::walredo::apply_neon::apply_in_neon (cyclomatic 22) pageserver/src/walredo/apply_neon.rs:31— pageserver::walredo::apply_neon::apply_in_neon 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.
pageserver::disk_usage_eviction_task::disk_usage_eviction_task_iteration_impl (cyclomatic 21) pageserver/src/disk_usage_eviction_task.rs:357— pageserver::disk_usage_eviction_task::disk_usage_eviction_task_iteration_impl has cyclomatic complexity 21 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pageserver::tenant::timeline::detach_ancestor::detach_and_reparent (cyclomatic 20) pageserver/src/tenant/timeline/detach_ancestor.rs:975— pageserver::tenant::timeline::detach_ancestor::detach_and_reparent 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.
pageserver::tenant::size::gather_inputs (cyclomatic 19) pageserver/src/tenant/size.rs:158— pageserver::tenant::size::gather_inputs 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.
pageserver::disk_usage_eviction_task::collect_eviction_candidates (cyclomatic 17) pageserver/src/disk_usage_eviction_task.rs:790— pageserver::disk_usage_eviction_task::collect_eviction_candidates 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.
pageserver::tenant::mgr::init_tenant_mgr (cyclomatic 17) pageserver/src/tenant/mgr.rs:505— pageserver::tenant::mgr::init_tenant_mgr 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.
Service::spawn_heartbeat_driver (cyclomatic 24) storage_controller/src/service.rs:1284— Service::spawn_heartbeat_driver 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.
Service::spawn (cyclomatic 23) storage_controller/src/service.rs:1671— Service::spawn 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.
Service::do_tenant_shard_split (cyclomatic 20) storage_controller/src/service.rs:6366— Service::do_tenant_shard_split 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.
Service::startup_reconcile (cyclomatic 19) storage_controller/src/service.rs:783— Service::startup_reconcile 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.
Service::drain_node (cyclomatic 19) storage_controller/src/service.rs:9586— Service::drain_node 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.
Service::fill_node_plan (cyclomatic 19) storage_controller/src/service.rs:9774— Service::fill_node_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.
Service::tenant_shard_migrate (cyclomatic 18) storage_controller/src/service.rs:6733— Service::tenant_shard_migrate 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.
Service::delete_node (cyclomatic 17) storage_controller/src/service.rs:7432— Service::delete_node 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.
Service::handle_node_availability_transition (cyclomatic 17) storage_controller/src/service.rs:7980— Service::handle_node_availability_transition 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.
Service::abort_tenant_shard_split (cyclomatic 16) storage_controller/src/service.rs:5722— Service::abort_tenant_shard_split 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.
Service::prepare_tenant_shard_split (cyclomatic 16) storage_controller/src/service.rs:6215— Service::prepare_tenant_shard_split 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.
Service::node_register (cyclomatic 16) storage_controller/src/service.rs:7704— Service::node_register 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.
TooManyMethods: Timeline pageserver/src/tenant/timeline.rs:206— TooManyMethods — 215 methods, declared across 6 files: tenant/timeline.rs (148), src/pgdatadir_mapping.rs (40), timeline/compaction.rs (15), timeline/eviction_task.rs (9), +2 more file(s). The bar is 30 methods; this is 185 over it, 7.17× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Service storage_controller/src/service.rs:517— TooManyMethods — 154 methods, declared across 2 files: src/service.rs (128), service/safekeeper_service.rs (26). The bar is 30 methods; this is 124 over it, 5.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: TenantShard pageserver/src/tenant.rs:261— TooManyMethods — 112 methods. The bar is 30 methods; this is 82 over it, 3.73× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ComputeNode compute_tools/src/compute.rs:139— TooManyMethods — 67 methods, declared across 4 files: src/compute.rs (52), src/compute_prewarm.rs (10), src/spec_apply.rs (3), src/compute_promote.rs (2). The bar is 30 methods; this is 37 over it, 2.23× the bar. That list is where to read them, not a suggestion to split the file: the members belong to the type wherever they are declared, so moving them between files leaves the count unchanged. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RemoteTimelineClient pageserver/src/tenant/remote_timeline_client.rs:349— 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: Persistence storage_controller/src/persistence.rs:76— TooManyMethods — 57 methods. The bar is 30 methods; this is 27 over it, 1.90× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Client pageserver/client/src/mgmt_api.rs:21— TooManyMethods — 53 methods. The bar is 30 methods; this is 23 over it, 1.77× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: DatadirModification pageserver/src/pgdatadir_mapping.rs:1676— TooManyMethods — 48 methods. The bar is 30 methods; this is 18 over it, 1.60× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TenantShard storage_controller/src/tenant_shard.rs:59— 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: LocalEnv control_plane/src/local_env.rs:41— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Key libs/pageserver_api/src/key.rs:19— TooManyMethods — 34 methods. The bar is 30 methods; this is 4 over it, 1.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: Timeline safekeeper/src/timeline.rs:445— TooManyMethods — 33 methods. The bar is 30 methods; this is 3 over it, 1.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D30 · Dependency Vulnerabilities· Medium advisory (unsound) · ×12
Duplicated block (12 lines × 2) libs/remote_storage/src/azure_blob.rs:1051— libs/remote_storage/src/azure_blob.rs:1051-1062 | libs/remote_storage/src/s3_bucket.rs:1084-1095 — before extracting anything, compare `libs/remote_storage/src/azure_blob.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) libs/remote_storage/src/gcs_bucket.rs:254— libs/remote_storage/src/gcs_bucket.rs:254-266 | libs/remote_storage/src/s3_bucket.rs:449-460 — before extracting anything, compare `libs/remote_storage/src/gcs_bucket.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) libs/remote_storage/src/gcs_bucket.rs:371— libs/remote_storage/src/gcs_bucket.rs:371-382 | libs/remote_storage/src/gcs_bucket.rs:487-498 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) pageserver/src/aux_file.rs:97— pageserver/src/aux_file.rs:97-108 | pageserver/src/aux_file.rs:125-136 — both copies are in the same file, so extract the block into 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) pageserver/src/page_service.rs:3187— pageserver/src/page_service.rs:3187-3198 | pageserver/src/page_service.rs:3224-3235 — both copies are in the same file, so extract the block into 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) pageserver/src/pgdatadir_mapping.rs:2049— pageserver/src/pgdatadir_mapping.rs:2049-2060 | pageserver/src/pgdatadir_mapping.rs:2070-2081 — both copies are in the same file, so extract the block into 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) proxy/src/console_redirect_proxy.rs:190— proxy/src/console_redirect_proxy.rs:190-201 | proxy/src/pglb/mod.rs:277-288 — before extracting anything, compare `proxy/src/console_redirect_proxy.rs` and `proxy/src/pglb/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 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) proxy/src/serverless/conn_pool.rs:82— proxy/src/serverless/conn_pool.rs:82-93 | proxy/src/serverless/local_conn_pool.rs:183-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 (12 lines × 2) storage_controller/src/heartbeater.rs:267— storage_controller/src/heartbeater.rs:267-278 | storage_controller/src/heartbeater.rs:405-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) storage_controller/src/scheduler.rs:425— storage_controller/src/scheduler.rs:425-436 | storage_controller/src/scheduler.rs:453-464 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) libs/pq_proto/src/lib.rs:129— libs/pq_proto/src/lib.rs:129-140 | proxy/src/pqproto.rs:411-422 — 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) control_plane/storcon_cli/src/main.rs:448— control_plane/storcon_cli/src/main.rs:448-458 | storage_scrubber/src/main.rs:156-166 — 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) libs/pageserver_api/src/keyspace.rs:585— libs/pageserver_api/src/keyspace.rs:585-595 | pageserver/compaction/src/helpers.rs:57-67 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (11 lines × 2) pageserver/ctl/src/main.rs:241— pageserver/ctl/src/main.rs:241-251 | pageserver/ctl/src/main.rs:253-263 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11 lines × 2) pageserver/src/context.rs:542— pageserver/src/context.rs:542-552 | pageserver/src/context.rs:579-589 — both copies are in the same file, so extract the block into 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) pageserver/src/http/routes.rs:1930— pageserver/src/http/routes.rs:1930-1940 | pageserver/src/http/routes.rs:1978-1988 — both copies are in the same file, so extract the block into 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) proxy/src/config.rs:124— proxy/src/config.rs:124-134 | proxy/src/config.rs:196-206 — both copies are in the same file, so extract the block into 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) proxy/src/config.rs:195— proxy/src/config.rs:195-205 | proxy/src/config.rs:323-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 (11 lines × 2) storage_controller/src/http.rs:425— storage_controller/src/http.rs:425-435 | storage_controller/src/http.rs:587-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 (11 lines × 2) storage_controller/src/http.rs:1318— storage_controller/src/http.rs:1318-1328 | storage_controller/src/http.rs:1409-1419 — both copies are in the same file, so extract the block into 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) storage_controller/src/service.rs:4123— storage_controller/src/service.rs:4123-4133 | storage_controller/src/service.rs:4177-4187 — both copies are in the same file, so extract the block into 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) storage_controller/src/service.rs:2330— storage_controller/src/service.rs:2330-2340 | storage_controller/src/service.rs:5862-5873 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Timeline::compact_with_gc_inner (cyclomatic 86) pageserver/src/tenant/timeline/compaction.rs:3236— Timeline::compact_with_gc_inner has cyclomatic complexity 86 (threshold 15). Of this number, 85 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Timeline::compact_level0_phase1 (cyclomatic 53) pageserver/src/tenant/timeline/compaction.rs:1883— Timeline::compact_level0_phase1 has cyclomatic complexity 53 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Timeline::generate_key_retention (cyclomatic 47) pageserver/src/tenant/timeline/compaction.rs:2637— Timeline::generate_key_retention has cyclomatic complexity 47 (threshold 15). Of this number, 41 points are the body's own statements and 6 belong to 2 function items inside it that branch. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Timeline::create_image_layers (cyclomatic 31) pageserver/src/tenant/timeline.rs:5856— Timeline::create_image_layers 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.
Timeline::compact_shard_ancestors (cyclomatic 27) pageserver/src/tenant/timeline/compaction.rs:1523— Timeline::compact_shard_ancestors 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.
Timeline::compact_legacy (cyclomatic 25) pageserver/src/tenant/timeline/compaction.rs:1206— Timeline::compact_legacy 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.
Timeline::flush_loop (cyclomatic 24) pageserver/src/tenant/timeline.rs:4928— Timeline::flush_loop 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.
Timeline::gc_compaction_split_jobs (cyclomatic 18) pageserver/src/tenant/timeline/compaction.rs:3050— Timeline::gc_compaction_split_jobs has cyclomatic complexity 18 (threshold 15). Of this number, 17 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Timeline::get_rel_page_at_lsn_batched (cyclomatic 16) pageserver/src/pgdatadir_mapping.rs:313— Timeline::get_rel_page_at_lsn_batched 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.
Timeline::wait_lsn (cyclomatic 16) pageserver/src/tenant/timeline.rs:1782— Timeline::wait_lsn 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.
safekeeper::pull_timeline::handle_request (cognitive 49) safekeeper/src/pull_timeline.rs:449— safekeeper::pull_timeline::handle_request has cognitive complexity 49 (threshold 15). Drivers by points: if/else 11 (25 pts), match/switch 5 (15 pts), loops 4 (8 pts), boolean chains 1 (nesting depth added 28). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
safekeeper::timeline_manager::main_task (cognitive 40) safekeeper/src/timeline_manager.rs:235— safekeeper::timeline_manager::main_task has cognitive complexity 40 (threshold 15). Drivers by points: if/else 17 (30 pts), match/switch 2 (6 pts), boolean chains 3, 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.
safekeeper::wal_backup_partial::main_task (cognitive 37) safekeeper/src/wal_backup_partial.rs:429— safekeeper::wal_backup_partial::main_task has cognitive complexity 37 (threshold 15). Drivers by points: if/else 9 (21 pts), match/switch 4 (10 pts), loops 3 (5 pts), boolean chains 1 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
safekeeper::broker::task_main (cognitive 29) safekeeper/src/broker.rs:229— safekeeper::broker::task_main has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (17 pts), match/switch 4 (11 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.
safekeeper::bin::safekeeper::start_safekeeper (cognitive 26) safekeeper/src/bin/safekeeper.rs:482— safekeeper::bin::safekeeper::start_safekeeper has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (15 pts), loops 3 (5 pts), match/switch 3 (4 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
safekeeper::handler::parse_cmd (cognitive 19) safekeeper/src/handler.rs:67— safekeeper::handler::parse_cmd has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (17 pts), 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.
safekeeper::bin::safekeeper::main (cognitive 17) safekeeper/src/bin/safekeeper.rs:286— safekeeper::bin::safekeeper::main has cognitive complexity 17 (threshold 15). Drivers by points: if/else 10 (13 pts), match/switch 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, 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.
safekeeper::debug_dump::build (cognitive 17) safekeeper/src/debug_dump.rs:198— safekeeper::debug_dump::build has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 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.
safekeeper::receive_wal::network_write (cognitive 16) safekeeper/src/receive_wal.rs:458— safekeeper::receive_wal::network_write 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.
safekeeper::wal_backup::update_task (cognitive 16) safekeeper/src/wal_backup.rs:69— safekeeper::wal_backup::update_task has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (15 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.
Duplicated block (9 lines × 2) compute_tools/src/http/extract/path.rs:23— compute_tools/src/http/extract/path.rs:23-31 | compute_tools/src/http/extract/query.rs:23-31 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) pageserver/ctl/src/layers.rs:53— pageserver/ctl/src/layers.rs:53-61 | pageserver/ctl/src/layers.rs:68-76 — both copies are in the same file, so extract the block into 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) pageserver/pagebench/src/cmd/getpage_latest_lsn.rs:162— pageserver/pagebench/src/cmd/getpage_latest_lsn.rs:162-170 | pageserver/pagebench/src/cmd/ondemand_download_churn.rs:83-91 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) pageserver/src/http/routes.rs:1601— pageserver/src/http/routes.rs:1601-1609 | pageserver/src/http/routes.rs:3325-3333 — both copies are in the same file, so extract the block into 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) pageserver/src/tenant/ephemeral_file.rs:355— pageserver/src/tenant/ephemeral_file.rs:355-363 | pageserver/src/tenant/ephemeral_file.rs:378-388 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) pageserver/src/tenant/storage_layer/delta_layer.rs:1589— pageserver/src/tenant/storage_layer/delta_layer.rs:1589-1597 | pageserver/src/tenant/storage_layer/image_layer.rs:1191-1199 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) pageserver/src/tenant/storage_layer/layer.rs:210— pageserver/src/tenant/storage_layer/layer.rs:210-218 | pageserver/src/tenant/storage_layer/layer.rs:250-258 — both copies are in the same file, so extract the block into 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) proxy/src/console_redirect_proxy.rs:178— proxy/src/console_redirect_proxy.rs:178-186 | proxy/src/pglb/mod.rs:265-273 — before extracting anything, compare `proxy/src/console_redirect_proxy.rs` and `proxy/src/pglb/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 2) safekeeper/src/safekeeper.rs:531— safekeeper/src/safekeeper.rs:531-539 | safekeeper/src/safekeeper.rs:551-559 — both copies are in the same file, so extract the block into 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) pageserver/pagebench/src/cmd/aux_files.rs:23— pageserver/pagebench/src/cmd/aux_files.rs:23-31 | pageserver/pagebench/src/cmd/trigger_initial_size_calculation.rs:27-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.
TenantShard::compaction_iteration (cognitive 39) pageserver/src/tenant.rs:3135— TenantShard::compaction_iteration has cognitive complexity 39 (threshold 15). Drivers by points: if/else 14 (24 pts), match/switch 4 (8 pts), loops 4 (5 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.
TenantShard::timeline_init_and_sync (cognitive 29) pageserver/src/tenant.rs:1164— TenantShard::timeline_init_and_sync has cognitive complexity 29 (threshold 15). Drivers by points: if/else 10 (19 pts), match/switch 4 (7 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TenantShard::optimize_attachment (cognitive 26) storage_controller/src/tenant_shard.rs:1015— TenantShard::optimize_attachment has cognitive complexity 26 (threshold 15). Drivers by points: if/else 12 (23 pts), boolean chains 2, loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TenantShard::clean_up_timelines (cognitive 24) pageserver/src/tenant.rs:1942— TenantShard::clean_up_timelines has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (16 pts), match/switch 3 (7 pts), loops 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TenantShard::maybe_optimizable (cognitive 23) storage_controller/src/tenant_shard.rs:959— TenantShard::maybe_optimizable has cognitive complexity 23 (threshold 15). Drivers by points: if/else 10 (20 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.
TenantShard::refresh_gc_info_internal (cognitive 21) pageserver/src/tenant.rs:4781— TenantShard::refresh_gc_info_internal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), boolean chains 2, loops 2, 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.
TenantShard::attach (cognitive 19) pageserver/src/tenant.rs:1690— TenantShard::attach has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (7 pts), loops 5 (6 pts), match/switch 3 (6 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.
TenantShard::apply_timeline_archival_config (cognitive 19) pageserver/src/tenant.rs:2352— TenantShard::apply_timeline_archival_config has cognitive complexity 19 (threshold 15). Drivers by points: if/else 10 (15 pts), match/switch 3 (4 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TenantShard::create_timeline (cognitive 19) pageserver/src/tenant.rs:2694— TenantShard::create_timeline has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (13 pts), match/switch 4 (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.
Change coupling: neon_local.rs ↔ neon_cli.py control_plane/src/bin/neon_local.rs:1— `control_plane/src/bin/neon_local.rs` and `test_runner/fixtures/neon_cli.py` change together 50% of the time (13 of the 26 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) and are written in DIFFERENT LANGUAGES, so no import can join them and they cannot be co-located into one unit — they compile and ship as separate artifacts. What binds them is a CONTRACT across that boundary — an event or message name, a route, a serialised shape — that each side currently spells out on its own, which is exactly why a change to one drags the other. Declare that contract once where both sides read it (a shared schema, a generated constants file, an interface-definition file) so a change on one side fails the other's build instead of drifting silently; where the surface is too small to be worth that, name the counterpart in a comment on both sides so the next reader finds it. There is nothing here to merge. You can check this without leaving the row: of the 13 shared commits counted here, the most recent 3 are `90cd5a5b` [BRC-1778] Add mechanism to `compute_ctl` to pull a new config (#12711); `d91d018a` storcon: handle pageserver disk loss (#12667); `7ed45306` `offload_lfc_interval_seconds` in ComputeSpec (#12447) — run `git show` on any of them.
Change coupling: proxy.rs ↔ limiter.rs proxy/src/bin/proxy.rs:1— `proxy/src/bin/proxy.rs` and `proxy/src/rate_limiter/limiter.rs` change together 61% of the time (14 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 14 shared commits counted here, the most recent 3 are `3b1ac8b1` proxy: Implement cancellation rate limiting (#9739); `6ca41d34` proxy: switch to leaky bucket (#8470); `be1a88e5` Proxy added per ep rate limiter (#7636) — run `git show` on any of them.
Change coupling: local_fs.rs ↔ s3_bucket.rs libs/remote_storage/src/local_fs.rs:1— `libs/remote_storage/src/local_fs.rs` and `libs/remote_storage/src/s3_bucket.rs` change together 56% of the time (29 of the 52 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 29 shared commits counted here, the most recent 3 are `9fabdda2` scrubber: add remote_storage based listing APIs and use them in find-…; `6711087d` remote_storage: expose last_modified in listings (#8497); `e22c0720` remote_storage: fix prefix handling in remote storage & clean up (#7431) — run `git show` on any of them.
Change coupling: block_io.rs ↔ ephemeral_file.rs pageserver/src/tenant/block_io.rs:1— `pageserver/src/tenant/block_io.rs` and `pageserver/src/tenant/ephemeral_file.rs` change together 53% of the time (16 of the 30 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency between them. They sit in the same directory, but in this ecosystem each file is its own module — a sibling reference still needs an import — so the missing import edge is real: the coupling runs through shared behaviour, not a declared dependency. If they duplicate structure, extract the common part into one unit; otherwise the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `8afb7837` feat: Direct IO for the pageserver write path (#11558); `9627747d` bypass `PageCache` for `InMemoryLayer` + avoid `Value::deser` on L0 f…; `5de896e7` L0 flush: opt-in mechanism to bypass PageCache reads and writes (#8190) — run `git show` on any of them.
Change coupling: mod.rs ↔ limiter.rs proxy/src/auth/backend/mod.rs:1— `proxy/src/auth/backend/mod.rs` and `proxy/src/rate_limiter/limiter.rs` change together 52% of the time (12 of the 23 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets) with no explicit dependency — the edge is real but nothing declares it. Read the pair before acting: if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE — the registration is the link, and it is meant not to be an import — and the thing to add is a comment on each side naming the other, not a merge; if they simply belong together, co-locate them; if neither holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 12 shared commits counted here, the most recent 3 are `67b94c59` [proxy] per endpoint configuration for rate limits (#12148); `589bfdfd` proxy: Changes to rate limits and GetEndpointAccessControl caches. (#…; `3b1ac8b1` proxy: Implement cancellation rate limiting (#9739) — run `git show` on any of them.
Change coupling: config.rs ↔ rsyslog.rs compute_tools/src/config.rs:1— `compute_tools/src/config.rs` and `compute_tools/src/rsyslog.rs` change together 50% of the time (6 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 6 shared commits counted here, the most recent 3 are `a7142f3b` Configure rsyslog for logs export using the spec (#11338); `3e5884ff` Revert "feat(compute_ctl): allow to change audit_log_level for existi…; `e5aef374` feat(compute_ctl): allow to change audit_log_level for existing (#11308) — run `git show` on any of them.
Change coupling: mod.rs ↔ messages.rs proxy/src/control_plane/client/mod.rs:1— `proxy/src/control_plane/client/mod.rs` and `proxy/src/control_plane/messages.rs` change together 50% of the time (6 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 6 shared commits counted here, the most recent 3 are `d19aebcf` [proxy] introduce moka for the project-info cache (#12710); `67b94c59` [proxy] per endpoint configuration for rate limits (#12148); `f62bc280` proxy: Move binaries into the lib (#10758) — run `git show` on any of them.
Change coupling: timeline.rs ↔ timeline_eviction.rs safekeeper/src/timeline.rs:1— `safekeeper/src/timeline.rs` and `safekeeper/src/timeline_eviction.rs` 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) 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 5 shared commits counted here, the most recent 3 are `923974d4` safekeeper: don't un-evict timelines during snapshot API handler (#9428); `a1813927` safekeeper: add evicted_timelines gauge. (#9318); `80512e27` safekeeper: add endpoint resetting uploaded partial segment state. — run `git show` on any of them.
Change coupling: compute_ctl.rs ↔ configurator.rs compute_tools/src/bin/compute_ctl.rs:1— `compute_tools/src/bin/compute_ctl.rs` and `compute_tools/src/configurator.rs` 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) 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 5 shared commits counted here, the most recent 3 are `90cd5a5b` [BRC-1778] Add mechanism to `compute_ctl` to pull a new config (#12711); `98883e4b` compute_ctl: Use a single tokio runtime (#10743); `6eba29c7` Improve logging on changes in a compute's status — run `git show` on any of them.
Duplicated block (14 lines × 2) libs/posthog_client_lite/src/lib.rs:620— libs/posthog_client_lite/src/lib.rs:620-633 | libs/posthog_client_lite/src/lib.rs:644-657 — both copies are in the same file, so extract the block into 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) libs/remote_storage/src/gcs_bucket.rs:714— libs/remote_storage/src/gcs_bucket.rs:714-727 | libs/remote_storage/src/gcs_bucket.rs:792-805 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) pageserver/src/page_service.rs:3108— pageserver/src/page_service.rs:3108-3121 | safekeeper/src/handler.rs:291-304 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) pageserver/src/pgdatadir_mapping.rs:894— pageserver/src/pgdatadir_mapping.rs:894-907 | pageserver/src/pgdatadir_mapping.rs:1136-1149 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) proxy/src/console_redirect_proxy.rs:162— proxy/src/console_redirect_proxy.rs:162-175 | proxy/src/pglb/mod.rs:249-262 — before extracting anything, compare `proxy/src/console_redirect_proxy.rs` and `proxy/src/pglb/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (14 lines × 2) safekeeper/src/control_file_upgrade.rs:358— safekeeper/src/control_file_upgrade.rs:358-371 | safekeeper/src/control_file_upgrade.rs:384-397 — both copies are in the same file, so extract the block into 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) storage_controller/src/service.rs:8328— storage_controller/src/service.rs:8328-8341 | storage_controller/src/service.rs:8459-8472 — both copies are in the same file, so extract the block into 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) pageserver/src/page_service.rs:2797— pageserver/src/page_service.rs:2797-2810 | safekeeper/src/handler.rs:384-397 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (14 lines × 2) pageserver/client/src/mgmt_api.rs:819— pageserver/client/src/mgmt_api.rs:819-832 | pageserver/client/src/mgmt_api.rs:843-856 — both copies are in the same file, so extract the block into 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) libs/proxy/postgres-protocol2/src/authentication/sasl.rs:217— libs/proxy/postgres-protocol2/src/authentication/sasl.rs:217-221 | libs/proxy/postgres-protocol2/src/authentication/sasl.rs:301-305 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) libs/proxy/tokio-postgres2/src/error/mod.rs:136— libs/proxy/tokio-postgres2/src/error/mod.rs:136-140 | libs/proxy/tokio-postgres2/src/error/mod.rs:160-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 (5 lines × 2) pageserver/src/import_datadir.rs:273— pageserver/src/import_datadir.rs:273-279 | pageserver/src/import_datadir.rs:412-416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (5 lines × 2) pageserver/src/tenant/remote_timeline_client.rs:1171— pageserver/src/tenant/remote_timeline_client.rs:1171-1175 | pageserver/src/tenant/remote_timeline_client.rs:1235-1239 — both copies are in the same file, so extract the block into 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) pageserver/src/tenant/remote_timeline_client.rs:1176— pageserver/src/tenant/remote_timeline_client.rs:1176-1186 | pageserver/src/tenant/remote_timeline_client.rs:1240-1244 — both copies are in the same file, so extract the block into 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) storage_controller/src/http.rs:968— storage_controller/src/http.rs:968-972 | storage_controller/src/http.rs:1019-1023 — both copies are in the same file, so extract the block into 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) pageserver/client/src/mgmt_api.rs:209— pageserver/client/src/mgmt_api.rs:209-213 | safekeeper/client/src/mgmt_api.rs:233-237 — 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) libs/remote_storage/src/azure_blob.rs:609— libs/remote_storage/src/azure_blob.rs:609-613 | libs/remote_storage/src/azure_blob.rs:656-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 (5 lines × 2) pageserver/src/tenant/storage_layer/layer.rs:1328— pageserver/src/tenant/storage_layer/layer.rs:1328-1332 | pageserver/src/tenant/storage_layer/layer.rs:1336-1340 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
proxy::pglb::handshake::handshake (cognitive 74) proxy/src/pglb/handshake.rs:61— proxy::pglb::handshake::handshake has cognitive complexity 74 (threshold 15). Drivers by points: if/else 12 (44 pts), match/switch 5 (19 pts), loops 3 (9 pts), boolean chains 2 (nesting depth added 52). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proxy::binary::proxy::run (cognitive 38) proxy/src/binary/proxy.rs:336— proxy::binary::proxy::run has cognitive complexity 38 (threshold 15). Drivers by points: if/else 17 (25 pts), match/switch 6 (9 pts), loops 2 (3 pts), boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proxy::serverless::rest::handle_rest_inner (cognitive 37) proxy/src/serverless/rest.rs:771— proxy::serverless::rest::handle_rest_inner has cognitive complexity 37 (threshold 15). Drivers by points: if/else 17 (19 pts), match/switch 14 (17 pts), loops 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.
proxy::serverless::sql_over_http::handle (cognitive 30) proxy/src/serverless/sql_over_http.rs:78— proxy::serverless::sql_over_http::handle has cognitive complexity 30 (threshold 15). Drivers by points: if/else 8 (18 pts), match/switch 4 (10 pts), boolean chains 2 (nesting depth added 16). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
proxy::protocol2::process_proxy_payload (cognitive 25) proxy/src/protocol2.rs:76— proxy::protocol2::process_proxy_payload has cognitive complexity 25 (threshold 15). Drivers by points: match/switch 6 (14 pts), if/else 3 (10 pts), loops 1 (nesting depth added 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
proxy::serverless::rest::handle (cognitive 23) proxy/src/serverless/rest.rs:542— proxy::serverless::rest::handle has cognitive complexity 23 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 3 (8 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.
proxy::serverless::request_handler (cognitive 21) proxy/src/serverless/mod.rs:398— proxy::serverless::request_handler has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (14 pts), boolean chains 4, match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
proxy::serverless::http_util::get_conn_info (cognitive 20) proxy/src/serverless/http_util.rs:142— proxy::serverless::http_util::get_conn_info has cognitive complexity 20 (threshold 15). Drivers by points: if/else 11 (14 pts), match/switch 3 (4 pts), boolean chains 1, loops 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.
storage_scrubber::garbage::find_garbage_inner (cognitive 58) storage_scrubber/src/garbage.rs:157— storage_scrubber::garbage::find_garbage_inner has cognitive complexity 58 (threshold 15). Drivers by points: if/else 23 (50 pts), loops 3 (6 pts), boolean chains 1, match/switch 1 (nesting depth added 30). 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.
storage_scrubber::checks::branch_cleanup_and_check_errors (cognitive 55) storage_scrubber/src/checks.rs:55— storage_scrubber::checks::branch_cleanup_and_check_errors has cognitive complexity 55 (threshold 15). Drivers by points: if/else 16 (40 pts), match/switch 4 (10 pts), loops 1 (3 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.
storage_scrubber::pageserver_physical_gc::gc_timeline (cognitive 37) storage_scrubber/src/pageserver_physical_gc.rs:575— storage_scrubber::pageserver_physical_gc::gc_timeline has cognitive complexity 37 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 3 (10 pts), match/switch 2 (5 pts) (nesting depth added 24). 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.
storage_scrubber::checks::list_timeline_blobs_impl (cognitive 20) storage_scrubber/src/checks.rs:398— storage_scrubber::checks::list_timeline_blobs_impl has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 6 (11 pts), if/else 5 (7 pts), boolean chains 1, loops 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.
storage_scrubber::main (cognitive 20) storage_scrubber/src/main.rs:129— storage_scrubber::main has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 4 (6 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.
storage_scrubber::scan_pageserver_metadata_cmd (cognitive 20) storage_scrubber/src/main.rs:387— storage_scrubber::scan_pageserver_metadata_cmd has cognitive complexity 20 (threshold 15). Drivers by points: if/else 9 (18 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.
storage_scrubber::pageserver_physical_gc::gc_ancestor (cognitive 17) storage_scrubber/src/pageserver_physical_gc.rs:428— storage_scrubber::pageserver_physical_gc::gc_ancestor has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 2 (5 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.
storage_scrubber::scan_pageserver_metadata::scan_pageserver_metadata::analyze_tenant (cognitive 17) storage_scrubber/src/scan_pageserver_metadata.rs:182— storage_scrubber::scan_pageserver_metadata::scan_pageserver_metadata::analyze_tenant has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (15 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.
Duplicated block (15 lines × 2) libs/proxy/tokio-postgres2/src/prepare.rs:56— libs/proxy/tokio-postgres2/src/prepare.rs:56-70 | libs/proxy/tokio-postgres2/src/query.rs:49-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 (15 lines × 2) libs/remote_storage/src/gcs_bucket.rs:729— libs/remote_storage/src/gcs_bucket.rs:729-743 | libs/remote_storage/src/gcs_bucket.rs:809-823 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) pageserver/src/import_datadir.rs:312— pageserver/src/import_datadir.rs:312-326 | pageserver/src/import_datadir.rs:460-474 — both copies are in the same file, so extract the block into 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) pageserver/src/import_datadir.rs:540— pageserver/src/import_datadir.rs:540-554 | pageserver/src/import_datadir.rs:565-579 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) storage_controller/src/http.rs:1341— storage_controller/src/http.rs:1341-1355 | storage_controller/src/http.rs:1365-1379 — both copies are in the same file, so extract the block into 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) storage_controller/src/service.rs:8174— storage_controller/src/service.rs:8174-8188 | storage_controller/src/service.rs:8310-8324 — both copies are in the same file, so extract the block into 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) storage_scrubber/src/cloud_admin_api.rs:214— storage_scrubber/src/cloud_admin_api.rs:214-228 | storage_scrubber/src/cloud_admin_api.rs:341-355 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15 lines × 2) libs/remote_storage/src/gcs_bucket.rs:650— libs/remote_storage/src/gcs_bucket.rs:650-664 | libs/remote_storage/src/gcs_bucket.rs:820-834 — both copies are in the same file, so extract the block into 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) endpoint_storage/src/lib.rs:151— endpoint_storage/src/lib.rs:151-156 | endpoint_storage/src/lib.rs:218-223 — both copies are in the same file, so extract the block into 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) pageserver/src/tenant/timeline/compaction.rs:2306— pageserver/src/tenant/timeline/compaction.rs:2306-2312 | pageserver/src/tenant/timeline/compaction.rs:2382-2387 — both copies are in the same file, so extract the block into 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) storage_controller/src/service.rs:8352— storage_controller/src/service.rs:8352-8357 | storage_controller/src/service.rs:8483-8488 — both copies are in the same file, so extract the block into 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) libs/pq_proto/src/lib.rs:59— libs/pq_proto/src/lib.rs:59-64 | proxy/src/pqproto.rs:48-53 — 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) libs/remote_storage/src/azure_blob.rs:538— libs/remote_storage/src/azure_blob.rs:538-543 | libs/remote_storage/src/s3_bucket.rs:756-761 — before extracting anything, compare `libs/remote_storage/src/azure_blob.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) pageserver/src/tenant.rs:4127— pageserver/src/tenant.rs:4127-4132 | pageserver/src/tenant/timeline.rs:2868-2873 — 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) pageserver/src/tenant.rs:4155— pageserver/src/tenant.rs:4155-4160 | pageserver/src/tenant/timeline.rs:2915-2920 — 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) pageserver/compaction/src/simulator/draw.rs:21— pageserver/compaction/src/simulator/draw.rs:21-26 | pageserver/ctl/src/draw_timeline_dir.rs:71-76 — 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.
compute_tools::config::write_postgres_conf (cognitive 66) compute_tools/src/config.rs:49— compute_tools::config::write_postgres_conf has cognitive complexity 66 (threshold 15). Drivers by points: if/else 40 (62 pts), loops 1 (2 pts), match/switch 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.
compute_tools::configurator::configurator_main_loop (cognitive 55) compute_tools/src/configurator.rs:13— compute_tools::configurator::configurator_main_loop has cognitive complexity 55 (threshold 15). Drivers by points: if/else 19 (38 pts), match/switch 3 (12 pts), loops 2 (4 pts), boolean chains 1 (nesting depth added 30). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compute_tools::compute::forward_termination_signal (cognitive 27) compute_tools/src/compute.rs:2860— compute_tools::compute::forward_termination_signal has cognitive complexity 27 (threshold 15). Drivers by points: if/else 10 (23 pts), match/switch 2 (4 pts) (nesting depth added 15). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
compute_tools::pg_helpers::wait_for_postgres (cognitive 22) compute_tools/src/pg_helpers.rs:331— compute_tools::pg_helpers::wait_for_postgres has cognitive complexity 22 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 2 (3 pts), match/switch 2 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compute_tools::pg_helpers::tune_pgbouncer (cognitive 22) compute_tools/src/pg_helpers.rs:472— compute_tools::pg_helpers::tune_pgbouncer has cognitive complexity 22 (threshold 15). Drivers by points: if/else 10 (17 pts), loops 2 (3 pts), match/switch 1 (2 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
compute_tools::extension_server::create_control_files (cognitive 21) compute_tools/src/extension_server.rs:229— compute_tools::extension_server::create_control_files has cognitive complexity 21 (threshold 15). Drivers by points: if/else 6 (18 pts), loops 2 (3 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.
compute_tools::monitor::get_backends_state_change (cognitive 20) compute_tools/src/monitor.rs:444— compute_tools::monitor::get_backends_state_change has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (12 pts), if/else 3 (6 pts), loops 1 (2 pts) (nesting depth added 12). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Duplicated block (16 lines × 2) libs/remote_storage/src/gcs_bucket.rs:117— libs/remote_storage/src/gcs_bucket.rs:117-132 | libs/remote_storage/src/s3_bucket.rs:171-186 — before extracting anything, compare `libs/remote_storage/src/gcs_bucket.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) libs/remote_storage/src/gcs_bucket.rs:624— libs/remote_storage/src/gcs_bucket.rs:624-639 | libs/remote_storage/src/s3_bucket.rs:780-795 — before extracting anything, compare `libs/remote_storage/src/gcs_bucket.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) libs/remote_storage/src/gcs_bucket.rs:981— libs/remote_storage/src/gcs_bucket.rs:981-996 | libs/remote_storage/src/s3_bucket.rs:671-686 — before extracting anything, compare `libs/remote_storage/src/gcs_bucket.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (16 lines × 2) pageserver/pagebench/src/cmd/basebackup.rs:218— pageserver/pagebench/src/cmd/basebackup.rs:218-233 | pageserver/pagebench/src/cmd/getpage_latest_lsn.rs:405-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 (16 lines × 2) pageserver/src/tenant/storage_layer.rs:973— pageserver/src/tenant/storage_layer.rs:973-988 | pageserver/src/tenant/storage_layer.rs:990-1005 — both copies are in the same file, so extract the block into 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) storage_controller/src/service.rs:9612— storage_controller/src/service.rs:9612-9627 | storage_controller/src/service.rs:9722-9737 — both copies are in the same file, so extract the block into 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) storage_controller/src/persistence.rs:1606— storage_controller/src/persistence.rs:1606-1621 | storage_controller/src/persistence.rs:1647-1662 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Off the main sequence: pageserver_page_api — pageserver_page_api: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 4 project(s), so it's rigid to change.
Off the main sequence: posthog_client_lite — posthog_client_lite: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: safekeeper_api — safekeeper_api: abstractness 0.00, instability 0.00, distance 1.00 — zone of pain — concrete and depended on by 5 project(s), so it's rigid to change.
Off the main sequence: postgres-protocol2 — postgres-protocol2: abstractness 0.03, instability 0.00, distance 0.97 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: utils — utils: abstractness 0.07, instability 0.00, distance 0.93 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: pageserver_client — pageserver_client: abstractness 0.11, instability 0.14, distance 0.75 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
Off the main sequence: json — json: abstractness 0.29, instability 0.00, distance 0.71 — zone of pain — concrete and depended on by 1 project(s), so it's rigid to change.
D30 · Dependency Vulnerabilities· Medium advisory (unmaintained) · ×6
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
REDACTED
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×6
Members sharing a duplicated core (4 members, 50+ identical tokens) libs/remote_storage/src/gcs_bucket.rs:146— libs/remote_storage/src/gcs_bucket.rs:146-161 | libs/remote_storage/src/gcs_bucket.rs:167-181 | libs/remote_storage/src/s3_bucket.rs:201-216 | libs/remote_storage/src/s3_bucket.rs:222-236 — 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) pageserver/client/src/mgmt_api.rs:711— pageserver/client/src/mgmt_api.rs:711-728 | pageserver/client/src/mgmt_api.rs:735-752 | pageserver/client/src/mgmt_api.rs:759-776 | pageserver/client/src/mgmt_api.rs:783-805 — 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) pageserver/src/http/routes.rs:834— pageserver/src/http/routes.rs:834-867 | pageserver/src/http/routes.rs:2281-2295 | pageserver/src/http/routes.rs:2301-2315 | pageserver/src/http/routes.rs:2447-2490 — 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) proxy/src/config.rs:123— proxy/src/config.rs:123-146 | proxy/src/config.rs:194-225 | proxy/src/config.rs:261-287 | proxy/src/config.rs:317-367 — 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) safekeeper/src/http/routes.rs:170— safekeeper/src/http/routes.rs:170-219 | safekeeper/src/http/routes.rs:273-308 | safekeeper/src/http/routes.rs:371-405 | safekeeper/src/http/routes.rs:513-528 — 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) storage_controller/src/http.rs:338— storage_controller/src/http.rs:338-351 | storage_controller/src/http.rs:423-446 | storage_controller/src/http.rs:475-551 | storage_controller/src/http.rs:582-602 — 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 (19 lines × 2) control_plane/storcon_cli/src/main.rs:523— control_plane/storcon_cli/src/main.rs:523-541 | control_plane/storcon_cli/src/main.rs:1014-1032 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (19 lines × 2) libs/http-utils/src/error.rs:71— libs/http-utils/src/error.rs:71-89 | proxy/src/serverless/http_util.rs:64-82 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (19 lines × 2) pageserver/src/tenant/storage_layer/delta_layer.rs:432— pageserver/src/tenant/storage_layer/delta_layer.rs:432-450 | pageserver/src/tenant/storage_layer/image_layer.rs:789-807 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) proxy/src/console_redirect_proxy.rs:244— proxy/src/console_redirect_proxy.rs:244-262 | proxy/src/proxy/mod.rs:126-144 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (19 lines × 2) proxy/src/serverless/mod.rs:76— proxy/src/serverless/mod.rs:76-94 | proxy/src/serverless/mod.rs:96-114 — both copies are in the same file, so extract the block into 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) storage_scrubber/src/pageserver_physical_gc.rs:326— storage_scrubber/src/pageserver_physical_gc.rs:326-344 | storage_scrubber/src/pageserver_physical_gc.rs:389-407 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) libs/remote_storage/src/gcs_bucket.rs:1114— libs/remote_storage/src/gcs_bucket.rs:1114-1130 | libs/remote_storage/src/s3_bucket.rs:862-878 — before extracting anything, compare `libs/remote_storage/src/gcs_bucket.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) pageserver/src/tenant/storage_layer/delta_layer.rs:1074— pageserver/src/tenant/storage_layer/delta_layer.rs:1074-1090 | pageserver/src/tenant/storage_layer/image_layer.rs:669-685 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) storage_broker/src/bin/storage_broker.rs:541— storage_broker/src/bin/storage_broker.rs:541-557 | storage_broker/src/bin/storage_broker.rs:600-616 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17 lines × 2) storage_controller/src/service.rs:8412— storage_controller/src/service.rs:8412-8428 | storage_controller/src/service.rs:8543-8559 — both copies are in the same file, so extract the block into 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) storage_controller/src/service.rs:9931— storage_controller/src/service.rs:9931-9947 | storage_controller/src/service.rs:10013-10029 — both copies are in the same file, so extract the block into 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) pageserver/src/tenant/storage_layer/delta_layer.rs:673— pageserver/src/tenant/storage_layer/delta_layer.rs:673-689 | pageserver/src/tenant/storage_layer/image_layer.rs:1069-1085 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) storage_scrubber/src/cloud_admin_api.rs:219— storage_scrubber/src/cloud_admin_api.rs:219-231 | storage_scrubber/src/cloud_admin_api.rs:279-292 — both copies are in the same file, so extract the block into 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) pageserver/src/tenant/storage_layer/delta_layer.rs:1606— pageserver/src/tenant/storage_layer/delta_layer.rs:1606-1618 | pageserver/src/tenant/storage_layer/image_layer.rs:1210-1222 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) storage_scrubber/src/cloud_admin_api.rs:405— storage_scrubber/src/cloud_admin_api.rs:405-417 | storage_scrubber/src/cloud_admin_api.rs:429-441 — both copies are in the same file, so extract the block into 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) control_plane/storcon_cli/src/main.rs:1253— control_plane/storcon_cli/src/main.rs:1253-1265 | control_plane/storcon_cli/src/main.rs:1282-1294 — both copies are in the same file, so extract the block into 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) pageserver/src/tenant/storage_layer/delta_layer.rs:582— pageserver/src/tenant/storage_layer/delta_layer.rs:582-594 | pageserver/src/tenant/storage_layer/image_layer.rs:980-992 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) pageserver/src/walredo/apply_neon.rs:122— pageserver/src/walredo/apply_neon.rs:122-134 | pageserver/src/walredo/apply_neon.rs:162-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–11 lines × 2) libs/pq_proto/src/lib.rs:282— libs/pq_proto/src/lib.rs:282-292 | libs/proxy/postgres-protocol2/src/message/backend.rs:115-124 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10–11 lines × 2) pageserver/client_grpc/src/client.rs:245— pageserver/client_grpc/src/client.rs:245-254 | pageserver/src/page_service.rs:3712-3722 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10–11 lines × 2) pageserver/src/auth.rs:5— pageserver/src/auth.rs:5-14 | safekeeper/src/auth.rs:8-18 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10–11 lines × 2) pageserver/src/tenant/storage_layer/delta_layer.rs:354— pageserver/src/tenant/storage_layer/delta_layer.rs:354-364 | pageserver/src/tenant/storage_layer/image_layer.rs:313-322 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) proxy/src/serverless/conn_pool_lib.rs:523— proxy/src/serverless/conn_pool_lib.rs:523-532 | proxy/src/serverless/local_conn_pool.rs:106-116 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (10–11 lines × 2) proxy/src/serverless/mod.rs:462— proxy/src/serverless/mod.rs:462-471 | proxy/src/serverless/mod.rs:503-513 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
TenantManager::do_shard_split (cognitive 31) pageserver/src/tenant/mgr.rs:1474— TenantManager::do_shard_split has cognitive complexity 31 (threshold 15). Drivers by points: if/else 11 (22 pts), loops 4 (6 pts), match/switch 2, boolean chains 1 (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TenantManager::upsert_location (cognitive 26) pageserver/src/tenant/mgr.rs:842— TenantManager::upsert_location has cognitive complexity 26 (threshold 15). Drivers by points: match/switch 12 (19 pts), if/else 4 (7 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.
TenantManager::shard_split_hardlink (cognitive 25) pageserver/src/tenant/mgr.rs:1710— TenantManager::shard_split_hardlink has cognitive complexity 25 (threshold 15). Drivers by points: loops 7 (9 pts), if/else 4 (8 pts), match/switch 3 (8 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.
TenantManager::resolve_attached_shard (cognitive 21) pageserver/src/tenant/mgr.rs:2251— TenantManager::resolve_attached_shard has cognitive complexity 21 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 3 (7 pts), loops 1 (2 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.
TenantManager::shutdown_all_tenants0 (cognitive 20) pageserver/src/tenant/mgr.rs:1858— TenantManager::shutdown_all_tenants0 has cognitive complexity 20 (threshold 15). Drivers by points: match/switch 4 (9 pts), if/else 3 (8 pts), loops 2 (3 pts) (nesting depth added 11). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WalIngest::ingest_record (cognitive 23) pageserver/src/walingest.rs:234— WalIngest::ingest_record has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 10 (19 pts), if/else 3, boolean chains 1 (nesting depth added 9). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WalIngest::ingest_xact_record (cognitive 21) pageserver/src/walingest.rs:796— WalIngest::ingest_xact_record has cognitive complexity 21 (threshold 15). Drivers by points: if/else 11 (16 pts), loops 3 (4 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WalIngest::warn_on_ingest_lag (cognitive 20) pageserver/src/walingest.rs:741— WalIngest::warn_on_ingest_lag has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (16 pts), match/switch 2 (3 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.
WalIngest::handle_rel_extend (cognitive 19) pageserver/src/walingest.rs:1439— WalIngest::handle_rel_extend has cognitive complexity 19 (threshold 15). Drivers by points: if/else 6 (16 pts), loops 1 (2 pts), boolean chains 1 (nesting depth added 11). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
WalIngest::ingest_multixact_create (cognitive 18) pageserver/src/walingest.rs:1015— WalIngest::ingest_multixact_create has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), loops 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (9 lines × 3) libs/remote_storage/src/azure_blob.rs:994— libs/remote_storage/src/azure_blob.rs:994-1002 | libs/remote_storage/src/gcs_bucket.rs:1237-1245 | libs/remote_storage/src/s3_bucket.rs:1027-1035 — before extracting anything, compare `libs/remote_storage/src/azure_blob.rs` and `libs/remote_storage/src/gcs_bucket.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9 lines × 3) safekeeper/src/control_file_upgrade.rs:461— safekeeper/src/control_file_upgrade.rs:461-469 | safekeeper/src/control_file_upgrade.rs:481-489 | safekeeper/src/control_file_upgrade.rs:500-508 — 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) storage_scrubber/src/cloud_admin_api.rs:466— storage_scrubber/src/cloud_admin_api.rs:466-474 | storage_scrubber/src/cloud_admin_api.rs:498-506 | storage_scrubber/src/cloud_admin_api.rs:537-545 — 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) libs/pageserver_api/src/pagestream_api.rs:337— libs/pageserver_api/src/pagestream_api.rs:337-345 | libs/pageserver_api/src/pagestream_api.rs:352-360 | libs/pageserver_api/src/pagestream_api.rs:362-373 — 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) control_plane/storcon_cli/src/main.rs:521— control_plane/storcon_cli/src/main.rs:521-529 | control_plane/storcon_cli/src/main.rs:1012-1020 | control_plane/storcon_cli/src/main.rs:1306-1316 — 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.
safekeeper::timeline_manager::main_task (cyclomatic 28) safekeeper/src/timeline_manager.rs:235— safekeeper::timeline_manager::main_task 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.
safekeeper::pull_timeline::handle_request (cyclomatic 23) safekeeper/src/pull_timeline.rs:449— safekeeper::pull_timeline::handle_request 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.
safekeeper::bin::safekeeper::start_safekeeper (cyclomatic 22) safekeeper/src/bin/safekeeper.rs:482— safekeeper::bin::safekeeper::start_safekeeper 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.
safekeeper::wal_backup_partial::main_task (cyclomatic 22) safekeeper/src/wal_backup_partial.rs:429— safekeeper::wal_backup_partial::main_task 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.
storage_scrubber::checks::branch_cleanup_and_check_errors (cyclomatic 23) storage_scrubber/src/checks.rs:55— storage_scrubber::checks::branch_cleanup_and_check_errors 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.
storage_scrubber::garbage::find_garbage_inner (cyclomatic 21) storage_scrubber/src/garbage.rs:157— storage_scrubber::garbage::find_garbage_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.
storage_scrubber::main (cyclomatic 21) storage_scrubber/src/main.rs:129— storage_scrubber::main 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.
storage_scrubber::checks::list_timeline_blobs_impl (cyclomatic 17) storage_scrubber/src/checks.rs:398— storage_scrubber::checks::list_timeline_blobs_impl 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.
Duplicated block (8–9 lines × 2) pageserver/src/http/routes.rs:1576— pageserver/src/http/routes.rs:1576-1583 | pageserver/src/http/routes.rs:2571-2579 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8–9 lines × 2) pageserver/src/http/routes.rs:3999— pageserver/src/http/routes.rs:3999-4007 | storage_controller/src/http.rs:2194-2201 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (8–9 lines × 2) pageserver/src/tenant/remote_timeline_client.rs:423— pageserver/src/tenant/remote_timeline_client.rs:423-430 | pageserver/src/tenant/remote_timeline_client.rs:476-484 — both copies are in the same file, so extract the block into 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) storage_controller/src/service.rs:7123— storage_controller/src/service.rs:7123-7130 | storage_controller/src/service.rs:7286-7294 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Low cohesion: WalResidentTimeline (LCOM4 7) safekeeper/src/timeline.rs:1021— WalResidentTimeline'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: RequestContextInner (LCOM4 6) proxy/src/context/mod.rs:41— RequestContextInner'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: JemallocGauge (LCOM4 6) proxy/src/jemalloc.rs:61— JemallocGauge'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: ComputeNode (LCOM4 4) compute_tools/src/compute.rs:139— ComputeNode'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.
MetadataRecord::decode_heapam_record (cyclomatic 74) libs/wal_decoder/src/decoder.rs:193— MetadataRecord::decode_heapam_record has cyclomatic complexity 74 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MetadataRecord::from_decoded_filtered (cyclomatic 21) libs/wal_decoder/src/decoder.rs:77— MetadataRecord::from_decoded_filtered 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.
MetadataRecord::decode_neonmgr_record (cyclomatic 16) libs/wal_decoder/src/decoder.rs:499— MetadataRecord::decode_neonmgr_record 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.
proxy::serverless::rest::handle_rest_inner (cyclomatic 39) proxy/src/serverless/rest.rs:771— proxy::serverless::rest::handle_rest_inner has cyclomatic complexity 39 (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.
proxy::binary::proxy::run (cyclomatic 25) proxy/src/binary/proxy.rs:336— proxy::binary::proxy::run 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.
proxy::pglb::handshake::handshake (cyclomatic 24) proxy/src/pglb/handshake.rs:61— proxy::pglb::handshake::handshake 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.
TenantManager::upsert_location (cyclomatic 26) pageserver/src/tenant/mgr.rs:842— TenantManager::upsert_location 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.
TenantManager::do_shard_split (cyclomatic 20) pageserver/src/tenant/mgr.rs:1474— TenantManager::do_shard_split 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.
TenantManager::shard_split_hardlink (cyclomatic 17) pageserver/src/tenant/mgr.rs:1710— TenantManager::shard_split_hardlink 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.
MetadataRecord::decode_heapam_record (cognitive 196) libs/wal_decoder/src/decoder.rs:193— MetadataRecord::decode_heapam_record has cognitive complexity 196 (threshold 15). Drivers by points: if/else 74 (190 pts), boolean chains 5, match/switch 1 (nesting depth added 116). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetadataRecord::decode_neonmgr_record (cognitive 28) libs/wal_decoder/src/decoder.rs:499— MetadataRecord::decode_neonmgr_record has cognitive complexity 28 (threshold 15). Drivers by points: if/else 10 (24 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MetadataRecord::decode_dbase_record (cognitive 16) libs/wal_decoder/src/decoder.rs:628— MetadataRecord::decode_dbase_record has cognitive complexity 16 (threshold 15). Drivers by points: if/else 11 (15 pts), match/switch 1 (nesting depth added 4). 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.
Reconciler::reconcile (cognitive 48) storage_controller/src/reconciler.rs:836— Reconciler::reconcile has cognitive complexity 48 (threshold 15). Drivers by points: if/else 16 (33 pts), match/switch 4 (10 pts), loops 3, 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.
Reconciler::maybe_live_migrate (cognitive 23) storage_controller/src/reconciler.rs:356— Reconciler::maybe_live_migrate has cognitive complexity 23 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 2 (5 pts), loops 1 (nesting depth added 13). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
Reconciler::await_lsn (cognitive 18) storage_controller/src/reconciler.rs:552— Reconciler::await_lsn has cognitive complexity 18 (threshold 15). Drivers by points: if/else 3 (7 pts), match/switch 3 (7 pts), loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GcCompactionQueue::iteration_inner (cognitive 45) pageserver/src/tenant/timeline/compaction.rs:590— GcCompactionQueue::iteration_inner has cognitive complexity 45 (threshold 15). Drivers by points: if/else 22 (35 pts), match/switch 5 (10 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.
GcCompactionQueue::trigger_auto_compaction (cognitive 18) pageserver/src/tenant/timeline/compaction.rs:281— GcCompactionQueue::trigger_auto_compaction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 14 (16 pts), boolean chains 1, loops 1 (nesting depth added 2). Of this number, 13 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
GcCompactionQueue::handle_sub_compaction (cognitive 18) pageserver/src/tenant/timeline/compaction.rs:462— GcCompactionQueue::handle_sub_compaction has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (6 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.
control_plane::bin::neon_local::handle_endpoint (cognitive 42) control_plane/src/bin/neon_local.rs:1319— control_plane::bin::neon_local::handle_endpoint has cognitive complexity 42 (threshold 15). Drivers by points: if/else 17 (28 pts), match/switch 6 (12 pts), loops 1 (2 pts) (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.
control_plane::bin::neon_local::print_timeline (cognitive 21) control_plane/src/bin/neon_local.rs:853— control_plane::bin::neon_local::print_timeline has cognitive complexity 21 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (4 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.
control_plane::bin::neon_local::try_stop_all (cognitive 19) control_plane/src/bin/neon_local.rs:2057— control_plane::bin::neon_local::try_stop_all has cognitive complexity 19 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 4 (5 pts), match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pagebench::cmd::getpage_latest_lsn::main_impl (cognitive 40) pageserver/pagebench/src/cmd/getpage_latest_lsn.rs:156— pagebench::cmd::getpage_latest_lsn::main_impl has cognitive complexity 40 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 9 (17 pts), match/switch 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.
pagebench::cmd::getpage_latest_lsn::run_worker (cognitive 33) pageserver/pagebench/src/cmd/getpage_latest_lsn.rs:422— pagebench::cmd::getpage_latest_lsn::run_worker has cognitive complexity 33 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 4 (10 pts) (nesting depth added 21). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pagebench::cmd::ondemand_download_churn::timeline_actor (cognitive 18) pageserver/pagebench/src/cmd/ondemand_download_churn.rs:195— pagebench::cmd::ondemand_download_churn::timeline_actor has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 2 (9 pts), loops 3 (6 pts), if/else 1 (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.
GCSBucket::time_travel_recover (cognitive 31) libs/remote_storage/src/gcs_bucket.rs:1189— GCSBucket::time_travel_recover has cognitive complexity 31 (threshold 15). Drivers by points: if/else 9 (18 pts), match/switch 4 (11 pts), loops 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.
GCSBucket::get_object (cognitive 17) libs/remote_storage/src/gcs_bucket.rs:686— GCSBucket::get_object has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 7 (11 pts), if/else 4 (6 pts) (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.
GCSBucket::list_streaming (cognitive 17) libs/remote_storage/src/gcs_bucket.rs:912— GCSBucket::list_streaming has cognitive complexity 17 (threshold 15). Drivers by points: if/else 3 (8 pts), match/switch 3 (6 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayerMap::get_visibility (cognitive 29) pageserver/src/tenant/layer_map.rs:1043— LayerMap::get_visibility has cognitive complexity 29 (threshold 15). Drivers by points: if/else 11 (21 pts), match/switch 3 (5 pts), loops 2, boolean chains 1 (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayerMap::count_deltas (cognitive 19) pageserver/src/tenant/layer_map.rs:841— LayerMap::count_deltas has cognitive complexity 19 (threshold 15). Drivers by points: if/else 7 (16 pts), boolean chains 1, loops 1, match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LayerMap::select_layer (cognitive 18) pageserver/src/tenant/layer_map.rs:473— LayerMap::select_layer has cognitive complexity 18 (threshold 15). Drivers by points: if/else 8 (12 pts), boolean chains 3, match/switch 2 (3 pts) (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.
FeatureStore::evaluate_multivariate_inner (cognitive 20) libs/posthog_client_lite/src/lib.rs:358— FeatureStore::evaluate_multivariate_inner has cognitive complexity 20 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (6 pts), match/switch 1 (3 pts) (nesting depth added 12). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FeatureStore::evaluate_condition (cognitive 16) libs/posthog_client_lite/src/lib.rs:160— FeatureStore::evaluate_condition has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (11 pts), match/switch 3 (5 pts) (nesting depth added 8). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FeatureStore::evaluate_group (cognitive 16) libs/posthog_client_lite/src/lib.rs:236— FeatureStore::evaluate_group has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (14 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.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (5 members, 50+ identical tokens) pageserver/pagebench/src/cmd/aux_files.rs:33— pageserver/pagebench/src/cmd/aux_files.rs:33-103 | pageserver/pagebench/src/cmd/basebackup.rs:84-233 | pageserver/pagebench/src/cmd/getpage_latest_lsn.rs:159-420 | pageserver/pagebench/src/cmd/ondemand_download_churn.rs:80-193 | pageserver/pagebench/src/cmd/trigger_initial_size_calculation.rs:37-97 — 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) storage_controller/src/http.rs:356— storage_controller/src/http.rs:356-393 | storage_controller/src/http.rs:451-470 | storage_controller/src/http.rs:556-577 | storage_controller/src/http.rs:689-710 | storage_controller/src/http.rs:1504-1533 — 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) storage_controller/src/service.rs:8172— storage_controller/src/service.rs:8172-8276 | storage_controller/src/service.rs:8308-8409 | storage_controller/src/service.rs:8411-8441 | storage_controller/src/service.rs:8443-8540 | storage_controller/src/service.rs:8542-8572 — These 5 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 5 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 5 times.
Duplicated block (26 lines × 2) proxy/src/console_redirect_proxy.rs:31— proxy/src/console_redirect_proxy.rs:31-56 | proxy/src/pglb/mod.rs:52-77 — before extracting anything, compare `proxy/src/console_redirect_proxy.rs` and `proxy/src/pglb/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 2) proxy/src/console_redirect_proxy.rs:125— proxy/src/console_redirect_proxy.rs:125-150 | proxy/src/pglb/mod.rs:149-174 — before extracting anything, compare `proxy/src/console_redirect_proxy.rs` and `proxy/src/pglb/mod.rs` as WHOLE FILES: this scan already matched 5 separate duplicated blocks between them, totalling at least 87 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 2) proxy/src/serverless/conn_pool_lib.rs:572— proxy/src/serverless/conn_pool_lib.rs:572-597 | proxy/src/serverless/http_conn_pool.rs:163-188 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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–16 lines × 2) libs/remote_storage/src/gcs_bucket.rs:824— libs/remote_storage/src/gcs_bucket.rs:824-837 | libs/remote_storage/src/s3_bucket.rs:298-313 — before extracting anything, compare `libs/remote_storage/src/gcs_bucket.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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–16 lines × 2) pageserver/src/tenant/upload_queue.rs:356— pageserver/src/tenant/upload_queue.rs:356-369 | pageserver/src/tenant/upload_queue.rs:395-410 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–16 lines × 2) proxy/src/binary/proxy.rs:817— proxy/src/binary/proxy.rs:817-830 | proxy/src/binary/proxy.rs:894-909 — both copies are in the same file, so extract the block into 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) control_plane/src/endpoint.rs:1107— control_plane/src/endpoint.rs:1107-1118 | control_plane/src/endpoint.rs:1193-1203 — both copies are in the same file, so extract the block into 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) proxy/src/context/parquet.rs:184— proxy/src/context/parquet.rs:184-194 | proxy/src/context/parquet.rs:221-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–12 lines × 2) storage_controller/src/node.rs:364— storage_controller/src/node.rs:364-374 | storage_controller/src/safekeeper.rs:122-133 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (7 lines × 3) libs/pageserver_api/src/pagestream_api.rs:242— libs/pageserver_api/src/pagestream_api.rs:242-248 | libs/pageserver_api/src/pagestream_api.rs:253-259 | libs/pageserver_api/src/pagestream_api.rs:264-270 — 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) libs/remote_storage/src/gcs_bucket.rs:401— libs/remote_storage/src/gcs_bucket.rs:401-407 | libs/remote_storage/src/gcs_bucket.rs:667-673 | libs/remote_storage/src/gcs_bucket.rs:749-755 — 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) libs/pageserver_api/src/pagestream_api.rs:470— libs/pageserver_api/src/pagestream_api.rs:470-476 | libs/pageserver_api/src/pagestream_api.rs:482-488 | libs/pageserver_api/src/pagestream_api.rs:494-500 — 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) libs/pageserver_api/src/pagestream_api.rs:561— libs/pageserver_api/src/pagestream_api.rs:561-566 | libs/pageserver_api/src/pagestream_api.rs:584-589 | libs/pageserver_api/src/pagestream_api.rs:607-612 — 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) libs/utils/src/id.rs:59— libs/utils/src/id.rs:59-64 | libs/utils/src/shard.rs:381-386 | libs/utils/src/shard.rs:452-457 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (6 lines × 3) pageserver/src/page_service.rs:2863— pageserver/src/page_service.rs:2863-2868 | pageserver/src/page_service.rs:2884-2889 | pageserver/src/page_service.rs:2923-2928 — 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.
compute_tools::config::write_postgres_conf (cyclomatic 37) compute_tools/src/config.rs:49— compute_tools::config::write_postgres_conf has cyclomatic complexity 37 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
compute_tools::configurator::configurator_main_loop (cyclomatic 20) compute_tools/src/configurator.rs:13— compute_tools::configurator::configurator_main_loop 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.
TenantShard::compaction_iteration (cyclomatic 30) pageserver/src/tenant.rs:3135— TenantShard::compaction_iteration 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.
TenantShard::attach (cyclomatic 16) pageserver/src/tenant.rs:1690— TenantShard::attach 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.
pagectl::layers::main (cyclomatic 26) pageserver/ctl/src/layers.rs:82— pagectl::layers::main has cyclomatic complexity 26 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pagectl::layer_map_analyzer::main (cyclomatic 16) pageserver/ctl/src/layer_map_analyzer.rs:131— pagectl::layer_map_analyzer::main has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GcCompactionQueue::iteration_inner (cyclomatic 23) pageserver/src/tenant/timeline/compaction.rs:590— GcCompactionQueue::iteration_inner 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.
GcCompactionQueue::trigger_auto_compaction (cyclomatic 16) pageserver/src/tenant/timeline/compaction.rs:281— GcCompactionQueue::trigger_auto_compaction has cyclomatic complexity 16 (threshold 15). Of this number, 11 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HeartbeaterTask::heartbeat (cyclomatic 21) storage_controller/src/heartbeater.rs:172— HeartbeaterTask::heartbeat 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.
HeartbeaterTask::heartbeat (cyclomatic 18) storage_controller/src/heartbeater.rs:321— HeartbeaterTask::heartbeat 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.
pagectl::layer_map_analyzer::main (cognitive 60) pageserver/ctl/src/layer_map_analyzer.rs:131— pagectl::layer_map_analyzer::main has cognitive complexity 60 (threshold 15). Drivers by points: if/else 10 (45 pts), loops 5 (14 pts), boolean chains 1 (nesting depth added 44). To reduce it, flatten the nesting: this score is depth rather than breadth — most of its points come from checks stacked inside one another, so the work sits several levels in. Invert each enclosing check into an early exit (a return, or the language's equivalent) so the happy path stays at one level, and where a level cannot be exited early, lift the block it encloses into its own named function.
pagectl::layers::main (cognitive 58) pageserver/ctl/src/layers.rs:82— pagectl::layers::main has cognitive complexity 58 (threshold 15). Drivers by points: if/else 14 (41 pts), loops 5 (11 pts), match/switch 3 (5 pts), boolean chains 1 (nesting depth added 35). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
postgres_ffi::walrecord::decode_wal_record (cognitive 57) libs/postgres_ffi/src/walrecord.rs:246— postgres_ffi::walrecord::decode_wal_record has cognitive complexity 57 (threshold 15). Drivers by points: if/else 17 (47 pts), boolean chains 6, loops 2, match/switch 1 (2 pts) (nesting depth added 31). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
postgres_ffi::xlog_utils::find_end_of_wal (cognitive 19) libs/postgres_ffi/src/xlog_utils.rs:227— postgres_ffi::xlog_utils::find_end_of_wal has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (8 pts), match/switch 2 (7 pts), if/else 1 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComputeMonitor::check (cognitive 44) compute_tools/src/monitor.rs:206— ComputeMonitor::check has cognitive complexity 44 (threshold 15). Drivers by points: if/else 10 (30 pts), match/switch 9 (14 pts) (nesting depth added 25). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComputeMonitor::run (cognitive 25) compute_tools/src/monitor.rs:112— ComputeMonitor::run has cognitive complexity 25 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 2 (6 pts), loops 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Basebackup::send_tarball (cognitive 40) pageserver/src/basebackup.rs:335— Basebackup::send_tarball has cognitive complexity 40 (threshold 15). Drivers by points: if/else 12 (23 pts), loops 9 (14 pts), boolean chains 3 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Basebackup::add_dbdir (cognitive 16) pageserver/src/basebackup.rs:633— Basebackup::add_dbdir has cognitive complexity 16 (threshold 15). Drivers by points: if/else 10 (15 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.
Validator::validate (cognitive 37) pageserver/src/deletion_queue/validator.rs:111— Validator::validate has cognitive complexity 37 (threshold 15). Drivers by points: if/else 13 (25 pts), loops 6 (9 pts), boolean chains 2, 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.
Validator::background (cognitive 17) pageserver/src/deletion_queue/validator.rs:350— Validator::background has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 3 (7 pts), loops 1 (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ListWriter::background (cognitive 36) pageserver/src/deletion_queue/list_writer.rs:347— ListWriter::background has cognitive complexity 36 (threshold 15). Drivers by points: if/else 12 (27 pts), loops 2 (4 pts), match/switch 2 (4 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.
ListWriter::recover (cognitive 30) pageserver/src/deletion_queue/list_writer.rs:199— ListWriter::recover has cognitive complexity 30 (threshold 15). Drivers by points: if/else 10 (21 pts), loops 3 (5 pts), match/switch 2 (4 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.
HeartbeaterTask::heartbeat (cognitive 34) storage_controller/src/heartbeater.rs:172— HeartbeaterTask::heartbeat has cognitive complexity 34 (threshold 15). Drivers by points: match/switch 7 (16 pts), if/else 6 (14 pts), loops 4 (nesting depth added 17). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
HeartbeaterTask::heartbeat (cognitive 28) storage_controller/src/heartbeater.rs:321— HeartbeaterTask::heartbeat has cognitive complexity 28 (threshold 15). Drivers by points: match/switch 7 (16 pts), if/else 3 (8 pts), loops 4 (nesting depth added 14). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
AzureBlobStorage::list_streaming_for_fn (cognitive 33) libs/remote_storage/src/azure_blob.rs:272— AzureBlobStorage::list_streaming_for_fn has cognitive complexity 33 (threshold 15). Drivers by points: if/else 12 (24 pts), match/switch 3 (6 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.
AzureBlobStorage::time_travel_recover (cognitive 32) libs/remote_storage/src/azure_blob.rs:940— AzureBlobStorage::time_travel_recover has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 4 (10 pts), loops 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.
S3Bucket::time_travel_recover (cognitive 32) libs/remote_storage/src/s3_bucket.rs:978— S3Bucket::time_travel_recover has cognitive complexity 32 (threshold 15). Drivers by points: if/else 10 (20 pts), match/switch 4 (10 pts), loops 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.
S3Bucket::list_streaming (cognitive 23) libs/remote_storage/src/s3_bucket.rs:607— S3Bucket::list_streaming has cognitive complexity 23 (threshold 15). Drivers by points: if/else 4 (11 pts), match/switch 4 (9 pts), loops 2 (3 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DiskBtreeReader::visit (cognitive 31) pageserver/src/tenant/disk_btree.rs:376— DiskBtreeReader::visit has cognitive complexity 31 (threshold 15). Drivers by points: if/else 10 (22 pts), match/switch 2 (6 pts), loops 2 (3 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.
DiskBtreeReader::into_stream (cognitive 18) pageserver/src/tenant/disk_btree.rs:283— DiskBtreeReader::into_stream has cognitive complexity 18 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (3 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Scheduler::consistency_check (cognitive 31) storage_controller/src/scheduler.rs:447— Scheduler::consistency_check has cognitive complexity 31 (threshold 15). Drivers by points: if/else 7 (18 pts), loops 5 (7 pts), match/switch 2 (6 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.
Scheduler::update_node_ref_counts (cognitive 17) storage_controller/src/scheduler.rs:535— Scheduler::update_node_ref_counts has cognitive complexity 17 (threshold 15). Drivers by points: if/else 8 (15 pts), match/switch 2 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
pageserver_compaction::identify_levels::identify_level (cognitive 26) pageserver/compaction/src/identify_levels.rs:48— pageserver_compaction::identify_levels::identify_level has cognitive complexity 26 (threshold 15). Drivers by points: if/else 10 (20 pts), boolean chains 4, 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.
pageserver_compaction::simulator::draw::draw_history (cognitive 17) pageserver/compaction/src/simulator/draw.rs:91— pageserver_compaction::simulator::draw::draw_history has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), loops 4, boolean chains 2, match/switch 1 (2 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeyHistoryRetention::pipe_to (cognitive 26) pageserver/src/tenant/timeline/compaction.rs:899— KeyHistoryRetention::pipe_to has cognitive complexity 26 (threshold 15). Drivers by points: if/else 7 (16 pts), loops 4 (9 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.
KeyHistoryRetention::verify (cognitive 17) pageserver/src/tenant/timeline/compaction.rs:945— KeyHistoryRetention::verify has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (7 pts), match/switch 2 (5 pts), loops 3 (4 pts), boolean chains 1 (nesting depth added 6). Of this number, 13 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalFs::list (cognitive 25) libs/remote_storage/src/local_fs.rs:343— LocalFs::list has cognitive complexity 25 (threshold 15). Drivers by points: if/else 11 (20 pts), loops 2 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalFs::list_recursive (cognitive 17) libs/remote_storage/src/local_fs.rs:146— LocalFs::list_recursive has cognitive complexity 17 (threshold 15). Drivers by points: if/else 4 (10 pts), loops 3 (4 pts), match/switch 2 (3 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ImageLayerInner::do_reads_and_update_state (cognitive 25) pageserver/src/tenant/storage_layer/image_layer.rs:587— ImageLayerInner::do_reads_and_update_state has cognitive complexity 25 (threshold 15). Drivers by points: if/else 4 (9 pts), loops 4 (9 pts), match/switch 2 (6 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.
ImageLayerInner::plan_reads (cognitive 18) pageserver/src/tenant/storage_layer/image_layer.rs:479— ImageLayerInner::plan_reads has cognitive complexity 18 (threshold 15). Drivers by points: if/else 7 (15 pts), loops 2 (3 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ComputeNode::start_compute (cognitive 21) compute_tools/src/compute.rs:793— ComputeNode::start_compute has cognitive complexity 21 (threshold 15). Drivers by points: if/else 15 (18 pts), boolean chains 1, loops 1, 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.
ComputeNode::prepare_preload_libraries (cognitive 16) compute_tools/src/compute.rs:2602— ComputeNode::prepare_preload_libraries has cognitive complexity 16 (threshold 15). Drivers by points: if/else 5 (8 pts), loops 3 (4 pts), boolean chains 2, match/switch 1 (2 pts) (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
PageServerHandler::pagestream_handle_batched_message (cognitive 21) pageserver/src/page_service.rs:1401— PageServerHandler::pagestream_handle_batched_message has cognitive complexity 21 (threshold 15). Drivers by points: match/switch 5 (11 pts), if/else 4 (8 pts), loops 2 (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.
PageServerHandler::pagestream_read_message (cognitive 18) pageserver/src/page_service.rs:965— PageServerHandler::pagestream_read_message has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 7 (12 pts), if/else 4 (6 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.
DeltaLayerInner::copy_prefix (cognitive 21) pageserver/src/tenant/storage_layer/delta_layer.rs:1147— DeltaLayerInner::copy_prefix has cognitive complexity 21 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (6 pts), match/switch 2 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
DeltaLayerInner::plan_reads (cognitive 16) pageserver/src/tenant/storage_layer/delta_layer.rs:911— DeltaLayerInner::plan_reads has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
storage_controller::async_main (cognitive 21) storage_controller/src/main.rs:348— storage_controller::async_main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 10 (11 pts), match/switch 8 (9 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.
storage_controller::service::safekeeper_reconciler::load_schedule_requests (cognitive 20) storage_controller/src/service/safekeeper_reconciler.rs:91— storage_controller::service::safekeeper_reconciler::load_schedule_requests has cognitive complexity 20 (threshold 15). Drivers by points: if/else 7 (17 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change-coupling hub: mod.rs → hacks.rs, flow.rs, handshake.rs, passthrough.rs, protocol2.rs, limiter.rs, mod.rs proxy/src/proxy/mod.rs— `proxy/src/proxy/mod.rs` changes together with 7 other files — `proxy/src/auth/backend/hacks.rs`, `proxy/src/auth/flow.rs`, `proxy/src/pglb/handshake.rs`, `proxy/src/pglb/passthrough.rs`, `proxy/src/protocol2.rs`, `proxy/src/rate_limiter/limiter.rs`, `proxy/src/serverless/mod.rs` — none of which declares a dependency on it: one file is the hub of 7 separate couplings, not 7 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 7.
Change-coupling hub: config.rs → local_proxy.rs, proxy.rs, limiter.rs proxy/src/config.rs— `proxy/src/config.rs` changes together with 3 other files — `proxy/src/bin/local_proxy.rs`, `proxy/src/bin/proxy.rs`, `proxy/src/rate_limiter/limiter.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 (21–22 lines × 2) pageserver/src/tenant/storage_layer/layer_name.rs:69— pageserver/src/tenant/storage_layer/layer_name.rs:69-90 | pageserver/src/tenant/storage_layer/layer_name.rs:180-200 — both copies are in the same file, so extract the block into 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–22 lines × 2) storage_controller/src/service/safekeeper_service.rs:1166— storage_controller/src/service/safekeeper_service.rs:1166-1187 | storage_controller/src/service/safekeeper_service.rs:1634-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 (18 lines × 2) libs/remote_storage/src/gcs_bucket.rs:495— libs/remote_storage/src/gcs_bucket.rs:495-512 | libs/remote_storage/src/s3_bucket.rs:365-382 — before extracting anything, compare `libs/remote_storage/src/gcs_bucket.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) libs/remote_storage/src/gcs_bucket.rs:603— libs/remote_storage/src/gcs_bucket.rs:603-620 | libs/remote_storage/src/gcs_bucket.rs:704-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–15 lines × 2) control_plane/storcon_cli/src/main.rs:800— control_plane/storcon_cli/src/main.rs:800-813 | control_plane/storcon_cli/src/main.rs:883-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 (14–15 lines × 2) pageserver/src/disk_usage_eviction_task.rs:953— pageserver/src/disk_usage_eviction_task.rs:953-966 | pageserver/src/disk_usage_eviction_task.rs:1022-1036 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–15 lines × 2) pageserver/client/src/mgmt_api.rs:227— pageserver/client/src/mgmt_api.rs:227-238 | pageserver/client/src/mgmt_api.rs:472-486 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–15 lines × 2) storage_controller/src/http.rs:1468— storage_controller/src/http.rs:1468-1479 | storage_controller/src/http.rs:1485-1499 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 2) pageserver/src/tenant/layer_map.rs:499— pageserver/src/tenant/layer_map.rs:499-512 | pageserver/src/tenant/layer_map.rs:528-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 (12–14 lines × 2) proxy/src/serverless/conn_pool_lib.rs:652— proxy/src/serverless/conn_pool_lib.rs:652-665 | proxy/src/serverless/http_conn_pool.rs:274-285 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) pageserver/src/http/routes.rs:2328— pageserver/src/http/routes.rs:2328-2340 | pageserver/src/http/routes.rs:2501-2512 — both copies are in the same file, so extract the block into 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) storage_controller/src/service.rs:6745— storage_controller/src/service.rs:6745-6757 | storage_controller/src/service.rs:6903-6914 — both copies are in the same file, so extract the block into 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 × 3) libs/pageserver_api/src/models.rs:859— libs/pageserver_api/src/models.rs:859-870 | libs/pageserver_api/src/models.rs:890-899 | libs/pageserver_api/src/models.rs:904-917 — 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) safekeeper/src/control_file_upgrade.rs:346— safekeeper/src/control_file_upgrade.rs:346-355 | safekeeper/src/control_file_upgrade.rs:372-381 | safekeeper/src/control_file_upgrade.rs:398-407 — 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–10 lines × 2) control_plane/src/bin/neon_local.rs:1799— control_plane/src/bin/neon_local.rs:1799-1807 | control_plane/src/bin/neon_local.rs:1811-1820 — both copies are in the same file, so extract the block into 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) proxy/src/proxy/connect_compute.rs:119— proxy/src/proxy/connect_compute.rs:119-127 | proxy/src/proxy/connect_compute.rs:163-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 (8 lines × 4) pageserver/client/src/mgmt_api.rs:721— pageserver/client/src/mgmt_api.rs:721-728 | pageserver/client/src/mgmt_api.rs:745-752 | pageserver/client/src/mgmt_api.rs:769-776 | pageserver/client/src/mgmt_api.rs:798-805 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (8 lines × 4) safekeeper/src/http/routes.rs:171— safekeeper/src/http/routes.rs:171-178 | safekeeper/src/http/routes.rs:275-282 | safekeeper/src/http/routes.rs:372-379 | safekeeper/src/http/routes.rs:514-521 — 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.
storcon_cli::main (cyclomatic 80) control_plane/storcon_cli/src/main.rs:443— storcon_cli::main has cyclomatic complexity 80 (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.
StorageController::start (cyclomatic 42) control_plane/src/storage_controller.rs:348— StorageController::start has cyclomatic complexity 42 (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.
RemoteTimelineClient::perform_upload_task (cyclomatic 42) pageserver/src/tenant/remote_timeline_client.rs:2100— RemoteTimelineClient::perform_upload_task 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.
BeMessage::write (cyclomatic 37) libs/pq_proto/src/lib.rs:763— BeMessage::write has cyclomatic complexity 37 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
postgres_ffi::walrecord::decode_wal_record (cyclomatic 29) libs/postgres_ffi/src/walrecord.rs:246— postgres_ffi::walrecord::decode_wal_record 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.
control_plane::bin::neon_local::handle_endpoint (cyclomatic 27) control_plane/src/bin/neon_local.rs:1319— control_plane::bin::neon_local::handle_endpoint 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.
storage_controller::async_main (cyclomatic 27) storage_controller/src/main.rs:348— storage_controller::async_main has cyclomatic complexity 27 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
pagebench::cmd::getpage_latest_lsn::main_impl (cyclomatic 24) pageserver/pagebench/src/cmd/getpage_latest_lsn.rs:156— pagebench::cmd::getpage_latest_lsn::main_impl has cyclomatic complexity 24 (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.
Basebackup::send_tarball (cyclomatic 24) pageserver/src/basebackup.rs:335— Basebackup::send_tarball 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.
InterpretedWalReader::run_impl (cyclomatic 24) safekeeper/src/send_interpreted_wal.rs:400— InterpretedWalReader::run_impl has cyclomatic complexity 24 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
WalIngest::ingest_record (cyclomatic 23) pageserver/src/walingest.rs:234— WalIngest::ingest_record 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.
Reconciler::reconcile (cyclomatic 23) storage_controller/src/reconciler.rs:836— Reconciler::reconcile 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.
ComputeMonitor::check (cyclomatic 21) compute_tools/src/monitor.rs:206— ComputeMonitor::check 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.
Endpoint::start (cyclomatic 21) control_plane/src/endpoint.rs:702— Endpoint::start 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.
Server::serve (cyclomatic 21) libs/http-utils/src/server.rs:66— Server::serve has cyclomatic complexity 21 (threshold 15). Of this number, 17 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AzureBlobStorage::list_streaming_for_fn (cyclomatic 20) libs/remote_storage/src/azure_blob.rs:272— AzureBlobStorage::list_streaming_for_fn 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.
Validator::validate (cyclomatic 20) pageserver/src/deletion_queue/validator.rs:111— Validator::validate 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.
SafekeeperPostgresHandler::startup (cyclomatic 20) safekeeper/src/handler.rs:148— SafekeeperPostgresHandler::startup 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.
force_layer_download.main_impl (cyclomatic 19) scripts/force_layer_download.py:184— force_layer_download.main_impl has cyclomatic complexity 19 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ComputeNode::start_compute (cyclomatic 18) compute_tools/src/compute.rs:793— ComputeNode::start_compute has cyclomatic complexity 18 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StorageModel::size_here (cyclomatic 18) libs/tenant_size_model/src/calculation.rs:107— StorageModel::size_here 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.
ListWriter::background (cyclomatic 18) pageserver/src/deletion_queue/list_writer.rs:347— ListWriter::background 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.
ConnectionManagerState::next_connection_candidate (cyclomatic 18) pageserver/src/tenant/timeline/walreceiver/connection_manager.rs:804— ConnectionManagerState::next_connection_candidate 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.
EventFormatter::format (cyclomatic 18) proxy/src/logging.rs:531— EventFormatter::format 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.
tokio_postgres2::connect_raw::authenticate_sasl (cyclomatic 17) libs/proxy/tokio-postgres2/src/connect_raw.rs:188— tokio_postgres2::connect_raw::authenticate_sasl 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.
ProposerAcceptorMessage::parse (cyclomatic 17) safekeeper/src/safekeeper.rs:487— ProposerAcceptorMessage::parse 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.
WalStreamDecoder::poll_decode_internal (cyclomatic 16) libs/postgres_ffi/src/waldecoder_handler.rs:99— WalStreamDecoder::poll_decode_internal has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
postgres_protocol2::escape::escape_internal (cyclomatic 16) libs/proxy/postgres-protocol2/src/escape/mod.rs:34— postgres_protocol2::escape::escape_internal has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
pageserver_compaction::identify_levels::identify_level (cyclomatic 16) pageserver/compaction/src/identify_levels.rs:48— pageserver_compaction::identify_levels::identify_level 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.
PageServerHandler::pagestream_read_message (cyclomatic 16) pageserver/src/page_service.rs:965— PageServerHandler::pagestream_read_message 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.
LayerMap::select_layer (cyclomatic 16) pageserver/src/tenant/layer_map.rs:473— LayerMap::select_layer 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.
Scheduler::update_node_ref_counts (cyclomatic 16) storage_controller/src/scheduler.rs:535— Scheduler::update_node_ref_counts 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.
storcon_cli::main (cognitive 99) control_plane/storcon_cli/src/main.rs:443— storcon_cli::main has cognitive complexity 99 (threshold 15). Drivers by points: if/else 25 (55 pts), loops 13 (27 pts), match/switch 7 (16 pts), boolean chains 1 (nesting depth added 53). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RemoteTimelineClient::perform_upload_task (cognitive 99) pageserver/src/tenant/remote_timeline_client.rs:2100— RemoteTimelineClient::perform_upload_task has cognitive complexity 99 (threshold 15). Drivers by points: if/else 28 (75 pts), loops 4 (12 pts), match/switch 6 (10 pts), boolean chains 2 (nesting depth added 59). 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.
InterpretedWalReader::run_impl (cognitive 82) safekeeper/src/send_interpreted_wal.rs:400— InterpretedWalReader::run_impl has cognitive complexity 82 (threshold 15). Drivers by points: if/else 12 (40 pts), loops 7 (23 pts), match/switch 6 (18 pts), boolean chains 1 (nesting depth added 56). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Server::serve (cognitive 58) libs/http-utils/src/server.rs:66— Server::serve has cognitive complexity 58 (threshold 15). Drivers by points: if/else 10 (36 pts), match/switch 5 (16 pts), loops 2 (4 pts), boolean chains 2 (nesting depth added 39). Of this number, 54 points are the body's own statements and 4 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageController::start (cognitive 52) control_plane/src/storage_controller.rs:348— StorageController::start has cognitive complexity 52 (threshold 15). Drivers by points: if/else 34 (42 pts), match/switch 4 (6 pts), boolean chains 2, loops 1 (2 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, 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.
WalSendersShared::update_reply_feedback (cognitive 51) safekeeper/src/send_wal.rs:356— WalSendersShared::update_reply_feedback has cognitive complexity 51 (threshold 15). Drivers by points: if/else 19 (50 pts), loops 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.
ConnectionManagerState::next_connection_candidate (cognitive 43) pageserver/src/tenant/timeline/walreceiver/connection_manager.rs:804— ConnectionManagerState::next_connection_candidate has cognitive complexity 43 (threshold 15). Drivers by points: if/else 14 (35 pts), match/switch 3 (6 pts), boolean chains 2 (nesting depth added 24). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
FlushBackgroundTask::run (cognitive 41) pageserver/src/virtual_file/owned_buffers_io/write/flush.rs:286— FlushBackgroundTask::run has cognitive complexity 41 (threshold 15). Drivers by points: if/else 8 (27 pts), match/switch 4 (11 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.
Runner::run (cognitive 40) libs/vm_monitor/src/runner.rs:395— Runner::run has cognitive complexity 40 (threshold 15). Drivers by points: if/else 7 (20 pts), match/switch 5 (19 pts), loops 1 (nesting depth added 27). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SafekeeperPostgresHandler::startup (cognitive 38) safekeeper/src/handler.rs:148— SafekeeperPostgresHandler::startup has cognitive complexity 38 (threshold 15). Drivers by points: if/else 9 (23 pts), match/switch 3 (11 pts), loops 1 (3 pts), boolean chains 1 (nesting depth added 24). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
WalStreamDecoder::poll_decode_internal (cognitive 37) libs/postgres_ffi/src/waldecoder_handler.rs:99— WalStreamDecoder::poll_decode_internal has cognitive complexity 37 (threshold 15). Drivers by points: if/else 10 (28 pts), match/switch 3 (7 pts), boolean chains 1, loops 1 (nesting depth added 22). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageModel::size_here (cognitive 37) libs/tenant_size_model/src/calculation.rs:107— StorageModel::size_here has cognitive complexity 37 (threshold 15). Drivers by points: if/else 21 (29 pts), loops 4 (7 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.
IoConcurrency::spawn (cognitive 36) pageserver/src/tenant/storage_layer.rs:378— IoConcurrency::spawn has cognitive complexity 36 (threshold 15). Drivers by points: if/else 6 (18 pts), match/switch 4 (12 pts), loops 2 (6 pts) (nesting depth added 24). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
Endpoint::start (cognitive 32) control_plane/src/endpoint.rs:702— Endpoint::start has cognitive complexity 32 (threshold 15). Drivers by points: if/else 18 (25 pts), match/switch 2 (5 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.
force_layer_download.main_impl (cognitive 31) scripts/force_layer_download.py:184— force_layer_download.main_impl has cognitive complexity 31 (threshold 15). Drivers by points: loops 9 (16 pts), if/else 9 (13 pts), error handling 1 (2 pts) (nesting depth added 12). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SerializedValueBatch::from_decoded_filtered (cognitive 29) libs/wal_decoder/src/serialized_batch.rs:138— SerializedValueBatch::from_decoded_filtered has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (22 pts), loops 4 (6 pts), boolean chains 1 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UploadQueueInitialized::next_ready (cognitive 29) pageserver/src/tenant/upload_queue.rs:140— UploadQueueInitialized::next_ready has cognitive complexity 29 (threshold 15). Drivers by points: if/else 8 (23 pts), loops 2 (5 pts), boolean chains 1 (nesting depth added 18). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatchQueue::call (cognitive 29) proxy/src/batch.rs:69— BatchQueue::call has cognitive complexity 29 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 3 (7 pts), match/switch 3 (6 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.
FeatureResolver::spawn (cognitive 27) pageserver/src/feature_resolver.rs:46— FeatureResolver::spawn has cognitive complexity 27 (threshold 15). Drivers by points: if/else 6 (15 pts), match/switch 4 (10 pts), loops 1 (2 pts) (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
EventFormatter::format (cognitive 26) proxy/src/logging.rs:531— EventFormatter::format has cognitive complexity 26 (threshold 15). Drivers by points: if/else 13 (19 pts), loops 3 (5 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.
LevelCompactionState::retile_deltas (cognitive 24) pageserver/compaction/src/compact_tiered.rs:517— LevelCompactionState::retile_deltas has cognitive complexity 24 (threshold 15). Drivers by points: loops 8 (15 pts), if/else 3 (6 pts), match/switch 1 (2 pts), boolean chains 1 (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.
BatchedFeMessage::should_break_batch (cognitive 24) pageserver/src/page_service.rs:799— BatchedFeMessage::should_break_batch has cognitive complexity 24 (threshold 15). Drivers by points: if/else 8 (20 pts), match/switch 2 (3 pts), boolean chains 1 (nesting depth added 13). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ProposerAcceptorMessage::parse (cognitive 24) safekeeper/src/safekeeper.rs:487— ProposerAcceptorMessage::parse has cognitive complexity 24 (threshold 15). Drivers by points: if/else 9 (20 pts), match/switch 2 (4 pts) (nesting depth added 13). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TenantBackgroundJobs::run (cognitive 23) pageserver/src/tenant/secondary/scheduler.rs:158— TenantBackgroundJobs::run has cognitive complexity 23 (threshold 15). Drivers by points: match/switch 3 (10 pts), loops 3 (7 pts), if/else 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.
CopyBuffer::poll_copy (cognitive 23) proxy/src/pglb/copy_bidirectional.rs:193— CopyBuffer::poll_copy has cognitive complexity 23 (threshold 15). Drivers by points: if/else 5 (16 pts), loops 2 (3 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 14). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
postgres_protocol2::escape::escape_internal (cognitive 21) libs/proxy/postgres-protocol2/src/escape/mod.rs:34— postgres_protocol2::escape::escape_internal has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (12 pts), boolean chains 6, loops 2 (3 pts) (nesting depth added 4). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlockCursor::read_blob_into_buf (cognitive 21) pageserver/src/tenant/blob_io.rs:129— BlockCursor::read_blob_into_buf has cognitive complexity 21 (threshold 15). Drivers by points: if/else 14 (19 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.
Manager::handle_message (cognitive 21) safekeeper/src/timeline_manager.rs:713— Manager::handle_message has cognitive complexity 21 (threshold 15). Drivers by points: if/else 9 (16 pts), match/switch 3 (5 pts) (nesting depth added 9). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
proxy_bench_results_ingest.main (cognitive 21) scripts/proxy_bench_results_ingest.py:113— proxy_bench_results_ingest.main has cognitive complexity 21 (threshold 15). Drivers by points: if/else 3 (8 pts), loops 3 (7 pts), ternaries 1 (5 pts), error handling 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.
LocalEnv::init (cognitive 20) control_plane/src/local_env.rs:865— LocalEnv::init has cognitive complexity 20 (threshold 15). Drivers by points: if/else 8 (13 pts), loops 3 (5 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.
KeySpace::remove_overlapping_with (cognitive 20) libs/pageserver_api/src/keyspace.rs:351— KeySpace::remove_overlapping_with has cognitive complexity 20 (threshold 15). Drivers by points: if/else 4 (12 pts), boolean chains 4, loops 2 (3 pts), match/switch 1 (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Level::depth (cognitive 20) pageserver/compaction/src/identify_levels.rs:179— Level::depth has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (14 pts), loops 3 (5 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.
WalAcceptor::run (cognitive 20) safekeeper/src/receive_wal.rs:562— WalAcceptor::run has cognitive complexity 20 (threshold 15). Drivers by points: if/else 6 (15 pts), boolean chains 2, match/switch 1 (2 pts), loops 1 (nesting depth added 10). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ParsedSpec::try_from (cognitive 19) compute_tools/src/compute.rs:307— ParsedSpec::try_from has cognitive complexity 19 (threshold 15). Drivers by points: if/else 14 (19 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.
VirtualConnection::process (cognitive 19) libs/desim/src/network.rs:193— VirtualConnection::process has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (14 pts), loops 3 (5 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.
BeMessage::write (cognitive 19) libs/pq_proto/src/lib.rs:763— BeMessage::write has cognitive complexity 19 (threshold 15). Drivers by points: loops 4 (9 pts), if/else 4 (7 pts), match/switch 2 (3 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.
Deleter::background (cognitive 19) pageserver/src/deletion_queue/deleter.rs:127— Deleter::background has cognitive complexity 19 (threshold 15). Drivers by points: loops 3 (8 pts), if/else 2 (6 pts), match/switch 2 (4 pts), boolean chains 1 (nesting depth added 11). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AcceptorProposerMessage::serialize (cognitive 19) safekeeper/src/safekeeper.rs:780— AcceptorProposerMessage::serialize has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (9 pts), loops 2 (6 pts), match/switch 2 (4 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.
ComputeHookTenant::notify_local (cognitive 19) storage_controller/src/compute_hook.rs:496— ComputeHookTenant::notify_local has cognitive complexity 19 (threshold 15). Drivers by points: if/else 5 (11 pts), loops 2 (4 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.
ShardedRange::fragment (cognitive 18) libs/pageserver_api/src/keyspace.rs:87— ShardedRange::fragment has cognitive complexity 18 (threshold 15). Drivers by points: if/else 10 (15 pts), 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.
storage_broker::bin::storage_broker::main (cognitive 18) storage_broker/src/bin/storage_broker.rs:668— storage_broker::bin::storage_broker::main has cognitive complexity 18 (threshold 15). Drivers by points: match/switch 5 (9 pts), if/else 5 (8 pts), loops 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.
SafekeeperReconcilerInner::reconcile_one (cognitive 18) storage_controller/src/service/safekeeper_reconciler.rs:340— SafekeeperReconcilerInner::reconcile_one has cognitive complexity 18 (threshold 15). Drivers by points: if/else 9 (17 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.
BackgroundTask::cleanup (cognitive 17) pageserver/src/basebackup_cache.rs:308— BackgroundTask::cleanup has cognitive complexity 17 (threshold 15). Drivers by points: if/else 5 (13 pts), loops 3 (4 pts) (nesting depth added 9). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlobWriter::write_blob_maybe_compressed (cognitive 17) pageserver/src/tenant/blob_io.rs:310— BlobWriter::write_blob_maybe_compressed has cognitive complexity 17 (threshold 15). Drivers by points: if/else 9 (14 pts), match/switch 2 (3 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BatchLayerWriter::finish_with_discard_fn (cognitive 17) pageserver/src/tenant/storage_layer/batch_split_writer.rs:114— BatchLayerWriter::finish_with_discard_fn has cognitive complexity 17 (threshold 15). Drivers by points: match/switch 3 (10 pts), if/else 3 (5 pts), loops 2 (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.
desim::executor::epoll_chans (cognitive 16) libs/desim/src/executor.rs:449— desim::executor::epoll_chans has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (11 pts), loops 3 (5 pts) (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
tokio_postgres2::connect_raw::authenticate_sasl (cognitive 16) libs/proxy/tokio-postgres2/src/connect_raw.rs:188— tokio_postgres2::connect_raw::authenticate_sasl has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (8 pts), if/else 7, loops 1 (nesting depth added 3). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
MergeDeltaKeys::poll_next (cognitive 16) pageserver/compaction/src/helpers.rs:198— MergeDeltaKeys::poll_next has cognitive complexity 16 (threshold 15). Drivers by points: if/else 4 (9 pts), match/switch 2 (6 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.
BaseBackupCmd::parse (cognitive 16) pageserver/src/page_service.rs:2918— BaseBackupCmd::parse has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (13 pts), 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.
TenantDownloader::layer_action (cognitive 16) pageserver/src/tenant/secondary/downloader.rs:1145— TenantDownloader::layer_action has cognitive complexity 16 (threshold 15). Drivers by points: if/else 8 (12 pts), match/switch 1 (3 pts), boolean chains 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
InMemoryLayer::get_values_reconstruct_data (cognitive 16) pageserver/src/tenant/storage_layer/inmemory_layer.rs:409— InMemoryLayer::get_values_reconstruct_data has cognitive complexity 16 (threshold 15). Drivers by points: loops 5 (9 pts), if/else 1 (4 pts), match/switch 1 (3 pts) (nesting depth added 9). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
PostgresRedoManager::do_with_walredo_process (cognitive 16) pageserver/src/walredo.rs:352— PostgresRedoManager::do_with_walredo_process has cognitive complexity 16 (threshold 15). Drivers by points: match/switch 5 (10 pts), if/else 3 (6 pts) (nesting depth added 8). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
WalSenders::create_or_update_interpreted_reader (cognitive 16) safekeeper/src/send_wal.rs:90— WalSenders::create_or_update_interpreted_reader has cognitive complexity 16 (threshold 15). Drivers by points: if/else 3 (9 pts), match/switch 3 (6 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.
WalBackupTask::run (cognitive 16) safekeeper/src/wal_backup.rs:330— WalBackupTask::run has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (13 pts), match/switch 1 (2 pts), loops 1 (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TooManyFunctions: walproposer::api_bindings libs/walproposer/src/api_bindings.rs:15— TooManyFunctions — 37 free functions. The bar is 30 free functions; 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.
D30 · Dependency Vulnerabilities· Medium advisory (notice) · ×1
Near-duplicate member pair (49 shared lines) libs/remote_storage/src/gcs_bucket.rs:597— libs/remote_storage/src/gcs_bucket.rs:597-676 | libs/remote_storage/src/gcs_bucket.rs:690-857 — These two members are variants of one another: 49 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 (46 shared lines) storage_controller/src/heartbeater.rs:175— storage_controller/src/heartbeater.rs:175-317 | storage_controller/src/heartbeater.rs:324-447 — These two members are variants of one another: 46 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
Near-duplicate member pair (35 shared lines) proxy/src/console_redirect_proxy.rs:161— proxy/src/console_redirect_proxy.rs:161-277 | proxy/src/pglb/mod.rs:248-333 — These two members are variants of one another: 35 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Edited copy of a member (24 corresponding lines) · ×1
Edited copy of a member (24 corresponding lines) storage_scrubber/src/cloud_admin_api.rs:456— storage_scrubber/src/cloud_admin_api.rs:456-482 | storage_scrubber/src/cloud_admin_api.rs:488-521 — These two members are one piece of code written twice and then edited apart: 24 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Edited copy of a member (23 corresponding lines) · ×1
Edited copy of a member (23 corresponding lines) pageserver/src/tenant/storage_layer/layer_name.rs:66— pageserver/src/tenant/storage_layer/layer_name.rs:66-107 | pageserver/src/tenant/storage_layer/layer_name.rs:178-206 — These two members are one piece of code written twice and then edited apart: 23 consecutive lines correspond almost exactly, broken only by small local edits. Most of that correspondence is NOT reported as duplicated blocks below — the edits cut it into fragments and only the largest of them clear the block floor, so the rows below understate it. The repair is at the members' grain — factor the shared implementation into one the two call with their differences as parameters or as an injected step, or, where the difference is systematic (an extra return value, one transport against another), generate one from the other. Left alone, the next edit has to be made twice and the two will drift further apart.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (10 members, 50+ identical tokens) storage_controller/src/http.rs:974— storage_controller/src/http.rs:974-987 | storage_controller/src/http.rs:989-1005 | storage_controller/src/http.rs:1025-1041 | storage_controller/src/http.rs:1075-1091 | storage_controller/src/http.rs:1124-1141 | storage_controller/src/http.rs:1143-1159 | storage_controller/src/http.rs:1161-1177 | storage_controller/src/http.rs:1179-1195 | storage_controller/src/http.rs:1197-1213 | storage_controller/src/http.rs:1215-1231 — These 10 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 10 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 10 times.
Duplicated block (43 lines × 2) proxy/src/serverless/rest.rs:557— proxy/src/serverless/rest.rs:557-599 | proxy/src/serverless/sql_over_http.rs:93-135 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (34 lines × 2) pageserver/src/tenant/storage_layer/delta_layer.rs:819— pageserver/src/tenant/storage_layer/delta_layer.rs:819-852 | pageserver/src/tenant/storage_layer/image_layer.rs:406-439 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (33 lines × 2) pageserver/src/consumption_metrics/upload.rs:149— pageserver/src/consumption_metrics/upload.rs:149-181 | pageserver/src/consumption_metrics/upload.rs:229-261 — both copies are in the same file, so extract the block into 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) pageserver/src/tenant/storage_layer/delta_layer.rs:981— pageserver/src/tenant/storage_layer/delta_layer.rs:981-1010 | pageserver/src/tenant/storage_layer/image_layer.rs:607-637 — before extracting anything, compare `pageserver/src/tenant/storage_layer/delta_layer.rs` and `pageserver/src/tenant/storage_layer/image_layer.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 199 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (30 lines × 2) pageserver/src/tenant/timeline.rs:1248— pageserver/src/tenant/timeline.rs:1248-1277 | pageserver/src/tenant/timeline.rs:1299-1328 — both copies are in the same file, so extract the block into 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) proxy/src/binary/proxy.rs:784— proxy/src/binary/proxy.rs:784-812 | proxy/src/binary/proxy.rs:862-890 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23–24 lines × 2) libs/remote_storage/src/azure_blob.rs:979— libs/remote_storage/src/azure_blob.rs:979-1001 | libs/remote_storage/src/s3_bucket.rs:1011-1034 — before extracting anything, compare `libs/remote_storage/src/azure_blob.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 6 separate duplicated blocks between them, totalling at least 85 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (24 lines × 2) storage_controller/src/heartbeater.rs:294— storage_controller/src/heartbeater.rs:294-317 | storage_controller/src/heartbeater.rs:424-447 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (22 lines × 3) libs/remote_storage/src/azure_blob.rs:962— libs/remote_storage/src/azure_blob.rs:962-983 | libs/remote_storage/src/gcs_bucket.rs:1206-1227 | libs/remote_storage/src/s3_bucket.rs:994-1015 — before extracting anything, compare `libs/remote_storage/src/azure_blob.rs` and `libs/remote_storage/src/gcs_bucket.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 2) storage_scrubber/src/cloud_admin_api.rs:457— storage_scrubber/src/cloud_admin_api.rs:457-478 | storage_scrubber/src/cloud_admin_api.rs:489-510 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–20 lines × 2) control_plane/src/branch_mappings.rs:35— control_plane/src/branch_mappings.rs:35-49 | control_plane/src/local_env.rs:603-622 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (20 lines × 2) pageserver/src/consumption_metrics/upload.rs:198— pageserver/src/consumption_metrics/upload.rs:198-217 | pageserver/src/consumption_metrics/upload.rs:278-297 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (16–19 lines × 2) pageserver/pagebench/src/cmd/basebackup.rs:87— pageserver/pagebench/src/cmd/basebackup.rs:87-102 | pageserver/pagebench/src/cmd/trigger_initial_size_calculation.rs:40-58 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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–19 lines × 2) pageserver/src/http/routes.rs:724— pageserver/src/http/routes.rs:724-741 | pageserver/src/http/routes.rs:775-793 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (15–19 lines × 2) proxy/src/serverless/conn_pool_lib.rs:534— proxy/src/serverless/conn_pool_lib.rs:534-548 | proxy/src/serverless/local_conn_pool.rs:118-136 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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–18 lines × 2) pageserver/src/walredo/apply_neon.rs:82— pageserver/src/walredo/apply_neon.rs:82-99 | pageserver/src/walredo/apply_neon.rs:102-116 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (17–18 lines × 2) storage_controller/src/service.rs:7399— storage_controller/src/service.rs:7399-7415 | storage_controller/src/service.rs:7585-7602 — both copies are in the same file, so extract the block into 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–18 lines × 2) storage_controller/src/service/safekeeper_service.rs:1368— storage_controller/src/service/safekeeper_service.rs:1368-1381 | storage_controller/src/service/safekeeper_service.rs:1681-1698 — both copies are in the same file, so extract the block into 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) libs/remote_storage/src/gcs_bucket.rs:1081— libs/remote_storage/src/gcs_bucket.rs:1081-1095 | libs/remote_storage/src/s3_bucket.rs:911-927 — before extracting anything, compare `libs/remote_storage/src/gcs_bucket.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) libs/pageserver_api/src/models.rs:835— libs/pageserver_api/src/models.rs:835-849 | libs/pageserver_api/src/models.rs:864-879 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12–14 lines × 4) libs/pageserver_api/src/models.rs:842— libs/pageserver_api/src/models.rs:842-853 | libs/pageserver_api/src/models.rs:885-896 | libs/pageserver_api/src/models.rs:898-911 | libs/pageserver_api/src/models.rs:916-927 — 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–14 lines × 4) pageserver/src/http/routes.rs:835— pageserver/src/http/routes.rs:835-848 | pageserver/src/http/routes.rs:2282-2289 | pageserver/src/http/routes.rs:2302-2309 | pageserver/src/http/routes.rs:2448-2457 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (13–14 lines × 2) libs/pageserver_api/src/models.rs:856— libs/pageserver_api/src/models.rs:856-868 | libs/pageserver_api/src/models.rs:902-915 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–13 lines × 2) pageserver/src/page_service.rs:819— pageserver/src/page_service.rs:819-831 | pageserver/src/page_service.rs:889-899 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (11–12 lines × 4) libs/remote_storage/src/gcs_bucket.rs:150— libs/remote_storage/src/gcs_bucket.rs:150-161 | libs/remote_storage/src/gcs_bucket.rs:171-181 | libs/remote_storage/src/s3_bucket.rs:205-216 | libs/remote_storage/src/s3_bucket.rs:226-236 — before extracting anything, compare `libs/remote_storage/src/gcs_bucket.rs` and `libs/remote_storage/src/s3_bucket.rs` as WHOLE FILES: this scan already matched 13 separate duplicated blocks between them, totalling at least 191 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) libs/remote_storage/src/azure_blob.rs:560— libs/remote_storage/src/azure_blob.rs:560-571 | libs/remote_storage/src/gcs_bucket.rs:1116-1127 | libs/remote_storage/src/s3_bucket.rs:864-875 — before extracting anything, compare `libs/remote_storage/src/azure_blob.rs` and `libs/remote_storage/src/gcs_bucket.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (9–12 lines × 2) libs/remote_storage/src/azure_blob.rs:855— libs/remote_storage/src/azure_blob.rs:855-863 | libs/remote_storage/src/gcs_bucket.rs:381-392 — before extracting anything, compare `libs/remote_storage/src/azure_blob.rs` and `libs/remote_storage/src/gcs_bucket.rs` as WHOLE FILES: this scan already matched 4 separate duplicated blocks between them, totalling at least 55 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (10–12 lines × 2) pageserver/src/tenant/layer_map.rs:872— pageserver/src/tenant/layer_map.rs:872-881 | pageserver/src/tenant/layer_map.rs:894-905 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10–11 lines × 3) storage_controller/src/http.rs:558— storage_controller/src/http.rs:558-568 | storage_controller/src/http.rs:691-701 | storage_controller/src/http.rs:1506-1515 — 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 × 6) storage_controller/src/http.rs:1076— storage_controller/src/http.rs:1076-1085 | storage_controller/src/http.rs:1144-1153 | storage_controller/src/http.rs:1162-1171 | storage_controller/src/http.rs:1180-1189 | storage_controller/src/http.rs:1198-1207 | storage_controller/src/http.rs:1216-1225 — all 6 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–10 lines × 4) storage_controller/src/http.rs:977— storage_controller/src/http.rs:977-985 | storage_controller/src/http.rs:992-1001 | storage_controller/src/http.rs:1028-1037 | storage_controller/src/http.rs:1146-1155 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (10 lines × 4) storage_controller/src/http.rs:975— storage_controller/src/http.rs:975-984 | storage_controller/src/http.rs:990-999 | storage_controller/src/http.rs:1026-1035 | storage_controller/src/http.rs:1125-1134 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9–10 lines × 3) control_plane/src/endpoint.rs:1041— control_plane/src/endpoint.rs:1041-1050 | control_plane/src/endpoint.rs:1114-1122 | control_plane/src/endpoint.rs:1199-1207 — 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 × 10) storage_controller/src/http.rs:977— storage_controller/src/http.rs:977-985 | storage_controller/src/http.rs:992-1000 | storage_controller/src/http.rs:1028-1036 | storage_controller/src/http.rs:1078-1086 | storage_controller/src/http.rs:1127-1135 | storage_controller/src/http.rs:1146-1154 | storage_controller/src/http.rs:1164-1172 | storage_controller/src/http.rs:1182-1190 | storage_controller/src/http.rs:1200-1208 | storage_controller/src/http.rs:1218-1226 — all 10 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 5) storage_controller/src/http.rs:358— storage_controller/src/http.rs:358-366 | storage_controller/src/http.rs:453-461 | storage_controller/src/http.rs:560-568 | storage_controller/src/http.rs:693-701 | storage_controller/src/http.rs:1507-1515 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7–8 lines × 3) pageserver/src/http/routes.rs:725— pageserver/src/http/routes.rs:725-731 | pageserver/src/http/routes.rs:776-783 | pageserver/src/http/routes.rs:991-998 — 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) storage_controller/src/service.rs:8222— storage_controller/src/service.rs:8222-8230 | storage_controller/src/service.rs:8364-8371 | storage_controller/src/service.rs:8495-8502 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (7 lines × 5) pageserver/pagebench/src/cmd/aux_files.rs:34— pageserver/pagebench/src/cmd/aux_files.rs:34-40 | pageserver/pagebench/src/cmd/basebackup.rs:85-91 | pageserver/pagebench/src/cmd/getpage_latest_lsn.rs:160-166 | pageserver/pagebench/src/cmd/ondemand_download_churn.rs:81-87 | pageserver/pagebench/src/cmd/trigger_initial_size_calculation.rs:38-44 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 5 call sites, so a change lands once.
Duplicated block (6–7 lines × 2) proxy/src/serverless/conn_pool.rs:71— proxy/src/serverless/conn_pool.rs:71-76 | proxy/src/serverless/http_conn_pool.rs:203-209 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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 × 5) storage_controller/src/service.rs:8174— storage_controller/src/service.rs:8174-8178 | storage_controller/src/service.rs:8310-8314 | storage_controller/src/service.rs:8413-8417 | storage_controller/src/service.rs:8445-8449 | storage_controller/src/service.rs:8544-8548 — all 5 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (9 lines × 4) storage_controller/src/http.rs:340— storage_controller/src/http.rs:340-348 | storage_controller/src/http.rs:425-433 | storage_controller/src/http.rs:479-487 | storage_controller/src/http.rs:587-595 — 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.
End-of-life runtime: Rust 1.88 rust-toolchain.toml:1— rust-toolchain.toml declares Rust 1.88 as this project's toolchain file, and Rust 1.88, superseded by 1.89 on 2025-08-07 (the Rust project patches only the current stable). An unsupported runtime receives no security patches, so every vulnerability disclosed in it since 2025-08-07 is present and unfixable without moving off it. This is a migration rather than an upgrade: there is no newer release of a runtime that has ended.
Coverage not measured — no coverage collector is wired up — Coverage NOT MEASURED: `--collect:"XPlat Code Coverage"` names a data collector that ships in the `coverlet.collector` package, and this repository wires up none — no test project references it and no runsettings declares one. The absence of coverage here is therefore not evidence about the suite or about our analyzer environment: without a collector, `--collect` produces nothing even from a suite that builds and passes. Add a `coverlet.collector` PackageReference to the test project(s) (or commit the Cobertura/OpenCover/lcov report your CI produces) and real coverage will be measured. It is excluded from the score rather than counted as a near-zero defect.
Sync-over-async blocking libs/remote_storage/src/s3_bucket.rs:72— `new` is async and calls block_on — a blocking call inside async code stalls the executor thread, and every task scheduled on it for as long as it runs.
SC1 · Supply-chain hygiene· NuGet dependencies are not locked · ×1
NuGet dependencies are not locked — No packages.lock.json and no central package management — restores aren't reproducible or pinned (SSDF PW.4.4). Enable <RestorePackagesWithLockFile>true</RestorePackagesWithLockFile> (commit the lockfile) or adopt Directory.Packages.props. Advisory — never scored.
Orphaned file pageserver/src/tenant/timeline/compaction.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 pageserver/src/page_service.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 pageserver/src/metrics.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 pageserver/src/http/routes.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 pageserver/src/tenant/remote_timeline_client.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 storage_controller/src/tenant_shard.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 pageserver/src/pgdatadir_mapping.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 pageserver/src/tenant/mgr.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 compute_tools/src/compute.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 storage_controller/src/persistence.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 storage_controller/src/http.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 pageserver/src/walingest.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 pageserver/src/tenant/storage_layer/layer.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 pageserver/src/tenant/layer_map.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 pageserver/src/tenant/storage_layer/delta_layer.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 pageserver/src/tenant/remote_timeline_client/index.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 libs/pageserver_api/src/models.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 pageserver/src/tenant/timeline/walreceiver/connection_manager.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 safekeeper/src/safekeeper.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 pageserver/src/tenant/secondary/downloader.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 storage_controller/src/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 pageserver/src/tenant/upload_queue.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 compute_tools/src/spec_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 pageserver/src/virtual_file.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 pageserver/src/tenant/storage_layer.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.
Classify ADR enforcement: 001-cluster-size-limits docs/rfcs/001-cluster-size-limits.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: Neon storage node — alternative docs/rfcs/002-storage.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: Command line interface (end-user) docs/rfcs/003-laptop-cli.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: 004-durability docs/rfcs/004-durability.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: Neon local docs/rfcs/005-zenith_local.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: CLI v2 (after chatting with Carl) docs/rfcs/006-laptop-cli-v2-CLI.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: Repository format docs/rfcs/006-laptop-cli-v2-repository-structure.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: 007-serverless-on-laptop docs/rfcs/007-serverless-on-laptop.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: Push and pull between pageservers docs/rfcs/008-push-pull.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: 009-snapshot-first-storage-cli docs/rfcs/009-snapshot-first-storage-cli.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: Preface docs/rfcs/009-snapshot-first-storage-pitr.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: Snapshot-first storage architecture docs/rfcs/009-snapshot-first-storage.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: Storage details docs/rfcs/010-storage_details.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: User-visible timeline history docs/rfcs/011-retention-policy.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: Eviction docs/rfcs/012-background-tasks.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: What docs/rfcs/013-term-history.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: Safekeeper gossip docs/rfcs/014-safekeepers-gossip.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: Why LSM trees? docs/rfcs/014-storage-lsm.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: Storage messaging docs/rfcs/015-storage-messaging.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: Dispatching a connection docs/rfcs/016-connection-routing.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: Splitting cloud console docs/rfcs/017-console-split.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: Name docs/rfcs/017-timeline-data-management.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: Storage messaging docs/rfcs/018-storage-messaging-2.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: Managing Tenant and Timeline lifecycles docs/rfcs/019-tenant-timeline-lifecycles.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: Coordinating access of multiple pageservers to the same s3 data docs/rfcs/020-pageserver-s3-coordination.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 pageserver/src/tenant/storage_layer/delta_layer.rs:989— `blob_meta.key.is_rel_dir_key() || blob_meta.key == DBDIR_KEY || blob_meta.key.is_aux_file_key()` appears character-identically in 2 files — pageserver/src/tenant/storage_layer/delta_layer.rs, pageserver/src/tenant/storage_layer/image_layer.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 libs/pq_proto/src/lib.rs:135— `c.is_ascii_whitespace() && !last_was_escape` appears character-identically in 2 files — libs/pq_proto/src/lib.rs, proxy/src/pqproto.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 pageserver/src/page_service.rs:3108— `matches!(data.claims.scope, Scope::Tenant) && data.claims.tenant_id.is_none()` appears character-identically in 2 files — pageserver/src/page_service.rs, safekeeper/src/handler.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 control_plane/src/endpoint.rs:1039— `status.is_client_error() || status.is_server_error()` appears character-identically in 4 files — control_plane/src/endpoint.rs, pageserver/client/src/mgmt_api.rs, proxy/src/compute_ctl/mod.rs, storage_controller/src/peer_client.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, 7 significant file(s) lose their only recent owner: libs/proxy/tokio-postgres2/src/client.rs, libs/proxy/tokio-postgres2/src/connection.rs, libs/proxy/tokio-postgres2/src/connect_raw.rs, libs/proxy/tokio-postgres2/src/config.rs, libs/proxy/tokio-postgres2/src/connect.rs, libs/proxy/tokio-postgres2/src/lib.rs, libs/proxy/tokio-postgres2/src/codec.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 4 significant file(s) lose their only recent owner: pageserver/client_grpc/src/pool.rs, pageserver/client_grpc/src/client.rs, pageserver/page_api/src/split.rs, pageserver/client_grpc/src/retry.rs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 3 significant file(s) lose their only recent owner: libs/posthog_client_lite/src/lib.rs, pageserver/src/feature_resolver.rs, libs/posthog_client_lite/src/background_loop.rs. Pair on, review, or document these before any departure.
D34 · Knowledge Freshness· Most significant orphaned file · ×3
Most significant orphaned file pageserver/src/tenant.rs:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Most significant orphaned file storage_controller/src/service.rs:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
Most significant orphaned file pageserver/src/tenant/timeline.rs:1— One of the orphaned files carrying the most lost knowledge — ranked by size weighted by the file's role in the codebase, the same weighting behind the score above, so core code outranks equally large plumbing. A reasonable place to start a read-through before the aggregate risk above bites.
D20 · ADR Quality· ADR has no Decision and Consequences section · ×2
ADR has no Decision and Consequences section docs/rfcs/037-storage-controller-restarts.md:1— docs/rfcs/037-storage-controller-restarts.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/038-independent-compute-release.md:1— docs/rfcs/038-independent-compute-release.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.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 5 other contributor(s) are each the sole owner of a small amount of code below the off-boarding threshold — folded into the bus-factor score and metrics (19 single-owned of 484 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; 484 of the 660 production source files in this repository met that bar). They are anonymized user #4 (1 file(s)), anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (1 file(s)), anonymized user #8 (1 file(s)) — spread or document their files in the same way, at lower priority than the named off-boarding risks above. The files folded here: libs/remote_storage/src/gcs_bucket.rs, storage_controller/src/timeline_import.rs, proxy/src/auth/password_hack.rs, endpoint_storage/src/main.rs, compute_tools/src/http/middleware/authorize.rs.
D20 · ADR Quality· ADR has no Consequences section · ×1
ADR has no Consequences section docs/rfcs/022-pageserver-delete-from-s3.md:1— docs/rfcs/022-pageserver-delete-from-s3.md has no Consequences section (a heading such as `## Consequences`, 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.
D20 · ADR Quality· ADR considers only one option · ×1
ADR considers only one option docs/rfcs/037-storage-controller-restarts.md:237— `docs/rfcs/037-storage-controller-restarts.md:237` 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.
ADR has no title docs/rfcs/041-sharded-ingest.md:1— `docs/rfcs/041-sharded-ingest.md:1` titles the record only by its number or template text (""); a reader of the log cannot tell what was decided without opening it. Give the record a title that states the decision, e.g. `Use X for Y`.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
Concentrated knowledge decay — 480 of 484 significant files have no living knowledge, while the repository is still being changed at a low rate (1 commit(s) in the last 90 days) — so this is one repo-wide knowledge-decay state, not 480 separate risks. Counted over 484 of the 660 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over. The code moved on without the people who understood these files: document them or schedule a read-through before the next change lands in them.
P4 · Deployment & Rollback· No rollback/health safety · ×1
No rollback/health safety — Deployment is orchestrated by compose, but no service declares a `healthcheck:` and nothing pins a previous image to fall back to — the runtime can tell that the container is up, not that it is serving, so a bad release is harder to detect and reverse.
Silent fallback default on Err libs/metrics/src/more_process_metrics.rs:35— `collect` turns every `Err` into `vec![]` — 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.
Outdated: postgres-nio — `postgres-nio` is resolved at 1.21.5, but 1.33.2 is the newest release tagged on https://github.com/vapor/postgres-nio.git within the same major. SwiftPM resolves from git tags, and a `from:` requirement admits every release below the next major — so `swift package update postgres-nio` reaches this one with no change to Package.swift.
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that.
disclosure: not applicable — No vulnerability-disclosure policy file found (SECURITY.md/.markdown/.rst/.txt at root or under .github/.forgejo/.gitea/docs, .well-known/security.txt). A coordinated-disclosure policy may live off-repo, so this is not evidenced rather than failed.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; network egress policy is a cluster-native control that may live at the platform/firewall layer, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; seccomp/AppArmor/SELinux confinement is a workload-level control, so there is nothing to assess here.
runtime-hardening: not applicable — No Kubernetes/orchestration workloads found in the repository manifests; runtime threat-detection and admission-control policy are cluster-level controls, so there is nothing to assess here.
Run 01a17649-89c0-7154-a5b8-d7fbf833bf7f · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Issues: 134 · Warnings: 965 · Recommendations: 614 · Info: 1 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 26-10-2026 @ 03:38 UTC.
Downloadable artifacts
Machine-readable and reproducible from this commit + frozen rubric — drop them straight into a contract appendix, a CRA dossier, or a downstream SCA / VEX tool.