Public report of microsoft/garnet, published 23 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, 23 October 2026, 08:56 UTC · Survey ID cd_0c814d38d22d493ebd9ac7eafd183350
microsoft/garnet
Measured 23 October 2026, 08:48 UTC, at code version e154dcd
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.
Boundary Type-Coupling is not measured: Bounded contexts not declared.
CAI scoreWeak
CriticalWeakAdequateStrongExemplary
Down 3 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: 242,763 lines of product code in 63 projects, tests not counted · Estimated rebuild effort: about 6.8 person-years · Weakest lens: Security and Compliance, 33
Findings by how serious they are
180 critical2181 serious228 minor
6 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
23 October 2026, 08:48 UTC
A measurement, not a certificate. The Code Assurance Index records a number
together with the evidence it was worked out from, so anyone can recalculate it, but it doesn't certify or guarantee
the code. The standard was written by Canine Development, which also builds Watchdog. It is open to any tool that
implements it, and today Watchdog is the only one that does.
The score is deterministic, which means the same code always gets the same score. Watchdog works it out with tools that follow published rules, and an AI model never decides it, so anyone who applies the same rules to the same code gets the same number. How it is done is explained under Methodology ▸
79of 83 dimensions measured by tools. The other 4 are advisory notes from an AI model, which explain the code but don't count towards the score.
2537of 2589 findings point to an exact file and line, so you can open each one in the code. The other 52 concern the repository as a whole, such as missing documentation.
83dimensions across 6 lenses, read from 242,763 lines of product code in 63 projects.
microsoft/garnet scores 49 out of 100 and is rated Weak, while five of its six lenses score higher still: Architecture at 96, rated Exemplary, Performance at 83, rated Strong, and Production Readiness at 70, Maturity at 67 and Code Health at 51, all rated Adequate.
The score is lower than those five because the weakest lens counts most, and here that is Security and Compliance, which scores 33 and is rated Weak. Its Data Protection dimension scores 0 out of 10, and until that reaches 4, Security and Compliance can't be rated higher than Adequate. The first actions are to encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault and to store passwords with a salted KDF — `Microsoft.AspNetCore.Identity.PasswordHasher<T>`, `Rfc2898DeriveBytes` (PBKDF2), or BCrypt/Argon2 — and compare with `CryptographicOperations.FixedTimeEquals`, and if Security and Compliance rose to 70, the score would rise from 49 to about 61.
180 findings are critical: 156 in Explicit Debt, four in IaC & Container Security, four in Knowledge Freshness, four in REDACTED Scanning, four in Static Analysis (SAST), three in Cryptographic Hygiene, three in Project dependency cycles and two in Secrets (history).
Watchdog couldn't measure 4 dimensions in this code, among them Test Reliability, IL Efficiency and Platform End-of-Life, so they are left out of the score. The product code is 242,763 lines, which would take an estimated 6.8 person-years, around €990,000, to rebuild.
A lens is capped at Adequate while one of its dimensions scores below 4 out of 10, however well the rest of the lens does. That way a serious problem in one place always shows in the lens's rating.
How the score is built: what each lens counts forThe lenses don't count equally. The weakest lens counts most, the next weakest a little less, and so on, so a weak area pulls the score down instead of being averaged away. In the bar below, each part's width shows how much that lens counts and its colour shows its rating. Improving the widest part moves the score most, and as that lens improves, it counts for less, because another lens becomes the weakest.
If Security and Compliance rose from 33 to 70, the lowest score rated Strong, the score would rise from 49 to about 61.
Code composition: what the lines of code are
Business logic 32%Supporting code 21%Tests 47%
New since the last survey: 300 findings
These 300 critical or serious findings weren't in the previous survey, on 9 October 2026. The first 100 are listed here, and the findings file in the download package lists them all.
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: 272 findings
These 272 critical or serious findings were in the previous survey, on 9 October 2026, and are gone from this one. The first 100 are listed here.
€320,000 to €1,700,000, for 5,375 to 17,550 hours of work, about 6.8 person-years for 3 to 14 engineers
Difficulty of the problem
Standard, judged from the kind of software and how it is built. Code that solves a harder problem, such as payments or medical bookings, costs more per line to write.
Quality factor
×0.7 at a score of 49. 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: 242,763 lines of product code
Comment lines
The estimate prices 181,004 lines. Comment lines count towards the size of 242,763 lines but aren't priced as work.
How the estimate is made: Watchdog prices the hours a team would need to write this code again, at €60 to €95 an hour. Declarations and boilerplate are priced at a fast rate and logic at a slower one, and the logic is then multiplied by the difficulty of the problem and by the quality factor. The estimate can be about 30% off either way, and it moves most with the hourly rate and the difficulty.
Top priorities
The three actions that raise the score most for the work they take. The full ranked list is in the Roadmap.
1
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault.
Skip if delegated to infra (Postgres TDE, KMS, etc.).
Raises the score by about 9 points · Medium effort · Data Protection
2
Store passwords with a salted KDF — `Microsoft.AspNetCore.Identity.PasswordHasher<T>`, `Rfc2898DeriveBytes` (PBKDF2), or BCrypt/Argon2 — and compare with `CryptographicOperations.FixedTimeEquals`.
(A fast/plain hash, or a client-hashed value stored and compared verbatim, is not password storage.) Start in `libs/server/ACL/ACLPassword.cs:37`.
Resolve the 83 EmptyCatchBlock finding(s) in Explicit Debt — start with TsavoriteLog.cs (11), NativeStorageDevice.cs (8), EntryPoint.cs (4).
Raises the score by about 5 points · Medium effort · Explicit Debt
Diagnosis: what the measurements show together
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 €990,000 to build again, about 6.8 person-years of work. Its weakest lens is Security and Compliance, at 33 (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
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Of all the actions in this report, it raises the score most for the work it takes: about 9 points for medium effort. The next survey will show the change in the score.
Based on: the ranked actions in Top priorities, by score gain and effort
What hard-to-read code costs each year · Cost
Four dimensions measure how easy the code is to work in: two measure how tangled its logic is, one how much of it is copied, and one how well each part sticks to a single job. In this codebase they average 7.0 out of 10. Code at that level is slower to change than clean code, and Watchdog estimates the extra work at 3% to 6% on every change. The history of the code shows how much it changes: about 103,692 lines over the last 90 days, which is about 420,529 lines a year. At that pace, the extra work comes to an estimated 27.5 to 164.8 engineer-days a year, and it grows as more code changes.
How this is estimated: The number of changed lines is measured from the history of the code. The rest rests on two assumptions of Watchdog's own: code scoring 8 out of 10 or more adds no extra work, and each point below 8 adds 2.5% to 5.6% to every change; and an engineer changes 150 to 400 lines in a day. The result is a range for planning, not a measurement.
Based on: Cyclomatic Complexity · Cognitive Complexity · Code Duplication · Cohesion (LCOM4) · the code's change history
What to do: Start with the files listed under Churn × Complexity Hotspots, which change often and are hard to read, because that is where the extra work is paid most often.
Architecture — bounded-context dependency graph
Each box is a bounded context (its layer projects grouped, or a project count when large); arrows show dependencies between contexts. A shared kernel is where many arrows converge.
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.
68 modules, with 111 dependencies between them. 3 loops run through 12 of the modules, marked above the diagonal.
The table shows the 40 modules with the most connections; 28 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.
Garnet.networking uses Garnet.common, so a change to Garnet.common can break Garnet.networking, while a change to Garnet.networking can't break Garnet.common.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
7→24 Garnet.server.ACL uses Garnet.serverpart of a loop✕
Connections
5 pairs of types, where a type in Garnet.server.ACL uses a type in Garnet.server.
Garnet.server.ACL uses Garnet.server, so a change to Garnet.server can break Garnet.server.ACL, while a change to Garnet.server.ACL can't break Garnet.server.
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.
8→24 Garnet.server.Custom uses Garnet.serverpart of a loop✕
Connections
16 pairs of types, where a type in Garnet.server.Custom uses a type in Garnet.server.
Garnet.server.Custom uses Garnet.server, so a change to Garnet.server can break Garnet.server.Custom, while a change to Garnet.server.Custom can't break Garnet.server.
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.
9→24 Garnet.server.Lua uses Garnet.serverpart of a loop✕
Connections
2 pairs of types, where a type in Garnet.server.Lua uses a type in Garnet.server.
Garnet.server.Lua uses Garnet.server, so a change to Garnet.server can break Garnet.server.Lua, while a change to Garnet.server.Lua can't break Garnet.server.
Position
Above the diagonal, so it is part of a loop. Neither module can be changed, tested or released on its own until one of these dependencies is removed.
10→13 HdrHistogram.Iteration uses HdrHistogrampart of a loop✕
Connections
7 pairs of types, where a type in HdrHistogram.Iteration uses a type in HdrHistogram.
HdrHistogram.Iteration uses HdrHistogram, so a change to HdrHistogram can break HdrHistogram.Iteration, while a change to HdrHistogram.Iteration can't break HdrHistogram.
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.
11→14 Tsavorite.core.Allocator.ObjectSerialization uses Tsavorite.corepart of a loop✕
Connections
5 pairs of types, where a type in Tsavorite.core.Allocator.ObjectSerialization uses a type in Tsavorite.core.
Tsavorite.core.Allocator.ObjectSerialization uses Tsavorite.core, so a change to Tsavorite.core can break Tsavorite.core.Allocator.ObjectSerialization, while a change to Tsavorite.core.Allocator.ObjectSerialization can't break Tsavorite.core.
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.
Garnet.server.Auth uses Garnet.server.Auth.Aad, so a change to Garnet.server.Auth.Aad can break Garnet.server.Auth, while a change to Garnet.server.Auth can't break Garnet.server.Auth.Aad.
Position
Below the diagonal: Garnet.server.Auth uses a module listed above it, which is the healthy direction.
Garnet.server.Auth uses Garnet.server.ACL, so a change to Garnet.server.ACL can break Garnet.server.Auth, while a change to Garnet.server.Auth can't break Garnet.server.ACL.
Position
Below the diagonal: Garnet.server.Auth uses a module listed above it, which is the healthy direction.
HdrHistogram uses HdrHistogram.Iteration, so a change to HdrHistogram.Iteration can break HdrHistogram, while a change to HdrHistogram can't break HdrHistogram.Iteration.
Position
Below the diagonal: HdrHistogram uses a module listed above it, which is the healthy direction.
Tsavorite.core uses Tsavorite.core.Allocator.ObjectSerialization, so a change to Tsavorite.core.Allocator.ObjectSerialization can break Tsavorite.core, while a change to Tsavorite.core can't break Tsavorite.core.Allocator.ObjectSerialization.
Position
Below the diagonal: Tsavorite.core uses a module listed above it, which is the healthy direction.
30 pairs of types, where a type in BenchmarkDotNetTests uses a type in Tsavorite.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
BenchmarkDotNetTests uses Tsavorite.core, so a change to Tsavorite.core can break BenchmarkDotNetTests, while a change to BenchmarkDotNetTests can't break Tsavorite.core.
Position
Below the diagonal: BenchmarkDotNetTests uses a module listed above it, which is the healthy direction.
Device.benchmark uses Tsavorite.core, so a change to Tsavorite.core can break Device.benchmark, while a change to Device.benchmark can't break Tsavorite.core.
Position
Below the diagonal: Device.benchmark uses a module listed above it, which is the healthy direction.
Garnet.server.Auth.Settings uses Garnet.server.Auth.Aad, so a change to Garnet.server.Auth.Aad can break Garnet.server.Auth.Settings, while a change to Garnet.server.Auth.Settings can't break Garnet.server.Auth.Aad.
Position
Below the diagonal: Garnet.server.Auth.Settings uses a module listed above it, which is the healthy direction.
Garnet.server.Auth.Settings uses Garnet.server.Auth, so a change to Garnet.server.Auth can break Garnet.server.Auth.Settings, while a change to Garnet.server.Auth.Settings can't break Garnet.server.Auth.
Position
Below the diagonal: Garnet.server.Auth.Settings uses a module listed above it, which is the healthy direction.
18→24 Garnet.server.Auth.Settings uses Garnet.serverpart of a loop✕
Connections
7 pairs of types, where a type in Garnet.server.Auth.Settings uses a type in Garnet.server.
Garnet.server.Auth.Settings uses Garnet.server, so a change to Garnet.server can break Garnet.server.Auth.Settings, while a change to Garnet.server.Auth.Settings can't break Garnet.server.
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.
Garnet.server.BfTreeInterop uses Tsavorite.core, so a change to Tsavorite.core can break Garnet.server.BfTreeInterop, while a change to Garnet.server.BfTreeInterop can't break Tsavorite.core.
Position
Below the diagonal: Garnet.server.BfTreeInterop uses a module listed above it, which is the healthy direction.
Tsavorite.devices uses Tsavorite.core, so a change to Tsavorite.core can break Tsavorite.devices, while a change to Tsavorite.devices can't break Tsavorite.core.
Position
Below the diagonal: Tsavorite.devices uses a module listed above it, which is the healthy direction.
BDN.benchmark.BfTree uses Tsavorite.core, so a change to Tsavorite.core can break BDN.benchmark.BfTree, while a change to BDN.benchmark.BfTree can't break Tsavorite.core.
Position
Below the diagonal: BDN.benchmark.BfTree uses a module listed above it, which is the healthy direction.
BDN.benchmark.BfTree uses Garnet.server.BfTreeInterop, so a change to Garnet.server.BfTreeInterop can break BDN.benchmark.BfTree, while a change to BDN.benchmark.BfTree can't break Garnet.server.BfTreeInterop.
Position
Below the diagonal: BDN.benchmark.BfTree uses a module listed above it, which is the healthy direction.
Garnet.common uses Garnet.networking, so a change to Garnet.networking can break Garnet.common, while a change to Garnet.common can't break Garnet.networking.
Position
Below the diagonal: Garnet.common uses a module listed above it, which is the healthy direction.
Garnet.common uses Tsavorite.devices, so a change to Tsavorite.devices can break Garnet.common, while a change to Garnet.common can't break Tsavorite.devices.
Position
Below the diagonal: Garnet.common uses a module listed above it, which is the healthy direction.
22→24 Garnet.common uses Garnet.serverpart of a loop✕
Connections
1 pair of types, where a type in Garnet.common uses a type in Garnet.server.
Garnet.client uses Garnet.client.GarnetClientAPI, so a change to Garnet.client.GarnetClientAPI can break Garnet.client, while a change to Garnet.client can't break Garnet.client.GarnetClientAPI.
Position
Below the diagonal: Garnet.client uses a module listed above it, which is the healthy direction.
Garnet.client uses Garnet.networking, so a change to Garnet.networking can break Garnet.client, while a change to Garnet.client can't break Garnet.networking.
Position
Below the diagonal: Garnet.client uses a module listed above it, which is the healthy direction.
Garnet.server uses Garnet.server.TLS, so a change to Garnet.server.TLS can break Garnet.server, while a change to Garnet.server can't break Garnet.server.TLS.
Position
Below the diagonal: Garnet.server uses a module listed above it, which is the healthy direction.
32 pairs of types, where a type in Garnet.server uses a type in Garnet.networking. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Garnet.server uses Garnet.networking, so a change to Garnet.networking can break Garnet.server, while a change to Garnet.server can't break Garnet.networking.
Position
Below the diagonal: Garnet.server uses a module listed above it, which is the healthy direction.
Garnet.server uses Garnet.server.ACL, so a change to Garnet.server.ACL can break Garnet.server, while a change to Garnet.server can't break Garnet.server.ACL.
Position
Below the diagonal: Garnet.server uses a module listed above it, which is the healthy direction.
Garnet.server uses Garnet.server.Custom, so a change to Garnet.server.Custom can break Garnet.server, while a change to Garnet.server can't break Garnet.server.Custom.
Position
Below the diagonal: Garnet.server uses a module listed above it, which is the healthy direction.
Garnet.server uses Garnet.server.Lua, so a change to Garnet.server.Lua can break Garnet.server, while a change to Garnet.server can't break Garnet.server.Lua.
Position
Below the diagonal: Garnet.server uses a module listed above it, which is the healthy direction.
Garnet.server uses Tsavorite.core.Allocator.ObjectSerialization, so a change to Tsavorite.core.Allocator.ObjectSerialization can break Garnet.server, while a change to Garnet.server can't break Tsavorite.core.Allocator.ObjectSerialization.
Position
Below the diagonal: Garnet.server uses a module listed above it, which is the healthy direction.
Garnet.server uses Garnet.server.Auth, so a change to Garnet.server.Auth can break Garnet.server, while a change to Garnet.server can't break Garnet.server.Auth.
Position
Below the diagonal: Garnet.server uses a module listed above it, which is the healthy direction.
304 pairs of types, where a type in Garnet.server uses a type in Tsavorite.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Garnet.server uses Garnet.server.Auth.Settings, so a change to Garnet.server.Auth.Settings can break Garnet.server, while a change to Garnet.server can't break Garnet.server.Auth.Settings.
Position
Below the diagonal: Garnet.server uses a module listed above it, which is the healthy direction.
Garnet.server uses Garnet.server.BfTreeInterop, so a change to Garnet.server.BfTreeInterop can break Garnet.server, while a change to Garnet.server can't break Garnet.server.BfTreeInterop.
Position
Below the diagonal: Garnet.server uses a module listed above it, which is the healthy direction.
128 pairs of types, where a type in Garnet.server uses a type in Garnet.common. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
BDN.benchmark.Bitmap uses Garnet.server, so a change to Garnet.server can break BDN.benchmark.Bitmap, while a change to BDN.benchmark.Bitmap can't break Garnet.server.
Position
Below the diagonal: BDN.benchmark.Bitmap uses a module listed above it, which is the healthy direction.
BDN.benchmark.CustomProcs uses Tsavorite.core, so a change to Tsavorite.core can break BDN.benchmark.CustomProcs, while a change to BDN.benchmark.CustomProcs can't break Tsavorite.core.
Position
Below the diagonal: BDN.benchmark.CustomProcs uses a module listed above it, which is the healthy direction.
BDN.benchmark.CustomProcs uses Garnet.common, so a change to Garnet.common can break BDN.benchmark.CustomProcs, while a change to BDN.benchmark.CustomProcs can't break Garnet.common.
Position
Below the diagonal: BDN.benchmark.CustomProcs uses a module listed above it, which is the healthy direction.
BDN.benchmark.CustomProcs uses Garnet.server, so a change to Garnet.server can break BDN.benchmark.CustomProcs, while a change to BDN.benchmark.CustomProcs can't break Garnet.server.
Position
Below the diagonal: BDN.benchmark.CustomProcs uses a module listed above it, which is the healthy direction.
CommandInfoUpdater uses Garnet.server, so a change to Garnet.server can break CommandInfoUpdater, while a change to CommandInfoUpdater can't break Garnet.server.
Position
Below the diagonal: CommandInfoUpdater uses a module listed above it, which is the healthy direction.
Garnet.cluster uses Garnet.cluster.Server.Replication, so a change to Garnet.cluster.Server.Replication can break Garnet.cluster, while a change to Garnet.cluster can't break Garnet.cluster.Server.Replication.
Position
Below the diagonal: Garnet.cluster uses a module listed above it, which is the healthy direction.
Garnet.cluster uses Garnet.server.TLS, so a change to Garnet.server.TLS can break Garnet.cluster, while a change to Garnet.cluster can't break Garnet.server.TLS.
Position
Below the diagonal: Garnet.cluster uses a module listed above it, which is the healthy direction.
Garnet.cluster uses Garnet.networking, so a change to Garnet.networking can break Garnet.cluster, while a change to Garnet.cluster can't break Garnet.networking.
Position
Below the diagonal: Garnet.cluster uses a module listed above it, which is the healthy direction.
Garnet.cluster uses Garnet.server.ACL, so a change to Garnet.server.ACL can break Garnet.cluster, while a change to Garnet.cluster can't break Garnet.server.ACL.
Position
Below the diagonal: Garnet.cluster uses a module listed above it, which is the healthy direction.
Garnet.cluster uses Tsavorite.core.Allocator.ObjectSerialization, so a change to Tsavorite.core.Allocator.ObjectSerialization can break Garnet.cluster, while a change to Garnet.cluster can't break Tsavorite.core.Allocator.ObjectSerialization.
Position
Below the diagonal: Garnet.cluster uses a module listed above it, which is the healthy direction.
Garnet.cluster uses Garnet.server.Auth, so a change to Garnet.server.Auth can break Garnet.cluster, while a change to Garnet.cluster can't break Garnet.server.Auth.
Position
Below the diagonal: Garnet.cluster uses a module listed above it, which is the healthy direction.
71 pairs of types, where a type in Garnet.cluster uses a type in Tsavorite.core. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Garnet.cluster uses Tsavorite.core, so a change to Tsavorite.core can break Garnet.cluster, while a change to Garnet.cluster can't break Tsavorite.core.
Position
Below the diagonal: Garnet.cluster uses a module listed above it, which is the healthy direction.
42 pairs of types, where a type in Garnet.cluster uses a type in Garnet.common. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
121 pairs of types, where a type in Garnet.cluster uses a type in Garnet.server. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
GarnetRoaringBitmap uses Tsavorite.core, so a change to Tsavorite.core can break GarnetRoaringBitmap, while a change to GarnetRoaringBitmap can't break Tsavorite.core.
Position
Below the diagonal: GarnetRoaringBitmap uses a module listed above it, which is the healthy direction.
GarnetRoaringBitmap uses Garnet.common, so a change to Garnet.common can break GarnetRoaringBitmap, while a change to GarnetRoaringBitmap can't break Garnet.common.
Position
Below the diagonal: GarnetRoaringBitmap uses a module listed above it, which is the healthy direction.
GarnetRoaringBitmap uses Garnet.server, so a change to Garnet.server can break GarnetRoaringBitmap, while a change to GarnetRoaringBitmap can't break Garnet.server.
Position
Below the diagonal: GarnetRoaringBitmap uses a module listed above it, which is the healthy direction.
Garnet uses Garnet.server.Auth.Settings, so a change to Garnet.server.Auth.Settings can break Garnet, while a change to Garnet can't break Garnet.server.Auth.Settings.
Position
Below the diagonal: Garnet uses a module listed above it, which is the healthy direction.
52 pairs of types, where a type in Garnet uses a type in Garnet.server. Showing 25 of them; the rest are in namespace-graph.json in this report's bundle.
Embedded.server uses Garnet.networking, so a change to Garnet.networking can break Embedded.server, while a change to Embedded.server can't break Garnet.networking.
Position
Below the diagonal: Embedded.server uses a module listed above it, which is the healthy direction.
Embedded.server uses Garnet.common, so a change to Garnet.common can break Embedded.server, while a change to Embedded.server can't break Garnet.common.
Position
Below the diagonal: Embedded.server uses a module listed above it, which is the healthy direction.
Embedded.server uses Garnet.server, so a change to Garnet.server can break Embedded.server, while a change to Embedded.server can't break Garnet.server.
Position
Below the diagonal: Embedded.server uses a module listed above it, which is the healthy direction.
BDN.benchmark.Cluster uses BDN.benchmark, so a change to BDN.benchmark can break BDN.benchmark.Cluster, while a change to BDN.benchmark.Cluster can't break BDN.benchmark.
Position
Below the diagonal: BDN.benchmark.Cluster uses a module listed above it, which is the healthy direction.
BDN.benchmark.Cluster uses Garnet.server, so a change to Garnet.server can break BDN.benchmark.Cluster, while a change to BDN.benchmark.Cluster can't break Garnet.server.
Position
Below the diagonal: BDN.benchmark.Cluster uses a module listed above it, which is the healthy direction.
BDN.benchmark.Cluster uses Garnet.cluster, so a change to Garnet.cluster can break BDN.benchmark.Cluster, while a change to BDN.benchmark.Cluster can't break Garnet.cluster.
Position
Below the diagonal: BDN.benchmark.Cluster uses a module listed above it, which is the healthy direction.
BDN.benchmark.Cluster uses Embedded.server, so a change to Embedded.server can break BDN.benchmark.Cluster, while a change to BDN.benchmark.Cluster can't break Embedded.server.
Position
Below the diagonal: BDN.benchmark.Cluster uses a module listed above it, which is the healthy direction.
BDN.benchmark.Lua uses Garnet.server, so a change to Garnet.server can break BDN.benchmark.Lua, while a change to BDN.benchmark.Lua can't break Garnet.server.
Position
Below the diagonal: BDN.benchmark.Lua uses a module listed above it, which is the healthy direction.
BDN.benchmark.Lua uses Embedded.server, so a change to Embedded.server can break BDN.benchmark.Lua, while a change to BDN.benchmark.Lua can't break Embedded.server.
Position
Below the diagonal: BDN.benchmark.Lua uses a module listed above it, which is the healthy direction.
BDN.benchmark.Network uses Embedded.server, so a change to Embedded.server can break BDN.benchmark.Network, while a change to BDN.benchmark.Network can't break Embedded.server.
Position
Below the diagonal: BDN.benchmark.Network uses a module listed above it, which is the healthy direction.
Resp.benchmark uses Tsavorite.core, so a change to Tsavorite.core can break Resp.benchmark, while a change to Resp.benchmark can't break Tsavorite.core.
Position
Below the diagonal: Resp.benchmark uses a module listed above it, which is the healthy direction.
Resp.benchmark uses Garnet.cluster, so a change to Garnet.cluster can break Resp.benchmark, while a change to Resp.benchmark can't break Garnet.cluster.
Position
Below the diagonal: Resp.benchmark uses a module listed above it, which is the healthy direction.
Resp.benchmark uses Embedded.server, so a change to Embedded.server can break Resp.benchmark, while a change to Resp.benchmark can't break Embedded.server.
Position
Below the diagonal: Resp.benchmark uses a module listed above it, which is the healthy direction.
BDN.benchmark.Cluster.ConsistentRead uses BDN.benchmark, so a change to BDN.benchmark can break BDN.benchmark.Cluster.ConsistentRead, while a change to BDN.benchmark.Cluster.ConsistentRead can't break BDN.benchmark.
Position
Below the diagonal: BDN.benchmark.Cluster.ConsistentRead uses a module listed above it, which is the healthy direction.
BDN.benchmark.Cluster.ConsistentRead uses Garnet.server, so a change to Garnet.server can break BDN.benchmark.Cluster.ConsistentRead, while a change to BDN.benchmark.Cluster.ConsistentRead can't break Garnet.server.
Position
Below the diagonal: BDN.benchmark.Cluster.ConsistentRead uses a module listed above it, which is the healthy direction.
BDN.benchmark.Cluster.ConsistentRead uses Embedded.server, so a change to Embedded.server can break BDN.benchmark.Cluster.ConsistentRead, while a change to BDN.benchmark.Cluster.ConsistentRead can't break Embedded.server.
Position
Below the diagonal: BDN.benchmark.Cluster.ConsistentRead uses a module listed above it, which is the healthy direction.
BDN.benchmark.Cluster.ConsistentRead uses BDN.benchmark.Cluster, so a change to BDN.benchmark.Cluster can break BDN.benchmark.Cluster.ConsistentRead, while a change to BDN.benchmark.Cluster.ConsistentRead can't break BDN.benchmark.Cluster.
Position
Below the diagonal: BDN.benchmark.Cluster.ConsistentRead uses a module listed above it, which is the healthy direction.
BDN.benchmark.Operations uses Garnet.server.Auth.Aad, so a change to Garnet.server.Auth.Aad can break BDN.benchmark.Operations, while a change to BDN.benchmark.Operations can't break Garnet.server.Auth.Aad.
Position
Below the diagonal: BDN.benchmark.Operations uses a module listed above it, which is the healthy direction.
BDN.benchmark.Operations uses Garnet.server.Auth.Settings, so a change to Garnet.server.Auth.Settings can break BDN.benchmark.Operations, while a change to BDN.benchmark.Operations can't break Garnet.server.Auth.Settings.
Position
Below the diagonal: BDN.benchmark.Operations uses a module listed above it, which is the healthy direction.
BDN.benchmark.Operations uses Garnet.server, so a change to Garnet.server can break BDN.benchmark.Operations, while a change to BDN.benchmark.Operations can't break Garnet.server.
Position
Below the diagonal: BDN.benchmark.Operations uses a module listed above it, which is the healthy direction.
BDN.benchmark.Operations uses Embedded.server, so a change to Embedded.server can break BDN.benchmark.Operations, while a change to BDN.benchmark.Operations can't break Embedded.server.
Position
Below the diagonal: BDN.benchmark.Operations uses a module listed above it, which is the healthy direction.
BDN.benchmark.Operations uses BDN.benchmark.Lua, so a change to BDN.benchmark.Lua can break BDN.benchmark.Operations, while a change to BDN.benchmark.Operations can't break BDN.benchmark.Lua.
Position
Below the diagonal: BDN.benchmark.Operations uses a module listed above it, which is the healthy direction.
BDN.benchmark.Operations.LTM uses Garnet.server, so a change to Garnet.server can break BDN.benchmark.Operations.LTM, while a change to BDN.benchmark.Operations.LTM can't break Garnet.server.
Position
Below the diagonal: BDN.benchmark.Operations.LTM uses a module listed above it, which is the healthy direction.
BDN.benchmark.Operations.LTM uses Embedded.server, so a change to Embedded.server can break BDN.benchmark.Operations.LTM, while a change to BDN.benchmark.Operations.LTM can't break Embedded.server.
Position
Below the diagonal: BDN.benchmark.Operations.LTM uses a module listed above it, which is the healthy direction.
BDN.benchmark.Operations.LTM uses BDN.benchmark.Operations, so a change to BDN.benchmark.Operations can break BDN.benchmark.Operations.LTM, while a change to BDN.benchmark.Operations.LTM can't break BDN.benchmark.Operations.
Position
Below the diagonal: BDN.benchmark.Operations.LTM uses a module listed above it, which is the healthy direction.
At a glance — Code Health · 51% · Adequate · gated by D2, X5 ·
Findings mapped to OWASP categories; the specific CVEs/secrets are in the Security dimension cards below and findings.md (redacted only on the public version of this report).
OWASP category
Findings
Severity
A02:2025 — Security Misconfiguration
36
High / Critical
A07:2025 — Authentication Failures
7
High / Critical
A05:2025 — Injection
6
High / Critical
A03:2025 — Software Supply Chain Failures
6
Medium
Roadmap
First, secure sensitive data by implementing encryption at rest and managing keys in a vault, while ensuring passwords are stored using a strong, salted key derivation function. Next, address the explicit technical debt by resolving the 26 file-scoped pragma disables, starting with BitmapManager.cs, followed by the 28 write-only private field issues in AofBench.cs and ClientSession.cs. Finally, eliminate the 83 empty catch blocks, prioritizing TsavoriteLog.cs and NativeStorageDevice.cs to improve error handling and code stability.
Ranked by impact ÷ effort. "Helps" is the estimated gain on the 0–100 health score.
Do this
Helps
Effort
Dimension
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Skip if delegated to infra (Postgres TDE, KMS, etc.).
Store passwords with a salted KDF — `Microsoft.AspNetCore.Identity.PasswordHasher<T>`, `Rfc2898DeriveBytes` (PBKDF2), or BCrypt/Argon2 — and compare with `CryptographicOperations.FixedTimeEquals`. (A fast/plain hash, or a client-hashed value stored and compared verbatim, is not password storage.) Start in `libs/server/ACL/ACLPassword.cs:37`.
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 — 180
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 — 2181
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 — 228
Recorded, with no effect on how the codebase functions.
Present so the survey is complete, not because it needs doing.
Could not be resolved — 6
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. 79 of 83 evaluated dimensions are computed purely by tools and static analysis (confidence 1.0); 4 documentation/naming judgement(s) are LLM-assisted and labelled advisory. Overall confidence is 0.9 — the weighted average across measured dimensions; it falls as more of the score leans on LLM-assisted judgement and rises when it's fully tool-backed.
Every figure here is one of three kinds, and we label which: ✓ Measured — a deterministic fact (LoC, complexity, coverage); ~ Modeled — an estimate from a stated model (cost, effort, value-at-risk), always a range with its assumptions, never a precise fact; ◐ Advisory — an LLM prose judgement. We never present a modelled estimate as if it were measured. Perfect or absent scores carry their provenance too (ADR-0011): ✓ Tool-verified means the property itself was measured across the surface; ○ Nothing flagged means the probes came back clean — a claim bounded by what a repository can show; ⊘ Not evidenced means a working control (a tested restore, an automated rollback) showed no positive evidence — absence of evidence is not evidence of a control, so it's excluded from the score rather than awarded a spurious 10; ◐ Sampled · advisory marks an LLM verdict over a bounded sample — advisory, never a deterministic measurement.
What we checked — 83 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, 2537 of 2589 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.
D10 Test Quality — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. The 3,664 test(s) behind this row are the ones the C# collector could read, and this repository also carries at least 2 test source file(s) (.rs, .py) that it cannot: it parses C# syntax and matches C# test attributes, so a vitest/jest/JUnit/pytest-style suite is invisible to it. Skipped tests, zero-assertion tests and the other quality signals on this row are UNMEASURED in that suite — their absence from the counts above is a gap in this analyzer's language coverage, not a finding that those tests are sound.
D11 Test Reliability — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Test reliability not included — no test tier completed within its budget.
D12 Dependency Hygiene — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares npm dependencies as well as NuGet ones — manifest: website/package.json — and the counts on this row cover the NuGet side ONLY. This dimension reads dependency currency from `<PackageReference>` elements via `dotnet list package`; it does not read it, so the npm packages declared there were not checked for newer, deprecated or unmaintained releases. Their absence from the counts above is a gap in this analyzer's ecosystem coverage — not a finding that those dependencies are current.
D14 License Compliance — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. This repository declares package.json, but the licence verdict published here was taken over its 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.
D18 Solution Shape — 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. `dotnet build` reported 1 error(s). None of them is a .NET compiler diagnostic, which is the only signal this check reads as "the code does not compile", so the failure is recorded as a build-environment gap rather than a code defect. The usual causes are a project that targets a platform this run cannot build (a Windows-only target framework on a Linux worker) or a build step that shells out to a tool the image does not carry. Solution Shape is scored on structure and is NOT capped. Semantic analysis is independent of this build and covers every project that loaded — but a project whose restore did not complete has no resolved references, so treat its results as absent rather than clean. ★ The reach of that test, stated so this classification can be checked rather than taken on trust: it reads the C# (CS), Visual Basic (BC) and F# (FS) compiler series, and treats SDK, NuGet-restore and MSBuild codes (NETSDK, NU, MSB) as evidence that the build did not run rather than that the code is broken — read the diagnostics named above and judge for yourself. You can widen what we reach: if this build is meant to run off its own platform, without host tooling we do not carry, the diagnostics named above are what stopped it. If it is deliberately platform-bound — a Windows-only desktop product, say — there is nothing to do here: the note records our reach, not a defect in your build.
D22 Internal API Consistency — not measured this run — This is a true statement about the repository that carries nothing for its owner to act on, so it is reported here rather than as a defect in their code. The loaded project set declares no packable project and no `.Contracts` project, so there is no intentionally-exposed surface for API consistency to be judged over.
D23 Boundary Type-Coupling — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. Large codebase (236,570 production LoC in the .NET projects) with no declared bounded contexts — cross-boundary type coupling is unassessed Bounded contexts cannot be inferred from a codebase that is not physically organised by them (D-321), so with none declared there are no boundaries for the coupling pass to measure across. You can widen what we reach: name this codebase's bounded contexts (≥2 module groups, e.g. per subsystem) so cross-boundary type coupling can be assessed. Declare them in `.codehealth/config.yaml` at the repository root (create it if absent), mapping each context name to the module-path or namespace prefixes that belong to it — e.g. `architecture:` → `contexts:` → `Billing: ["src/billing", "Acme.Billing"]`, `Catalog: ["src/catalog", "Acme.Catalog"]`.
D28 Secrets (history) — 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. D28's config-credential rule (WD-SECRET-0002) parses each committed `.json` config as a document and reads credential-named values; `playground/CommandInfoUpdater/GarnetCommandsInfo.json` did not parse (JSON5, a template, several concatenated documents), so a credential bound there is UNMEASURED by that rule. gitleaks still scanned the same files as text.
D32 Data Compliance (PII/GDPR) — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. `benchmark/BDN.benchmark/Diagnostics/CpuDiagnoser.cs`, `benchmark/BDN.benchmark/Operations/JsonOperations.cs`, `benchmark/BDN.benchmark/Program.cs`, `benchmark/Resp.benchmark/OfflineBench/AOFBench/AofGen.cs`, `libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncDriverStore.cs`, … (+112 more) produced a parse error, so every rule in this engine's `gdpr.yml` was absent there. That absence is NOT a clean result: these rules detect personal data crossing a boundary into a log sink, a URL or browser storage, and a file that was never parsed cannot report any of the three. The rest of the tree analysed normally and its rows above stand; only these files are unaccounted for. You can widen what we reach: fix the syntax error (or exclude the file deliberately) and re-scan to cover it.
D39 IL Efficiency — not measured this run — Watchdog could not measure this here. That is a gap on our side — a collector, parser or image we have not built yet — and it is neither a defect in this repository nor evidence that the check would have passed. IL NOT MEASURED: the analyzer's build of this repository exited 1 and the cause could not be attributed, so no assemblies were produced and there was no IL to read. We do not read it as a defect in the repository: an unattributed failure leans OURS. D18 owns the question of whether this repository builds; it was not answered here.
D41 Kernel & Syscall Confinement — 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. Charts/garnet/templates/statefulset.yaml:2 did not read as a pod spec (a templated manifest such as Helm's that is not YAML until rendered, or a workload whose pod spec this check does not locate), so the seccomp/AppArmor profile in force there was not judged and no row about them can appear on this card.
D44 Platform End-of-Life — 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 dimension reads a project's own statement about the platform it runs on: a TargetFramework in a .NET project file, a .nvmrc or .python-version, a capped requires-python, a Rust toolchain file or Cargo.toml rust-version, a .go-version, .java-version, .ruby-version, .tool-versions or .sdkmanrc, a go.mod go directive, a Maven or Gradle Java level or toolchain, a Gemfile's ruby directive, a mix.exs elixir requirement, a rebar.config minimum_otp_vsn, a pubspec.yaml SDK constraint, a build.sbt scalaVersion, or a framework major pinned by a dependency constraint. This repository carries none of them, so nothing about its platform was established. That is a gap in this analyzer's coverage, NOT a finding that the platform is supported — a language whose runtime is declared elsewhere (Package.swift, a REDACTED) is simply not read here yet.
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 REDACTED (REDACTED). docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/bui…; runtime evidence skipped.
IC1 Incompleteness & stubs — 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. 99 further occurrence(s) are not listed individually; the score already reflects all 139.
PF3 Async & latency hygiene — measured, with a gap in what it reached — Watchdog measured this, but not all of it. What it did not reach is a gap on our side — a collector, parser or image we have not built yet — so the numbers on that dimension cover less than the repository, and the part left out is not evidence that it would have passed. 87 further occurrence(s) are not listed individually; the score already reflects all 127.
X1 Async correctness — 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. 89 further occurrence(s) are not listed individually; the score already reflects all 129.
X2 Cancellation propagation — 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. 160 further occurrence(s) are not listed individually; the score already reflects all 200.
X3 Exception handling — 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. 45 further occurrence(s) are not listed individually; the score already reflects all 85.
Repo exclusion declarations: 1 pattern(s) declared (.gitattributes linguist-generated/vendored, .editorconfig generated_code) excluded 0 source file(s) from code-quality scoring. Declarations are the repo's own visible statement that a tree is machine-written or vendored — auditable in any diff, honored by GitHub the same way.
Limitations & what we did not check
Watchdog assesses the repository exactly as committed, and only the repository. By design it does not reach outside the source tree: the live cloud account, the running CI/CD pipeline, the host's branch-protection and approval rules, the production configuration, or a restore actually exercised against a backup are all out of scope. That boundary is a feature, not a gap — a repo-relative, deterministic scan re-runs identically on any commit and every finding opens at a real file and line, where a live audit can neither be reproduced nor traced. The visible consequence is that controls which leave no in-repo evidence are reported as "not evidenced" and excluded from the score rather than awarded a number a static scan cannot justify.
Per-dimension blind spots
For each dimension that was measured, what a static, repo-only scan structurally cannot see — the honest edge of the measurement, not a failure of it.
D1 Cyclomatic Complexity: Cyclomatic complexity counts branches statically — it cannot tell an essential decision tree from accidental tangle, nor see complexity that lives in data or configuration (large switch-case token tables, DSL lexers/parsers, data-as-code rule tables) rather than control flow: a tokenizer's many single-character cases read as high complexity though each branch is trivial.
D2 Cognitive Complexity: Cognitive-complexity heuristics approximate how hard code is to follow; genuine domain difficulty and well-named intent that eases reading are not captured.
D3 God Classes: "God class" is sized by members and responsibilities visible in the type — a deliberately broad facade over a coherent subsystem can read the same as an accidental grab-bag. For front-end JS the file-length check is cohesion-aware (a single-responsibility module — one class/IIFE — earns a 3× threshold), but cohesion is approximated from top-level declarations, not true dependency structure.
D4 Code Duplication: Duplication is token-similarity — an in-process token-stream comparison over sliding windows, with type-aware normalization — so it finds copy-paste, not semantic duplication expressed differently. Committed machine-written code (scaffolded migrations, designer/codegen output, protobuf/OpenAPI stubs, model snapshots) is EXCLUDED — its repetition is the tool's, not the team's — so the score reflects hand-written duplication only.
D5 Coupling: Coupling is measured between projects/assemblies — runtime coupling through DI, reflection, messaging or shared databases is invisible to a static reference graph.
D6 Cohesion (LCOM4): LCOM4 cohesion is syntactic — it infers connectivity from which methods touch which fields/methods by name, not from real runtime behaviour or intent.
D9 Test Distribution: The test-pyramid shape is inferred from project/folder naming and references, with a single test host bucketed per-file by its path tier and content signals — a suite that names tiers unconventionally and gives no per-file signal can still be mis-bucketed.
D10 Test Quality: Assertion density is structural — it cannot tell a meaningful behavioural assertion from a trivial one, only that an assertion is present.
D12 Dependency Hygiene: Dependency health reads manifests and lockfiles — a vulnerability in a vendored/copied dependency, or risk from how a dependency is actually used, is outside this view.
D13 REDACTED Scanning: REDACTED detection is signature- and entropy-based on the current tree — a secret that does not match a known pattern, or one already rotated, will not be flagged (a clean scan is "nothing matched", not "no secrets exist").
D14 License Compliance: License compatibility is checked against declared package metadata and a policy — mislabelled or missing license metadata, and obligations that depend on how you distribute, are not resolved here.
D15 Churn × Complexity Hotspots: Churn hotspots come from git history — a freshly imported or squashed repository has no churn signal, and recent rewrites can mask a historically risky file.
D16 Bus Factor: Bus-factor is a time-decayed model of commit attribution (who has recently, repeatedly worked a file), not comprehension — pairing, review and reading-without-committing spread knowledge it can't see; bot commits and shared accounts still distort it.
D17 Explicit Debt: Acknowledged-debt signals (TODO/FIXME, suppressions, dead code) are textual — undocumented debt that nobody marked, and debt that lives in design rather than annotations, is invisible. Committed machine-written code (scaffolded migrations, designer/codegen output, generated stubs) is excluded — it is never the team's dead code to delete.
D18 Solution Shape: Build integrity reflects whether the solution compiled in this environment — a build that needs a private feed, a specific SDK, or a generated file absent from the repo can read as broken when it is merely unreproducible here.
D19 Documentation Quality: Documentation quality is judged by an LLM over a bounded sample of docs — it reads what is written, not whether the docs match the running system, and it is advisory, not a measurement. Its critique rows are drawn from a closed category vocabulary and each row means the same thing in every run, so two scans can be compared row by row; the SET that fires is still a sample, and does not repeat exactly. Measured on one frozen input, six scans at one engine SHA: 2-5 critique rows per scan, 8 distinct rows across the six, 3 of those 8 seen in only one scan. So a D19 row is evidence about the documentation, but a COUNT of D19 rows is not a quantity — never read a change in it as an improvement or a regression.
D20 ADR Quality: ADR quality is an LLM read of the decision records present — it cannot know about decisions made and never recorded, and its verdict is sampled and advisory.
D21 Naming Consistency: Naming quality is an LLM judgement over a bounded sample — it assesses clarity/consistency of the names it sees, not domain-correctness, and is advisory.
D24 Comment Value: Comment value (WHY vs WHAT) is an LLM judgement over a bounded sample — it is advisory and cannot weigh a comment against the precise code change it was written to explain.
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.
D27 Navigability: Indirection/navigability is structural — it measures hops to follow a call, not whether that indirection buys real flexibility or just ceremony.
D28 Secrets (history): Secret-history scanning sweeps the git log for known patterns — a secret that predates the available history, or never matched a signature, is not found (clean means "nothing matched in the history we can see").
D29 Static Analysis (SAST): SAST findings are pattern-based (semgrep) — it finds classes of bug it has rules for; logic flaws, auth/authorization gaps and issues needing runtime context are out of reach (and clean means "no rule matched").
D30 Dependency Vulnerabilities: CVE matching depends on accurate package/version metadata and on the advisory databases — a vulnerability with no published advisory, or in code not declared as a dependency, is not seen. Coverage needs a RESOLVED graph: an unpinned requirements.txt, or a pom without a resolved build, yields partial coverage rather than a clean verdict. An ecosystem the analyzer cannot scan is reported as unmeasured, never as clean.
D31 IaC & Container Security: IaC scanning checks Dockerfiles/Terraform/Kubernetes against best-practice rules — it cannot see the live cloud account, runtime configuration, or drift between the committed config and what is actually deployed.
D34 Knowledge Freshness: Freshness is decayed commit RECENCY, not comprehension — code read often but rarely committed reads as orphaned, and stable code that genuinely needs no changes is penalised the same as forgotten code; bot/squash commits distort it like the bus factor.
D35 Change Coupling: Change coupling is co-change in COMMITS — files split across separate commits, or coupled only through a shared config/build step, read as uncoupled, and a sweeping commit (rename/format) is excluded so it doesn't couple everything. It shows that files change together, not WHY: a high coupling can be a healthy cohesive pair as readily as a hidden leak.
D40 Network Egress Confinement: Egress confinement is read from committed Kubernetes manifests — a policy applied out-of-band (cluster-default deny, a service mesh, or a cloud firewall/security group off-repo) is invisible, and a present NetworkPolicy is declared config, not proof the cluster admission-controller actually enforces it at runtime.
D41 Kernel & Syscall Confinement: Syscall/MAC confinement is read from committed manifests — a profile applied by a cluster-wide PodSecurity default or a mutating webhook off-repo isn't seen, and a declared seccomp/AppArmor profile is config presence, not proof the node's kernel actually loaded and enforced it.
D43 Malicious Dependencies: Only packages some vulnerability database has already NAMED as malicious are seen — a compromise published in the last hours, or never reported at all, is invisible here, and this dimension reading 10 is not evidence that a dependency is trustworthy. There is no typosquat or dependency-confusion analysis: a package nobody has reported is simply absent from the feeds. Coverage is the dependency scan's: an ecosystem that could not be scanned is disclosed as unmeasured, never as clean.
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.
C4 Data Retention: This control is scored from in-repo evidence only — its real-world effectiveness, exercised only at runtime, is outside a static scan.
M4 Documentation accuracy: Onboarding quality is an LLM read of the docs/setup present — it cannot run the onboarding or measure how long a real new joiner takes; the verdict is sampled and advisory.
P4 Deployment & Rollback: Approval/branch-protection rules live in repository settings the scan cannot see — only their in-repo evidence (config files, workflows) is checked, so a control enforced purely in the host's settings reads as "not evidenced".
P5 DR & Backup: Backup/restore and disaster-recovery readiness is judged from in-repo evidence — a config that exists is not a tested restore, so the absence of positive evidence is reported as "not evidenced", never scored as present.
P6 Release Hygiene: Rollback/observability controls are inferred from repo artefacts (pipelines, dashboards-as-code) — controls configured in external tooling, with no in-repo trace, cannot be credited.
The LLM boundary
LLM-set scores this run (4): D19, D21, D24, M4 (model: Local LLM). For these, a model reads a bounded sample and sets the numeric score; each names its own sample and method on its card. They are sampled and advisory by design: they vary at the margins between runs and are never a deterministic measurement. Every other score in this report is tool-computed at confidence 1.0.
What it measures: How tangled the control flow is — methods with many branches are hard to test and change.
Method: Cyclomatic complexity per method (1 + decision points), computed exhaustively across production source; test projects separated by convention. Deterministic.
268 method(s) exceeded the cyclomatic complexity threshold of 15; the worst was ReqGen.WriteOp at 143. A further 21 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 RespServerSession.ProcessArrayCommands at 161 — they are counted neither in the figure above nor in this dimension's score. 8 files carry no cyclomatic complexity row at all for this reason — every one of their over-threshold methods was excluded, so the exclusion is disclosed nowhere in the file itself: libs/cluster/Session/ClusterCommands.cs (ClusterSession.ProcessClusterCommands at 49), benchmark/Resp.benchmark/ClusterBench/OperationClassifier.cs (OperationClassifier.IsWriteOperation at 40), libs/server/Objects/Types/GarnetObject.cs (GarnetObject.NeedToCreate at 36), libs/server/Objects/SortedSet/SortedSetObject.cs (SortedSetObject.Operate at 29), libs/server/Objects/Hash/HashObject.cs (HashObject.Operate at 23), and 3 more not listed here. They are named here because the per-file figures other dimensions report are taken BEFORE this exclusion, so such a file can show a high maximum complexity elsewhere in this report and nothing here, with nothing to reconcile the two.
+ 261 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 1 body over 120 down to 120 or less in Cyclomatic Complexity — start with ReqGen.WriteOp (cyclomatic 143). — Refactoring it lifts Cyclomatic Complexity from 5.6 to about 5.8/10.
Enforce Cyclomatic Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d1_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: How hard the code is for a person to follow, beyond raw branching.
Method: Cognitive complexity per method (Sonar-style nesting-penalized score), computed exhaustively over production code, excluding test projects. Deterministic.
+ 475 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Bring the 11 bodies over 120 down to 120 or less in Cognitive Complexity — start with LuaRunner.WriteResponse::TryWriteSingleItem (cognitive 247), MainSessionFunctions.InPlaceUpdaterWorker (cognitive 204), LuaRunner.ProcessSingleRespTerm (cognitive 184). — 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 11 together lifts Cognitive Complexity from 3.4 to about 4.6/10, projected with the scoring formula itself and assuming each lands exactly at 120; a cleaner split scores higher.
Enforce Cognitive Complexity in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d2_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D3 · God Classes7.9 / 10Strong✓ Tool-verified
What it measures: Over-large classes that try to do too much ("god classes").
Method: God-class detection by line and method-count thresholds per logical type (partial classes unified), filtered for generated code and registration/contract false positives. Deterministic.
Resolve the 60 TooManyMethods finding(s) in God Classes — start with LuaRunner.Functions.cs (2), BasicCommands.cs, SortedSetOps.cs. — One of this dimension's main actionable groups (60 warning-level).
Resolve the 42 MethodTooLong finding(s) in God Classes — start with LuaRunner.Functions.cs (4), LuaRunner.cs (3), RespServerSessionVectors.cs (3). — One of this dimension's main actionable groups (42 warning-level).
Resolve the 33 FileTooLong finding(s) in God Classes — start with LuaRunner.Functions.cs, TsavoriteLog.cs, AllocatorBase.cs. — One of this dimension's main actionable groups (33 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.
489 duplicated block group(s) detected. A further 33 rows report members as variants of one another; they aggregate block groups already counted above and are not themselves counted. 4 of the 522 are in trees this repository does not ship — vendored, example/demo, fixture and benchmark code — and are ranked below the shipped groups rather than excluded from them: the duplication there is real and is still counted in this dimension's score. The dimensions that publish a production-file census leave those trees out of theirs, so this count is deliberately drawn over the wider population.
+ 167 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 29 Duplicated block (13 lines × 2) finding(s) in Code Duplication — start with GarnetClientExecuteAPI.cs (7), LuaRunner.Functions.cs (2), HashCommands.cs (2). — One of this dimension's main actionable groups (29 warning-level).
Resolve the 24 Duplicated block (11 lines × 2) finding(s) in Code Duplication — start with RMWMethods.cs (2), AsyncPool.cs (2), ReadOptimizedLock.cs. — One of this dimension's main actionable groups (24 warning-level).
Resolve the 22 Duplicated block (7 lines × 2) finding(s) in Code Duplication — start with RespLatencyCommands.cs, RespServerSessionVectors.cs, LuaRunner.cs. — One of this dimension's main actionable groups (22 warning-level).
Enforce Code Duplication in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d4_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D5 · Coupling9.6 / 10Stronggated by 3 serious findings✓ Tool-verified
What it measures: Whether volatile projects sit underneath others that depend on them (so their churn ripples upward), and whether project dependencies form cycles. A widely-depended-on but stable shared/kernel project is healthy, not penalised.
Method: Dependency cycles via elementary-DFS over real .csproj references, plus Martin instability (afferent/efferent) per project. Exhaustive over the reference graph, deterministic.
Coverage: Exhaustive · type-level: afferent/efferent coupling + cycles computed over every production type — the population is all types, not a name convention.
Resolve the 2 Off the main sequence finding(s) in Coupling — start with HdrHistogram.csproj, Tsavorite.core.csproj. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 Unstable project Garnet.cluster finding(s) in Coupling — start with Garnet.cluster.csproj. — One of this dimension's main actionable groups (1 warning-level).
Enforce Coupling in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d5_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether a class's methods are focused on a single responsibility.
Method: LCOM4 cohesion per production class with at least two methods: connected components of methods sharing state or calls, computed syntactically. Deterministic, not a proxy.
Coverage: Exhaustive · type-level: LCOM4 cohesion computed over every production class — the population is all types, not a name convention.
Resolve the 4 Low cohesion finding(s) in Cohesion (LCOM4) — start with DiskANNService.cs, GarnetServerOptions.cs, RangeIndexManager.cs. — 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.
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.
3664 test methods: 3664 unit, 0 integration, 0 BDD, 0 e2e.
✓ On the Gold path — maintain.
Detailed fixes: d9_recommendation.md.
Do you agree with this assessment?
D10 · Test Quality9.9 / 10Stronggated by 40 serious findings✓ Tool-verified
What it measures: Whether the tests truly assert behaviour rather than just running the code.
Method: Per-test assertions, skips, and mock references analyzed via Roslyn; structured skip-reason tags (BUG:/ENV:) separate documented deferrals from debt. Deterministic.
24 skipped (19 with a documented reason), 6 zero-assertion, 29 synchronised by a fixed sleep, no mocking-framework packages referenced (hand-written doubles or no mocking) across 3664 tests. Measured on the C# suite only — at least 2 test source file(s) (.rs, .py) went unread, so its test quality is unmeasured and is not in these counts.
Resolve the 29 Fixed-sleep synchronisation finding(s) in Test Quality — start with RespBlockingCollectionTests.cs (4), CompletionEventTests.cs (4), StateMachineDriverTests.cs (4). — One of this dimension's main actionable groups (29 warning-level).
Resolve the 6 No assertions finding(s) in Test Quality — start with FuzzTargetTests.cs (3), ParallelTests.cs, LuaScriptRunnerTests.cs. — One of this dimension's main actionable groups (6 warning-level).
Resolve the 5 Skipped test finding(s) in Test Quality — start with NativeHashIndexTests.cs (3), MultiDatabaseTests.cs, NativeSnapshotStressTests.cs. — One of this dimension's main actionable groups (5 warning-level).
Enforce Test Quality in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d10_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether 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.
Resolve the 1 Deprecated finding(s) in Dependency Hygiene — start with Directory.Packages.props. — One of this dimension's main actionable groups (1 warning-level).
Enforce Dependency Hygiene in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Verified — provenance only; does not change the score.
Detailed fixes: d12_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any secrets (keys, tokens, passwords) have leaked into the code.
Method: In-process native secret scanner (entropy plus signature patterns) across all tracked files; no external tool. A clean result is a measured 10, not no-data zero. Deterministic.
Resolve the 4 Leaked secret finding(s) in REDACTED Scanning — start with REDACTED (3), REDACTED. — One of this dimension's main actionable groups (4 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 205 packages use a banned license. ★ DEPTH: this repository's MSBuild projects declare 25 direct `PackageReference`(s), and 180 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 package.json, and the licences of those dependencies were NOT read by this pass — a gap in this engine's coverage, not a statement about them. So this result says the graded closure carries no banned licence; it does NOT say this repository's licensing is clear.
What it measures: Files that change often and are also complex — the riskiest hotspots.
Method: Per production file churn times cyclomatic complexity over a rolling window, computed from git and Roslyn/JS/Razor analysis. Exhaustive, deterministic per commit date.
Top hotspots: libs/server/Storage/Functions/MainStore/RMWMethods.cs (7×107=749); libs/server/Resp/Vector/RespServerSessionVectors.cs (5×122=610); libs/host/Configuration/Options.cs (8×51=408) Repeated repair below the complexity floor: libs/server/Resp/Vector/VectorManager.Cleanup.cs (4 of 5 changes were fixes); libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/DeviceLogCommitCheckpointManager.cs (3 of 4 changes were fixes); libs/storage/Tsavorite/cs/src/core/Device/IDevice.cs (3 of 4 changes were fixes)
Resolve the 37 Hotspot finding(s) in Churn × Complexity Hotspots — start with RMWMethods.cs, RespServerSessionVectors.cs, Options.cs. — One of this dimension's main actionable groups (37 warning-level).
Resolve the 6 Repeated repair finding(s) in Churn × Complexity Hotspots — start with VectorManager.Cleanup.cs, DeviceLogCommitCheckpointManager.cs, IDevice.cs. — One of this dimension's main actionable groups (6 warning-level).
Detailed fixes: d15_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D16 · Bus Factor9.5 / 10Exemplary✓ Tool-verified
What it measures: Whether knowledge is concentrated in too few people (the "bus factor").
Method: Living knowledge per author via time-decayed commit attribution (6-month half-life, focus weighting) across largest source files. Deterministic, avoids blame's mechanical-refactor false positives.
36 source file(s) have their living knowledge concentrated in one author (≥90% of recent, decayed contribution). The largest is libs/storage/Tsavorite/cs/benchmark/KV.benchmark/Options.cs. Counted over 707 of the 999 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 · ×4
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.
NoWarnInCsproj — 7 warning codes suppressed in one element · ×11playground/LightEpochLitmus/LightEpochLitmus.csproj:13
NoWarnInCsproj repeated across 21 files · ×3test/standalone/Garnet.test/Garnet.test.csproj:10
+ 10 more group(s) — more in Appendix A; the complete list is findings.md.
What to do
Resolve the 83 EmptyCatchBlock finding(s) in Explicit Debt — start with TsavoriteLog.cs (11), NativeStorageDevice.cs (8), EntryPoint.cs (4). — One of this dimension's main actionable groups (83 issue-level).
Resolve the 28 WriteOnlyPrivateField finding(s) in Explicit Debt — start with AofBench.cs (2), ClientSession.cs (2), StorageErrorHandler.cs (2). — One of this dimension's main actionable groups (28 issue-level).
Resolve the 26 FileScopedPragmaDisable finding(s) in Explicit Debt — start with BitmapManager.cs, HyperLogLog.cs, LogSettings.cs. — One of this dimension's main actionable groups (26 issue-level).
Enforce Explicit Debt in CI to reach Verified (currently Documented). — Hardens enforcement from Documented toward Prevented — provenance only; does not change the score.
Detailed fixes: d17_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the solution is laid out in a sensible, conventional structure.
Method: Solution structure: project count, decomposition, shell-project detection, build success (confirmed failures cap the score); traced to actual .sln files and binaries. Deterministic.
63 projects, 1545 source files, 385172 hand-written lines of code (236570 production / 148602 test — the split is derived per file: test is what its project, its own path, or a compile-guarded region marks as test, and a file carrying no test signal counts as production), 238 inter-project edges (build NOT measured — `dotnet build` did not complete in the analyzer, so the build half of this dimension is unmeasured rather than failed: the score above rests on structure alone and is not capped. The diagnostics that stopped it are named under Limitations.) Measured across 2 solutions loaded as one workspace: `Garnet.slnx`, `libs/storage/Tsavorite/cs/Tsavorite.slnx`.
What it measures: Whether the project's documentation is clear, complete, and useful.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic doc sample (READMEs plus first 25 architecture docs), with two-pass stability filtering. Advisory, sampled.
The documentation is comprehensive for a cloud-native Azure Cosmos DB Garnet Cache project: the repository's READMEs and architecture/design docs are well written (18 README files plus 84 architecture/Docs markdown files), with XML-doc coverage of benchmarks at 31% to 100%, and the site's dedicated FAQ, overview, resiliency, monitoring, and quickstart guides. The main gaps are internal jargon rather than missing content — no overview for the root README (which is a tool-level README) and no contribution guidance; these fall under 'internal-focused' but the document outline confirms all named sections exist. (17 of 25 sampled documents could not be assessed: 2 of 3 evaluation groups failed.)
Detailed fixes: d19_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D20 · ADR Quality0.0 / 10Critical✓ Tool-verified
What it measures: Whether architecture decisions are recorded well (context, decision, consequences).
Method: Per-ADR judgment by language model at low temperature with two-pass stability; confidence is share of ADRs evaluated; enforcement-field presence detected deterministically. Advisory.
What it measures: Whether names — types, methods, variables — are clear and consistent.
Method: Judged by language model at low temperature (0.0-0.1) on a deterministic random symbol sample (fixed size, not exhaustive), with disclosed confidence band. Advisory, sampled.
2 naming inconsistencies across 200 sampled symbols.
Inconsistent naming for the concept of an Address/Offset in the Cluster/Replication domain. 'Worker.Address' uses a noun 'Address' for a network location, while 'ReplicationHistory.replicationOffset' uses 'Offset' for a log position, and 'PersistencInfo.CommittedUntilAddress' uses 'Address' for a log position. While 'Address' can mean network or log position, the mix of 'Address' and 'Offset' for log positions (and the typo in the containing type) creates confusion. Specifically, 'CommittedUntilAddress' is a log position, similar to 'replicationOffset', but named differently.
The field 'CommittedUntilAddress' in 'PersistencInfo' (note typo in type name) and 'replicationOffset' in 'ReplicationHistory' both represent AOF log positions (AofAddress). They use different conceptual names ('Address' vs 'Offset') for the same underlying type and semantic concept (a position in the AOF log).
✓ On the Gold path — maintain.
Detailed fixes: d21_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D24 · Comment ValueExemplary◐ Sampled · advisory
What it measures: Whether comments are worth it — explaining WHY (valuable) rather than WHAT (redundant).
Method: Judged by language model at low temperature (0.0-0.1) on deterministically sampled inline comments with surrounding code; findings verified back to sampled comments by substring match. Advisory, sampled.
2 of 63 projects flagged as possibly oversized/incoherent.
Projects may be oversized for their cohesion
✓ On the Gold path — maintain.
Detailed fixes: d26_recommendation.md · top locations in Appendix A, every location in findings.md.
Do you agree with this assessment?
D27 · Navigability8.7 / 10Strong✓ Tool-verified
What it measures: How far you must trace to follow a call — low indirection and co-located slices read easier.
Method: Call indirection (interface hops, cross-namespace calls, slice-locality scaled) over a sampled set of method invocations, size-aware baseline. Sampled; confidence discounted by symbol-resolution gaps. C# also names each pass-through layer (a class whose every public method only forwards its own parameters to one collaborator) as a located finding; the score is not affected.
Coverage: Slice locality from the first namespace segments, SAMPLED (≤400 methods) — not exhaustive.
57 % of calls cross a namespace and 1 % go through an interface, but 87 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: large — vertical-slice locality expected.
What to do
Improve Navigability — currently 8.7/10. — 57 % of calls cross a namespace and 1 % go through an interface, but 87 % of collaborators are co-located — so a call's collaborators sit together and tracing stays easy. Baseline: large — vertical-slice locality expected.
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 High secret finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Secrets (history) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 Rotate the exposed credentials finding(s) in Secrets (history). — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d28_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Real static-analysis (SAST) findings — likely security bugs in the code, any language.
Method: Polyglot static analysis via semgrep across the repo using the pinned, image-baked p/security-audit + p/owasp-top-ten rulesets (no scan-time registry fetch); severity rules (ERROR/WARNING/INFO) map to a full-band severity-weighted score. Exhaustive, deterministic; degrades on parse failure.
Coverage: semgrep pattern rules over all files — exhaustive for the rule set, blind to classes of bug without a rule (clean = no rule matched).
6 finding(s): 0 critical, 4 high, 2 medium, 0 low. semgrep hit a parse error in 127 file(s) — `benchmark/BDN.benchmark/Diagnostics/CpuDiagnoser.cs` (line 47, line 49, line 50, …), `benchmark/BDN.benchmark/Operations/JsonOperations.cs` (line 105), `benchmark/BDN.benchmark/Program.cs` (line 49), `benchmark/Resp.benchmark/OfflineBench/AOFBench/AofGen.cs` (lines 12–13, line 20, line 489), `benchmark/Resp.benchmark/scripts/nvme-raid0-matrix.sh` (line 57, line 157), … (+122 more) — so no absence of findings in the named regions is evidence of anything; rows reported elsewhere in those files are real. Fix the syntax error (or exclude the file deliberately) and re-scan to cover them. In 28 of those file(s) — `benchmark/BDN.benchmark/Diagnostics/CpuDiagnoser.cs`, `benchmark/Resp.benchmark/OfflineBench/AOFBench/AofGen.cs`, `libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncDriverStore.cs`, `libs/cluster/Server/Replication/PrimaryOps/DiskbasedReplication/ReplicaSyncSession.cs`, `libs/cluster/Server/Replication/PrimaryOps/DisklessReplication/ReplicationSnapshotIterator.cs`, … (+23 more) — the break is a C# primary constructor, which semgrep's grammar cannot parse and which hides the type from every rule scoped to it; those files were re-scanned from a shadow copy with the constructor's parameter list blanked (line and column preserving), which restores the type to the rules, and 0 additional row(s) came from that pass. Only the header's own parameter list is unread in them. In 3 of those file(s) — `libs/server/Objects/SortedSet/SortedSetObjectImpl.cs`, `libs/server/Resp/MGetReadArgBatch.cs`, `libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs` — the break is at a TYPE DECLARATION (a C# primary constructor semgrep's grammar cannot parse), so the loss is wider than the named lines: rules scoped to that type see no type to scope to and are blind over its whole body, while rules matching statements keep working there. Absence of a type-scoped finding in those types is not evidence of anything. Separately, one or more rules could not re-parse an embedded snippet in 7 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
What to do
Resolve the 2 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Resolve the 1 REDACTED finding(s) in Static Analysis (SAST) — start with REDACTED. — One of this dimension's main actionable groups (1 issue-level).
Detailed fixes: d29_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether any dependency has a known published vulnerability (CVE), direct or transitive, in ANY ecosystem the repository declares — Dart pub, Elixir and Erlang via Hex, Go modules, Java and Kotlin via Maven/Gradle, JavaScript/npm, .NET/NuGet, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift.
Method: Dependency-CVE scan across every ecosystem the repository declares, scored ONCE. Three sources are unioned and deduplicated by advisory identity (rule id + alias closure, CVE<->GHSA) scoped to package+version, keeping the worst severity: `osv-scanner --recursive` over osv.dev for Dart pub, Elixir/Hex (and Erlang, whose `rebar.lock` syft first converts to a CycloneDX SBOM the scanner reads, with rows attributed back to the lock), Go, Java and Kotlin via Maven/Gradle (and Scala, whose sbt build's pinned direct declarations are written into a CycloneDX SBOM the scanner reads, with rows attributed back to the build file), npm, PHP/Composer, Python/PyPI, RubyGems, Rust/Cargo and Swift; `trivy fs --scanners vuln` for npm lockfiles; and `dotnet list package --vulnerable --include-transitive` for NuGet (with per-advisory collapse of the project x target-framework fan-out), plus a DECLARED-dependency arm that resolves a published gem's gemspec against rubygems.org where no Gemfile.lock is committed. `SeverityScore(c,h,m,l, normalizer 8.0)`. NotApplicable only when NO ecosystem is readable; if any applicable ecosystem could not be scanned the findings are REPORTED and the score is withheld. Supersedes the npm and OSV arms, retired 2026-09-05.
Resolve the 20 Medium IaC finding(s) in IaC & Container Security — start with REDACTED (4), REDACTED (4), REDACTED (4). — One of this dimension's main actionable groups (20 warning-level).
Resolve the 4 High IaC finding(s) in IaC & Container Security — start with REDACTED, REDACTED, REDACTED. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 12 Low IaC finding(s) in IaC & Container Security — start with REDACTED (6), REDACTED, REDACTED. — One of this dimension's main actionable groups (12 recommendation-level).
Detailed fixes: d31_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether anyone still has living knowledge of each file, or it has been orphaned — last understood long ago by someone now gone quiet. The sibling of the bus factor: D16 asks who owns it, D34 asks whether anyone still knows it.
Method: File orphaning as total living-knowledge decay below one focused-commit's worth within a year, computed per-file from the D16 decay model. Exhaustive, deterministic over fixed history.
51 of 707 significant source file(s) are orphaned — their living knowledge has decayed to nothing, so no one currently understands them. The largest is modules/GarnetJSON/JSONPath/JsonPath.cs. Counted over 707 of the 999 production source files in this repository: the rest are under the ~2,400-byte size floor this dimension measures over.
Resolve the 4 Orphaned knowledge finding(s) in Knowledge Freshness — start with JsonPath.cs, RespCommandKeySpecification.cs, RespCommandsInfo.cs. — One of this dimension's main actionable groups (4 issue-level).
Resolve the 47 Orphaned file finding(s) in Knowledge Freshness — start with QueryExpression.cs, RoaringBitmap.cs, RespCommandDocs.cs. — One of this dimension's main actionable groups (47 recommendation-level).
Resolve the 1 Further orphaned files (smaller) finding(s) in Knowledge Freshness. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d34_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether files that change together actually belong together — pairs that repeatedly co-change in git history despite having no explicit code dependency, surfacing the hidden/logical coupling (and boundaries in the wrong place) a static scan can't see.
Method: Pairwise co-occurrence over the per-commit file sets in git history (production source only — tests and generated dropped): Degree-of-Coupling = shared ÷ min individual revisions, reported above noise floors (each file ≥10 revisions, ≥5 shared commits, ≥50% strength); sweeping commits excluded. Deterministic over fixed history.
Coverage: Population: PRODUCTION source files only — test and generated files are dropped before pairing, so a class co-changing with its own test (trivially ~100%) can't drown the real production↔production coupling. Pairs ranked by Degree-of-Coupling. A non-source file is never a coupling PARTICIPANT either: documentation, schemas, config and data files are dropped with the rest, so a code↔docs pair — a command and the reference page that restates it — is not reported however strongly the two co-change; nor is coupling that runs THROUGH a build step or config file.
Resolve the 5 Change coupling finding(s) in Change Coupling — start with SetObject.cs (2), SortedSetCommands.cs, Gossip.cs. — One of this dimension's main actionable groups (5 warning-level).
Resolve the 1 Change-coupling hub finding(s) in Change Coupling — start with ReplicationManager.cs. — One of this dimension's main actionable groups (1 warning-level).
Detailed fixes: d35_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the build pipeline provides supply-chain integrity — generated provenance/attestation, signed artifacts (cosign/sigstore), an SBOM, and pinned build actions. Presence of the configuration, not a runtime guarantee.
Method: Supply-chain provenance/signing read deterministically from CI/build config (.github/workflows, .gitlab-ci.yml, azure-pipelines, Jenkinsfile, .circleci) + the release surface: four signals — generated provenance/attestation (SLSA/in-toto/actions-attest), artifact signing (cosign/sigstore/gitsign), an SBOM (syft/sbom-action/*.spdx.json/*.cdx.json), and SHA-pinned build actions — scored 10·present/denom. NotApplicable without a build pipeline. Detects configuration presence, not runtime enforcement.
Resolve the 2 REDACTED finding(s) in Supply-chain Provenance & Signing — start with REDACTED, REDACTED. — One of this dimension's main actionable groups (2 warning-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Resolve the 1 REDACTED finding(s) in Supply-chain Provenance & Signing. — One of this dimension's main actionable groups (1 recommendation-level).
Detailed fixes: d36_recommendation.md · top locations in Appendix A, every location in findings.md.
What it measures: Whether the repository publishes a coordinated-vulnerability-disclosure policy (SECURITY.md or security.txt) with a reporting contact, so finders know how to report a vulnerability. Presence of a policy file with a contact, not whether the policy is adequate or honoured.
Method: Vulnerability-disclosure policy read deterministically from the repo: a SECURITY.md (root/.github/docs) or .well-known/security.txt / security.txt, regex-checked for a reporting contact (email / URL / mailto). Present + contact → 10; present without a contact → 4; NotApplicable when no policy file exists (it may live off-repo). Detects the policy file's presence + contact, not its adequacy.
What it measures: Whether Kubernetes workloads restrict network EGRESS with a NetworkPolicy (or Cilium policy), limiting where a compromised pod can send data or reach a command-and-control server. Presence of committed egress-restricting policy, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn — language-agnostic): Kubernetes workloads gate applicability; credits a NetworkPolicy / Cilium policy that restricts egress (policyTypes: [Egress] / egress rules). Reward-leaning (neutral floor climbing to 10, never a deduction — baseline misconfigs stay with D31). Deterministic.
What it measures: Whether Kubernetes workloads confine the kernel boundary — a seccomp profile (RuntimeDefault/Localhost) plus an AppArmor/SELinux mandatory-access-control layer — shrinking the syscall attack surface a container escape would use. Presence of committed confinement config, not runtime enforcement.
Method: Deterministic YAML-manifest inspection (no external tool, no Roslyn): on Kubernetes workloads, credits a seccomp profile (RuntimeDefault/Localhost) and an AppArmor/SELinux MAC layer. Reward-leaning (neutral floor climbing to 10); NotApplicable without workloads. Deterministic.
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.
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.
The namespaces Tsavorite.core ↔ Tsavorite.core.Allocator.ObjectSerialization depend on each other. The lightest dependency in the cycle is Tsavorite.core → Tsavorite.core.Allocator.ObjectSerialization (Tsavorite.core.CachedChunkSerializer → Tsavorite.core.Allocator.ObjectSerialization.ChunkedObjectSerializer, 3 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.Chunked.cs:8
The namespaces HdrHistogram ↔ HdrHistogram.Iteration depend on each other. The lightest dependency in the cycle is HdrHistogram → HdrHistogram.Iteration (HdrHistogram.HistogramBase → HdrHistogram.Iteration.HistogramIterationValue, 2 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — metrics/HdrHistogram/HistogramBase.cs:15
The namespaces Garnet.common ↔ Garnet.networking ↔ Garnet.server ↔ Garnet.server.ACL ↔ Garnet.server.Auth ↔ Garnet.server.Auth.Settings ↔ Garnet.server.Custom ↔ Garnet.server.Lua depend on each other. The lightest dependency in the cycle is Garnet.common → Garnet.server (Garnet.common.LightClient → Garnet.server.LightClientTcpNetworkHandler, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface. — libs/common/LightClient.cs:12
What to do
Break namespace cycles inside a project by moving the shared type to a namespace both sides can use, or by inverting the back edge behind an interface.
Other · Architecture — Whether dependencies point inward (Domain ← Application ← Infrastructure/Web) — the clean-architecture dependency rule, checked across the project graph.
Method: Layer violations by name-segment inference (Domain/Core to Application to Infrastructure/Web) over the project-reference graph. Exhaustive over all projects, deterministic.
Other · Architecture — Whether the codebase has a recognisable, scale-appropriate structure (a named architectural style, or modular enough for its size) rather than being an ad-hoc ball of mud.
Method: Roslyn plus csproj analysis: architecture style detection (DDD, clean, vertical-slice, CQRS) and structure fitness for repo size. Deterministic.
Other · Architecture — Whether interfaces stay focused rather than fat — the Interface-Segregation principle (SOLID 'I').
Method: Roslyn scan: public interface declared-member counts (accessors fold into their property/event); fat-interface threshold (over 15 declared members) flagged per type. Each finding also reports the distinct-OPERATION count — members counted by name, so an overload group counts once — which decides whether it states the caller-side ISP harm or the implementer-side burden of an overload set. TypeScript: exported interfaces that declare behaviour, counted over their REQUIRED operations (method signatures and function-typed properties with no `?`, once per signature) — data-shape interfaces and ambient .d.ts declarations are outside the population; JavaScript declares no interfaces and is not applicable. Deterministic, type-level.
`INetworkSender` declares 18 members: `GetMaxSizeSettings`, `RemoteEndpointName`, `LocalEndpointName`, `IsLocalConnection`, `Enter`, `EnterAndGetResponseObject`, `Exit`, `ExitAndReturnResponseObject`, `GetResponseObject`, `ReturnResponseObject`, `GetResponseObjectHead`, `GetResponseObjectTail`, `SendResponse`, `SendResponse`, `SendCallback`, `DisposeNetworkSender`, `Throttle`, `TryClose`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 18 declarations carry 17 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 17 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — libs/common/Networking/INetworkSender.cs:11
`IGarnetApi` declares 137 members: `GETEX`, `SET`, `SET`, `SET_Conditional`, `SET_Conditional`, `SET_ETagConditional`, `DEL_ETagConditional`, `SET`, `SET`, `SET`, `SET`, `SETEX`, `SETEX`, `SETRANGE`, `MSET_Conditional`, `APPEND`, `APPEND`, `RENAME`, `RENAMENX`, `EXISTS`, `EXISTS`, `EXPIRE`, `EXPIRE`, `EXPIRE`, `EXPIREAT`, `PEXPIREAT`, `PERSIST`, `Increment`, `Increment`, `Decrement`, `IncrementByFloat`, `IncrementByFloat`, `DELETE`, `DELIFEXPIM`, `GETDEL`, `TYPE`, `MEMORYUSAGE`, `OBJECT`, `SortedSetAdd`, `SortedSetAdd`, and 97 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 137 declarations carry 88 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 88 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — libs/server/API/IGarnetApi.cs:14
`IGarnetReadApi` declares 88 members: `GET`, `GETForMemoryResult`, `GET`, `GET`, `LCS`, `GETRANGE`, `TTL`, `EXPIRETIME`, `SortedSetLength`, `SortedSetLength`, `SortedSetRange`, `SortedSetScore`, `SortedSetScores`, `SortedSetCount`, `SortedSetCount`, `SortedSetLengthByValue`, `SortedSetRank`, `SortedSetRank`, `SortedSetRandomMember`, `SortedSetRange`, `SortedSetDifference`, `SortedSetUnion`, `SortedSetScan`, `SortedSetIntersect`, `SortedSetIntersectLength`, `SortedSetTimeToLive`, `SortedSetTimeToLive`, `GeoCommands`, `GeoSearchReadOnly`, `ListLength`, `ListLength`, `ListRange`, `ListIndex`, `SetLength`, `SetLength`, `SetMembers`, `SetMembers`, `SetIsMember`, `SetIsMember`, `SetScan`, and 48 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 88 declarations carry 67 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 67 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — libs/server/API/IGarnetApi.cs:1392
`IClusterProvider` declares 24 members: `CreateClusterSession`, `AllowDataLoss`, `FlushConfig`, `GetGossipStats`, `GetReplicationInfo`, `GetBufferPoolStats`, `GetPrimaryInfo`, `GetReplicaInfo`, `PurgeBufferPool`, `ClusterPublishAsync`, `IsPrimary`, `IsReplica`, `IsReplica`, `OnCheckpointInitiated`, `RecoverAsync`, `ResetGossipStats`, `AddNewCheckpointEntry`, `SafeTruncateAOF`, `Start`, `UpdateClusterAuth`, `GetCheckpointInfo`, `GetRunId`, `PreventRoleChange`, `AllowRoleChange`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 24 declarations carry 23 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 23 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — libs/server/Cluster/IClusterProvider.cs:18
`IClusterSession` declares 21 members: `RemoteNodeId`, `ReadOnlySession`, `IsInternalWriteSession`, `IsReplicating`, `Server`, `SetReadOnlySession`, `SetReadWriteSession`, `SetInternalWriteSession`, `LocalCurrentEpoch`, `AcquireCurrentEpoch`, `ReleaseCurrentEpoch`, `ProcessClusterCommands`, `ResetCachedSlotVerificationResult`, `NetworkIterativeSlotVerify`, `WriteCachedSlotVerificationMessage`, `NetworkMultiKeySlotVerify`, `NetworkMultiKeySlotVerifyNoResponse`, `SetUserHandle`, `UnsafeSetConfig`, `Dispose`, `ProcessPrimaryStream`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — libs/server/Cluster/IClusterSession.cs:13
`IDatabaseManager` declares 40 members: `DefaultDatabase`, `Store`, `AppendOnlyFile`, `LastSaveTime`, `SizeTracker`, `VersionMap`, `DatabaseCount`, `MaxDatabaseId`, `TryGetOrAddDatabase`, `TryPauseCheckpoints`, `ResumeCheckpoints`, `RecoverCheckpointAsync`, `TakeCheckpointAsync`, `TakeOnDemandCheckpointAsync`, `TaskCheckpointBasedOnAofSizeLimitAsync`, `CommitToAofAsync`, `CommitToAofAsync`, `WaitForCommitToAofAsync`, `RecoverAOFAsync`, `VerifyRecoveryIsComplete`, `ReplayAOF`, `DoCompactionAsync`, `GrowIndexesIfNeededAsync`, `ExecuteObjectCollection`, `ExpiredKeyDeletionScan`, `StartSizeTrackers`, `Reset`, `ResetRevivificationStats`, `EnqueueCommit`, `GetDatabasesSnapshot`, `TryGetDatabase`, `FlushDatabase`, `FlushAllDatabases`, `TrySwapDatabases`, `Clone`, `CreateFunctionsState`, `ExpiredKeyDeletionScan`, `GetKeyspaceStats`, `CollectHybridLogStats`, `RecoverVectorSets`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 40 declarations carry 38 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 38 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — libs/server/Databases/IDatabaseManager.cs:16
`IAllocator<TStoreFunctions>` declares 17 members under just 14 distinct name(s): `GetBase`, `HasObjectLog`, `InitializeRecord`, `GetRMWCopyRecordSize`, `GetRMWInitialRecordSize`, `GetUpsertRecordSize`, `GetUpsertRecordSize`, `GetUpsertRecordSize`, `GetDeleteRecordSize`, `CreateLogRecord`, `CreateLogRecord`, `CreateRemappedLogRecordOverPinnedTransientMemory`, `TransientObjectIdMap`, `GetPageObjectIdMap`, `OnDispose`, `OnDisposeDiskRecord`, `EvictRecordsInRange`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. That is an OVERLOAD SET, not 17 separate responsibilities: a caller binds to 14 operation(s) and uses the overload it selected, so the Interface-Segregation harm does NOT apply on the caller's side and splitting this into role-interfaces would scatter one operation without relieving anything. The burden that does remain is the IMPLEMENTER's — all 17 signatures must be written and kept in step. Reduce it by collapsing overloads (optional or default parameters, or an options object) rather than by segregating the interface. — libs/storage/Tsavorite/cs/src/core/Allocator/IAllocator.cs:37
`ISourceLogRecord` declares 29 members: `PhysicalAddress`, `InfoRef`, `Info`, `DataHeader`, `RecordType`, `Namespace`, `ObjectIdMap`, `IsSet`, `Key`, `IsPinnedKey`, `PinnedKeyPointer`, `KeyOverflow`, `ValueSpan`, `ValueObject`, `IsPinnedValue`, `PinnedValuePointer`, `ValueOverflow`, `ValueSpanByteAndMemory`, `ETag`, `Expiration`, `ClearValueIfHeap`, `IsMemoryLogRecord`, `AsMemoryLogRecordRef`, `IsDiskLogRecord`, `AsDiskLogRecordRef`, `GetRecordFieldInfo`, `AllocatedSize`, `ActualSize`, `CalculateHeapMemorySize`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — libs/storage/Tsavorite/cs/src/core/Allocator/ISourceLogRecord.cs:10
`ITsavoriteContext<TKey, TInput, TOutput, TContext, TFunctions, TStoreFunctions, TAllocator>` declares 41 members under just 14 distinct name(s): `IsNull`, `Session`, `CompletePending`, `CompletePendingWithOutputs`, `CompletePendingAsync`, `CompletePendingWithOutputsAsync`, `Read`, `Read`, `Read`, `Read`, `Read`, `Read`, `Read`, `ReadAtAddress`, `ReadAtAddress`, `ReadWithPrefetch`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `RMW`, `RMW`, `RMW`, `RMW`, `RMW`, `RMW`, `Delete`, `Delete`, `ResetModified`, and 1 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. That is an OVERLOAD SET, not 41 separate responsibilities: a caller binds to 14 operation(s) and uses the overload it selected, so the Interface-Segregation harm does NOT apply on the caller's side and splitting this into role-interfaces would scatter one operation without relieving anything. The burden that does remain is the IMPLEMENTER's — all 41 signatures must be written and kept in step. Reduce it by collapsing overloads (optional or default parameters, or an options object) rather than by segregating the interface. — libs/storage/Tsavorite/cs/src/core/ClientSession/ITsavoriteContext.cs:28
`IDevice` declares 23 members: `SectorSize`, `FileName`, `Capacity`, `SegmentSize`, `StartSegment`, `EndSegment`, `ThrottleLimit`, `Initialize`, `TryComplete`, `TryCompleteMine`, `Throttle`, `WriteAsync`, `ReadAsync`, `WriteAsync`, `ReadAsync`, `TruncateUntilAddressAsync`, `TruncateUntilAddress`, `TruncateUntilSegmentAsync`, `TruncateUntilSegment`, `RemoveSegmentAsync`, `RemoveSegment`, `GetFileSize`, `Reset`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 23 declarations carry 21 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 21 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — libs/storage/Tsavorite/cs/src/core/Device/IDevice.cs:30
`ISessionFunctions<TInput, TOutput, TContext>` declares 31 members: `Reader`, `ReadCompletionCallback`, `InitialWriter`, `InitialWriter`, `InitialWriter`, `PostInitialWriter`, `PostInitialWriter`, `PostInitialWriter`, `InPlaceWriter`, `InPlaceWriter`, `InPlaceWriter`, `PostUpsertOperation`, `PostUpsertOperation`, `NeedInitialUpdate`, `InitialUpdater`, `PostInitialUpdater`, `NeedCopyUpdate`, `CopyUpdater`, `PostCopyUpdater`, `InPlaceUpdater`, `PostRMWOperation`, `RMWCompletionCallback`, `InitialDeleter`, `PostInitialDeleter`, `InPlaceDeleter`, `PostDeleteOperation`, `ConvertOutputToHeap`, `PreSingleKeyConsistentRead`, `PostSingleKeyConsistentReadCallback`, `PreBatchKeyConsistentReadCallback`, `PostBatchKeyConsistentReadCallback`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 31 declarations carry 24 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 24 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctions.cs:11
`ICheckpointManager` declares 20 members: `PerformAutomaticCleanup`, `GetCookie`, `InitializeIndexCheckpoint`, `InitializeLogCheckpoint`, `CommitIndexCheckpoint`, `CleanupIndexCheckpoint`, `CommitLogCheckpointMetadata`, `CleanupLogCheckpoint`, `CheckpointVersionShiftStart`, `CheckpointVersionShiftEnd`, `GetIndexCheckpointMetadata`, `GetLogCheckpointMetadata`, `GetIndexCheckpointTokens`, `GetLogCheckpointTokens`, `GetIndexDevice`, `GetSnapshotLogDevice`, `GetSnapshotObjectLogDevice`, `Purge`, `PurgeAll`, `OnRecovery`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — libs/storage/Tsavorite/cs/src/core/Index/Recovery/ICheckpointManager.cs:31
`IStoreFunctions` declares 23 members: `GetKeyHashCode64`, `KeysEqual`, `CreateValueObjectSerializer`, `HasValueSerializer`, `BeginSerializeValue`, `BeginDeserializeValue`, `CallOnFlush`, `CallOnEvict`, `CallOnDiskRead`, `CallPostCopyToTail`, `CallOnTruncate`, `OnDispose`, `OnDisposeDiskRecord`, `OnFlush`, `OnEvict`, `OnDiskRead`, `OnRecovery`, `OnRecoverySnapshotRead`, `OnCheckpoint`, `PostCopyToTail`, `OnTruncate`, `SetCheckpointCompletedCallback`, `OnCheckpointCompleted`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces. — libs/storage/Tsavorite/cs/src/core/Index/StoreFunctions/IStoreFunctions.cs:12
What to do
Split fat interfaces into focused role-interfaces so clients depend only on what they use.
Where the width is an overload set rather than separate responsibilities, collapse the overloads instead — segregating those relieves no caller.
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.
Do you agree with this assessment?
C1 · Data Protection0.0 / 10Critical✓ Tool-verified
Other · Security — Whether sensitive data is encrypted at rest and in transit and keys are vaulted.
Method: Roslyn plus filesystem scan: encryption presence (EF ColumnEncryption, key-vault references, HTTPS enforcement) and key-derivation KDF detection. Deterministic.
No data-protection or encryption usage (ASP.NET Data Protection, AES, column encryption, PBKDF2) was found — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.
What to do
Encrypt sensitive data at rest (ASP.NET Core Data Protection / column encryption) and manage keys in a vault. Skip if delegated to infra (Postgres TDE, KMS, etc.).
Enforce HTTPS (UseHttpsRedirection / RequireHttpsMetadata) so data in transit is always encrypted.
Do you agree with this assessment?
C2 · Access Controls7.0 / 10Strong✓ Tool-verified
Other · Security — Whether access is authorized by default — a framework authorization attribute/decorator or policy, or imperative guard methods (throw-on-violation) called from handlers.
Method: Roslyn scan: [Authorize] usage and authorization policies, plus imperative throw-on-violation guard methods detected via syntax. Deterministic.
Authorization IS enforced here (by imperative guard methods that throw on violation) — this is NOT a claim that the code is unprotected. What's missing is a NAMED rule set: the guards encode the access rules inline, so the rules can't be listed, reviewed or tested apart from the call sites that apply them. Recommendation, not a defect.
What to do
Name the access rules — give each one a named predicate/policy object your guards consult, so the rule set can be reviewed and unit-tested independently of the call sites that enforce it.
Do you agree with this assessment?
C4 · Data Retention10.0 / 10Exemplary✓ Tool-verified
Other · Security — Whether data has a defined lifetime — retention periods, TTLs, cleanup jobs (storage limitation).
Method: Roslyn scan: retention/TTL configuration presence in schema; CascadeDelete detected but not scored as retention control. Deterministic, gated by PII presence.
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.
A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface. (×35) — benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:22, benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:23, benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:35, …
A placeholder string ("Lorem ipsum dolor sit amet, consectetur …") is still in shipped code — typical of generated boilerplate that was never filled in. — samples/ETag/Caching.cs:182
What to do
Finish or delete NotImplementedException stubs and replace placeholder literals before shipping.
Other · Code Health — Unfinished work detected by code SHAPE, not keywords: members that only throw a "not implemented" exception, methods that take inputs and return a constant, async methods that never await, dead `if (false)` / `#if false` branches, and skeleton types most of whose members are holes. A real, objective slice of technical debt.
Method: Roslyn syntax scan: incompleteness by code shape (constant-returning methods, async-never-await, #if false branches, guards that return what the code already falls through to, tests an earlier guard already decided, comparisons against NaN, skeleton types), not keyword-gated. Deterministic, code-shape heuristic.
`EmbeddedNetworkHandler` has 3 unfinished members out of 6 declared members (methods, properties, indexers and events, whether or not each carries a body) — a scaffolded type that was never implemented. — benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:13
`RemoteEndpointName` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:22
`LocalEndpointName` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:23
`TryClose` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:35
The `if` and its `else` contain the same 1 statement, so no input can make the condition matter. Implement the distinction that was intended, or drop the branch and keep the body. — libs/common/LightClientRequest.cs:90
`SendResponse` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — libs/common/Networking/GarnetTcpNetworkSender.cs:270
`SendCallback` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — libs/common/Networking/GarnetTcpNetworkSender.cs:276
`RedisConfigProvider` has 4 unfinished members out of 7 declared members (methods, properties, indexers and events, whether or not each carries a body) — a scaffolded type that was never implemented. — libs/host/Configuration/ConfigProviders.cs:227
`TryExportOptions` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — libs/host/Configuration/ConfigProviders.cs:252
`TrySerializeOptions` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — libs/host/Configuration/ConfigProviders.cs:257
`TryDeserializeOptions` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — libs/host/Configuration/ConfigProviders.cs:259, libs/host/Configuration/ConfigProviders.cs:261
`TransformBack` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. (×2) — libs/host/Configuration/GarnetCustomTransformers.cs:63, libs/host/Configuration/GarnetCustomTransformers.cs:103
The only thing establishing that `beginAddress` is long enough before it is indexed is a `Debug.Assert`, which is `[Conditional("DEBUG")]` — the compiler deletes the call from Release, so the build your users install indexes `beginAddress` with no length check at all and throws at the indexer instead of failing diagnosably. `beginAddress` comes from outside this method, so its length is a contract, not something this code can see. Bound it with a check that ships (`if (beginAddress.Count < n) throw …`, or `ArgumentOutOfRangeException.ThrowIfLessThan`), and keep the assert for the invariant you believe holds. — libs/server/AOF/GarnetLog.cs:461
`SerializedLength` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — libs/server/InputHeader.cs:626
`CopyTo` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — libs/server/InputHeader.cs:645
`DeserializeFrom` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — libs/server/InputHeader.cs:646
The only thing establishing that `info` is long enough before it is indexed is a `Debug.Assert`, which is `[Conditional("DEBUG")]` — the compiler deletes the call from Release, so the build your users install indexes `info` with no length check at all and throws at the indexer instead of failing diagnosably. `info` comes from outside this method, so its length is a contract, not something this code can see. Bound it with a check that ships (`if (info.Count < n) throw …`, or `ArgumentOutOfRangeException.ThrowIfLessThan`), and keep the assert for the invariant you believe holds. — libs/server/Metrics/Info/GarnetInfoMetrics.cs:493
The only thing establishing that `assembliesList` is long enough before it is indexed is a `Debug.Assert`, which is `[Conditional("DEBUG")]` — the compiler deletes the call from Release, so the build your users install indexes `assembliesList` with no length check at all and throws at the indexer instead of failing diagnosably. `assembliesList` comes from outside this method, so its length is a contract, not something this code can see. Bound it with a check that ships (`if (assembliesList.Count < n) throw …`, or `ArgumentOutOfRangeException.ThrowIfLessThan`), and keep the assert for the invariant you believe holds. — libs/server/Resp/AdminCommands.cs:607
The first 1 statement of the `if` and of the `else` are identical, so it runs on both paths regardless of the condition. Lift it above the `if` — leaving it duplicated inside makes the branches read as though they handled this differently. — libs/server/Resp/ArrayCommands.cs:320
1 guard above `return found;` also returns `found`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — libs/server/Resp/Vector/AttributeExtractor.cs:88
1 guard above `return default;` also returns `default`, so no input can make it matter. Implement the distinction that was intended, or delete the guard. — libs/server/Resp/Vector/AttributeExtractor.cs:137
`HandleIndexSizeChangeAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work. — libs/server/ServerConfig.cs:263
Code inside a `#if false` block is permanently excluded from the build — disabled code that should be removed or restored. — libs/storage/Tsavorite/cs/src/core/Allocator/LogRecord.cs:1712
`IsDeleted` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in. — libs/storage/Tsavorite/cs/src/core/Compaction/ICompactionFunctions.cs:25
`SimpleAsyncResult` has 4 unfinished members out of 4 declared members (methods, properties, indexers and events, whether or not each carries a body) — a scaffolded type that was never implemented. — libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:543
`AsyncState` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:550
`AsyncWaitHandle` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:552
`CompletedSynchronously` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:554
`IsCompleted` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:556
`SetCountAtIndex` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — metrics/HdrHistogram/LongConcurrentHistogram.cs:129
`Scan` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — modules/GarnetJSON/GarnetJsonObject.cs:133
Control only reaches here when `leftValue is null` is false, because the guard on line 275 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test. — modules/GarnetJSON/JSONPath/QueryExpression.cs:287
`NoOpCommandRead` has 5 unfinished members out of 6 declared members (methods, properties, indexers and events, whether or not each carries a body) — a scaffolded type that was never implemented. — modules/NoOpModule/NoOpCommandRead.cs:13
`GetInitialLength` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — modules/NoOpModule/NoOpCommandRead.cs:16
`GetLength` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — modules/NoOpModule/NoOpCommandRead.cs:19
`InitialUpdater` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — modules/NoOpModule/NoOpCommandRead.cs:23
`InPlaceUpdater` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — modules/NoOpModule/NoOpCommandRead.cs:28
`CopyUpdater` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface. — modules/NoOpModule/NoOpCommandRead.cs:33
What to do
Finish or delete the unfinished stubs (NotImplementedException / empty / constant-returning bodies) — they are dead surface that looks live.
Clear the softer debt: remove commented-out code and dead branches, re-enable or delete skipped tests, and replace blanket warning suppressions with targeted ones.
Maturity · Maturity — Whether the repo and its projects have a README, and whether it's substantive and current.
Method: Filesystem scan: README presence, word count, and headings for depth; git history for staleness. Exhaustive across root and project dirs, deterministic.
What to do
Add a build/run (quick start) section to the root README — the first thing a newcomer needs.
Explain in the README how to run the tests. Add a section called Testing to the README in the repository's top folder, saying how to run the test suite.
Add a README to the 57 of 63 project(s) that lack one — worth up to 1.8 pts.
Maturity · Maturity — Whether key decisions (ADRs) and the high-level shape (C4/diagrams) are written down.
Method: Filesystem scan: ADR folder/naming conventions or content, plus Mermaid/PlantUML/C4/architecture.md discovery. Exhaustive, deterministic.
No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
What to do
Record your significant design decisions. Write one short document per decision, giving its date, the situation, the decision and its consequences, and keep them together with your other design documents. A docs/adr folder with each file named by number and title is the easiest place to find them.
Maturity · Maturity — Whether the repo is organised deliberately — src/test separation and consistent project naming.
Method: Filesystem scan: src/test folder separation and namespace-prefix consistency (majority RootNamespace agreement). Exhaustive across projects, deterministic.
Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
Only 29/63 projects share a common root namespace — the code's module identity is inconsistent.
What to do
Group production code under src/ (or split deliberately, e.g. backend/ + frontend/) so production and tooling code aren't mixed at the root.
Adopt a consistent root-namespace convention (a shared prefix, e.g. Acme.*); short project-file/directory names are fine as long as the RootNamespace is uniform.
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.
website/README.md documents the environment variable `USE_SSH`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/README.md:32
benchmark/Azure.benchmark/01-resources/README.md runs `.\01-resources\deploy-common-resources.ps1`, but `01-resources/deploy-common-resources.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmark/Azure.benchmark/01-resources/README.md:34
benchmark/Azure.benchmark/01-resources/README.md names `01-resources/security/manifest.json`, but no file or folder `01-resources/security/manifest.json` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmark/Azure.benchmark/01-resources/README.md:130
benchmark/Azure.benchmark/02-platform/README.md runs `pwsh .\02-platform\REDACTED --help`, but `REDACTED` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmark/Azure.benchmark/02-platform/README.md:66
benchmark/Azure.benchmark/03-workload/README.md runs `.\03-workload\bench\resp-bench.ps1 -Detail`, but `03-workload/bench/resp-bench.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmark/Azure.benchmark/03-workload/README.md:27
benchmark/Azure.benchmark/03-workload/README.md runs `.\03-workload\bench\memtier-bench.ps1 -Background`, but `03-workload/bench/memtier-bench.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmark/Azure.benchmark/03-workload/README.md:28
benchmark/Azure.benchmark/03-workload/README.md names `01-resources/security/manifest.json`, but no file or folder `01-resources/security/manifest.json` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — benchmark/Azure.benchmark/03-workload/README.md:119
website/docs/azure/quickstart.md documents the environment variable `GARNET_HOST`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/azure/quickstart.md:162
website/docs/azure/quickstart.md documents the environment variable `GARNET_PORT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/azure/quickstart.md:163
website/docs/benchmarking/overview.md links to `resp-bench`, but `website/docs/benchmarking/resp-bench` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/benchmarking/overview.md:10
website/docs/benchmarking/results-resp-bench.md links to `resp-bench`, but `website/docs/benchmarking/resp-bench` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/benchmarking/results-resp-bench.md:22
website/docs/benchmarking/results-resp-bench.md runs `dotnet run -c Release --framework=net10.0 --project Garnet/main/GarnetServer -- \`, but `Garnet/main/GarnetServer` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/benchmarking/results-resp-bench.md:32
website/docs/benchmarking/results-resp-bench.md runs `dotnet run -c Release --framework=net10.0 --project Garnet/benchmark/Resp.benchmark -- \`, but `Garnet/benchmark/Resp.benchmark` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/benchmarking/results-resp-bench.md:99
website/docs/cluster/replication.md links to `../dev/cluster/replication-dev`, but `website/docs/dev/cluster/replication-dev` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/cluster/replication.md:255
website/docs/commands/roaring-bitmap.md links to `raw-string`, but `website/docs/commands/raw-string` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/commands/roaring-bitmap.md:17
website/docs/dev/range-index-resp-api.md names `test/Garnet.test/ReadOptimizedLockTests.cs`, but no file or folder `test/Garnet.test/ReadOptimizedLockTests.cs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/dev/range-index-resp-api.md:1440
website/docs/dev/range-index-resp-api.md names `libs/server/Storage/Functions/MainStore/DisposeMethods.cs`, but no file or folder `libs/server/Storage/Functions/MainStore/DisposeMethods.cs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/dev/range-index-resp-api.md:1697
website/docs/dev/range-index-resp-api.md names `test/Garnet.test/RangeIndexTests.cs`, but no file or folder `test/Garnet.test/RangeIndexTests.cs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/dev/range-index-resp-api.md:2303
website/docs/getting-started/memory.md links to `configuration`, but `website/docs/getting-started/configuration` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/getting-started/memory.md:11
website/docs/getting-started/memory.md links to `compaction`, but `website/docs/getting-started/compaction` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/getting-started/memory.md:50
website/docs/welcome/about-us.md links to `/blog/brief-history`, but `blog/brief-history` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — website/docs/welcome/about-us.md:9
libs/storage/Tsavorite/cc/README.md names `src\Release\`, but no file or folder `src/Release` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — libs/storage/Tsavorite/cc/README.md:347
libs/storage/Tsavorite/cc/README.md names `src\Debug\`, but no file or folder `src/Debug` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — libs/storage/Tsavorite/cc/README.md:347
libs/storage/Tsavorite/cs/benchmark/Device.benchmark/README.md changes into `benchmark/Device.benchmark`, but no such folder exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong. — libs/storage/Tsavorite/cs/benchmark/Device.benchmark/README.md:16
What to do
Reconcile the README with reality: website/README.md documents the environment variable `USE_SSH`, but no code, script or configuration file names it; benchmark/Azure.benchmark/01-resources/README.md runs `.\01-resources\deploy-common-resources.ps1`, but `01-resources/deploy-common-resources.ps1` does not exist; benchmark/Azure.benchmark/01-resources/README.md names `01-resources/security/manifest.json`, but no file or folder `01-resources/security/manifest.json` exists; benchmark/Azure.benchmark/02-platform/README.md runs `pwsh .\02-platform\REDACTED --help`, but `REDACTED` does not exist; benchmark/Azure.benchmark/03-workload/README.md runs `.\03-workload\bench\resp-bench.ps1 -Detail`, but `03-workload/bench/resp-bench.ps1` does not exist.
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.
Do you agree with this assessment?
P2 · Observability8.6 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether the code is diagnosable in production — structured logging, tracing/metrics, health checks.
Readiness · Readiness — Whether SAST, secret/dependency scanning and performance benchmarking are wired in (presence, not runtime).
Method: Filesystem scan: SAST configuration, dependency-update automation, secret scanning, and a benchmark harness or benchmark step — in this repository's own ecosystem. Exhaustive, deterministic.
What to do
Dependabot is configured but does not watch `cargo` — add that `package-ecosystem` entry to REDACTED so those dependencies get the same automatic update and advisory pressure as the ones it already covers.
Add gitleaks/trufflehog in CI to block PRs that introduce committed secrets.
Readiness · Readiness — Whether releases are automated and safely reversible (probes, rolling updates, approval gates) — from manifests/pipeline files, not the live environment.
Method: Filesystem scan: deployment manifests/IaC (K8s YAML, Helm, Terraform) for rolling updates, probes, approval gates, migration hooks. Exhaustive, deterministic.
Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
What to do
Add an approval/environment gate (required reviewers / protection rules) before production promotion.
Do you agree with this assessment?
P5 · DR & Backup6.0 / 10Adequate✓ Tool-verified
Readiness · Readiness — Whether disaster recovery is planned and codified — backups, geo-recovery, RTO/RPO, persistence guarantees — from IaC + container manifests + docs, never the live cloud.
Method: Filesystem scan: disaster recovery, backup, geo-recovery, RTO/RPO, persistence guarantees from IaC, manifests, and docs. Exhaustive, deterministic, never a live environment.
What to do
Codify backups + geo-recovery in IaC (snapshot/replication/geo-redundant) to back the DR plan.
Do you agree with this assessment?
P6 · Release Hygiene8.0 / 10Strong✓ Tool-verified
Readiness · Readiness — Whether releases are traceable — a maintained changelog and explicit version stamping.
Method: Filesystem scan: changelog file presence and version tags in csproj or git tags. Exhaustive, deterministic.
The changelog this check read carries 2 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
What to do
Keep the changelog current — add a versioned entry (Keep-a-Changelog ## [x.y.z]) for each release so the history isn't a stub.
Readiness · Performance — Whether the code protects its performance with benchmarks — a benchmark suite, allocation/memory measurement, and (ideally) a CI gate. Presence is credited as a bonus, never a deduction.
Method: Repo + source scan: BenchmarkDotNet referenced (csproj/source), [Benchmark]/[MemoryDiagnoser] attribute counts, and a benchmark step in CI; off .NET, the same ladder over Go testing.B, Rust criterion/#[bench]/divan, JMH/kotlinx-benchmark, pytest-benchmark/asv/pyperf, tinybench/mitata/vitest bench/benchmark.js and Swift package-benchmark — scored as a bonus ladder (absence is neutral, never a deduction). Deterministic, presence detection.
Readiness · Performance — Whether the code is written to minimise allocations so it doesn't pressure its host's memory manager — buffer/slice views over copies, object pooling, stack or value-type allocation, and buffer writers. Reward-only: credited where present, never penalised where a simpler style is fine.
Method: Production-source scan: density (per 1k LoC) of allocation-aware APIs — in .NET Span/Memory, ArrayPool/ObjectPool, stackalloc, ValueTask, value-type structs, IBufferWriter, string.Create, SkipLocalsInit; off .NET, with comments and strings blanked, Go's sync.Pool, preallocated slices/maps, Grow, strconv.Append* and buf[:0] reuse; the JVM's NIO buffer views, MemorySegment, primitive collections, pools and literal presizes (plus Kotlin primitive arrays and value classes, Scala AnyVal and @specialized); Swift's reserveCapacity, ContiguousArray, withUnsafe* access and ~Copyable. Activated off .NET on the same floor (400 lines, and benchmarks or 8 uses); Rust and garbage-collected scripting languages are not applicable. Reward-only. Deterministic, syntax/text detection.
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.
126 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
`.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). (×25) — benchmark/BDN.benchmark/Cluster/EpochBumpContention.cs:156, benchmark/BDN.benchmark/Cluster/EpochBumpContention.cs:158, benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:623, …
`waiter.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). (×12) — benchmark/Resp.benchmark/OfflineBench/AOFBench/AofBench.cs:164, benchmark/Resp.benchmark/OfflineBench/AOFBench/AofBench.cs:216, benchmark/Resp.benchmark/OfflineBench/AOFBench/AofBench.cs:263, …
`WaitForEpochBump.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). — benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:124
`waitCallback.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one). — benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:848
What to do
Make the call chain async end-to-end and await it — never block on a Task with .Wait()/.GetAwaiter().GetResult().
Other · Security — Cryptographic hygiene (weak hash/cipher, password key-derivation). This codebase has no web surface, so transport/header/cookie/CSRF controls are N/A and only crypto is scored. Outbound TLS (certificate validation, protocol version) is scored wherever it appears — a client verifies its peer whether or not it serves anything itself.
Method: Roslyn plus filesystem scan: HSTS/security headers, secure cookies, input validation, middleware order, weak crypto (MD5/SHA1/DES); HTTPS-metadata context-aware. On a repository with no .NET source it reads JavaScript/TypeScript, Dart, Ruby, Scala, Rust or Elixir source itself (test, vendored, generated and minified paths not) for the arms that hold whether or not the code serves HTTP: a weak hash or cipher, key material fixed in the source, a TLS client that accepts any certificate, and (JavaScript/TypeScript, Ruby, Scala, Rust and Elixir) an obsolete TLS version; the server controls are not assessed there, and a Dart, Ruby, Scala, Rust or Elixir repository that serves no HTTP of its own is N/A on them. Deterministic.
`SHA256.HashData(…)` puts the password `password` through SHA256, a fast general-purpose digest, so a stolen hash is guessed at billions of candidates a second whether or not it is salted — no key-derivation function (PBKDF2/scrypt/Argon2/bcrypt) stands between the password and the stored value. — libs/server/ACL/ACLPassword.cs:37
`RemoteCertificateValidationCallback` is assigned a callback that returns `true` unconditionally, so every TLS peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Delete the override and let the platform validate. If a specific self-signed or internally-issued certificate genuinely has to be trusted, pin THAT one — compare the presented certificate's public key or thumbprint against the expected value and return `false` for everything else — and scope it to the single handler that talks to that host rather than to the whole process. If the override exists only to get past a development certificate, gate it on a build configuration or an explicit opt-in setting so it cannot ship. — playground/GarnetClientStress/StressTestUtil.cs:40
The value is the token-signing key and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash. — benchmark/BDN.benchmark/Operations/OperationsBase.cs:188
What to do
Store passwords with a salted KDF — `Microsoft.AspNetCore.Identity.PasswordHasher<T>`, `Rfc2898DeriveBytes` (PBKDF2), or BCrypt/Argon2 — and compare with `CryptographicOperations.FixedTimeEquals`. (A fast/plain hash, or a client-hashed value stored and compared verbatim, is not password storage.) Start in `libs/server/ACL/ACLPassword.cs:37`.
Stop accepting every TLS certificate: remove the always-true validation callback so the platform verifies the chain, hostname and expiry. If one self-signed certificate must be trusted, pin it by public key or thumbprint on the single handler that needs it and reject all others — never process-wide.
Load cryptographic key and salt material from configuration, an environment variable or a secrets manager rather than fixing it in the source, and fail fast at startup when it is absent — a default that silently works is the one that reaches production. Rotate anything already committed: it must be treated as disclosed. Salts should be generated per password and stored with the hash, never shared across installations.
Do you agree with this assessment?
X1 · Async correctness4.2 / 10Weak✓ Tool-verified
Other · Code Health — Whether the code avoids sync-over-async (deadlock-prone blocking on tasks) and async void.
Method: Roslyn syntax scan: async methods scanned for .Wait()/.GetAwaiter().GetResult() and async-void outside event handlers. Deterministic, hard fact per invocation.
Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process. (×24) — benchmark/BDN.benchmark/Cluster/EpochBumpContention.cs:156, benchmark/BDN.benchmark/Cluster/EpochBumpContention.cs:158, benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:623, …
`Task.WaitAll` blocks this thread until the tasks complete — sync-over-async: it can deadlock under a synchronization context and it parks a thread for as long as the work runs. `await Task.WhenAll(…)` instead. (×9) — benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:714, benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:443, benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:475, …
Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout. (×2) — benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:207, benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:221
`async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained. (×3) — benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:557, benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:660, benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:858
`ManualResetEventSlim.Wait` parks the thread until another thread signals it — inside a method that is already `async`, the wait should be awaitable (a `TaskCompletionSource`, `SemaphoreSlim.WaitAsync`, or `WaitHandle` bridged with `Task.Factory.FromAsync`). (×2) — benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:580, benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:684
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 stream3.5 / 10Weak✓ Tool-verified
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.
`RedirectStandardError` is set here, but nothing in this type ever reads `StandardError` — while `StandardOutput` is read to the end. The child blocks as soon as it fills the StandardError pipe (~4 KB, never more than 64 KB), and it can then never finish writing StandardOutput, so the read-to-end above never returns and the `WaitForExit` timeout beside it does not help: the timeout bounds the WAIT, not the read that precedes it. Drain both — read one stream on a background thread (`BeginErrorReadLine()` with an `ErrorDataReceived` handler, or a `Task` running the second `ReadToEndAsync()`) and await both before `WaitForExit()` — or stop redirecting the stream you do not consume. — libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvOutput.cs:262
What to do
Each finding names the span that makes the branch dead and the span it is dead because of. Confirm from the two, then delete the dead arm or fix the predicate that was meant to be reachable.
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 reader2.2 / 10Critical✓ Tool-verified
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.
`numWorkers` is read from the stream being parsed at line 184 (`ReadInt32`), then used to size an array at line 185 — and nowhere in this method is `numWorkers` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). A file the caller did not write therefore chooses the size directly: a value near `int.MaxValue` allocates until the process dies, and a value that overflows the cast to `int` goes negative and throws out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numWorkers` against the bytes actually remaining in the stream before spending it. — libs/cluster/Server/ClusterConfigSerializer.cs:185
`keyLength` is read from the stream being parsed at line 109 (`ReadInt32`), then read in bulk from that same stream at line 112 — and nowhere in this method is `keyLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). A file the caller did not write therefore chooses the size directly: a value near `int.MaxValue` allocates until the process dies, and a value that overflows the cast to `int` goes negative and throws out of a parser whose failure path was written for malformed input, not for hostile input. Bound `keyLength` against the bytes actually remaining in the stream before spending it. — libs/server/Objects/Hash/HashObject.cs:112
`keyLength` is read from the stream being parsed at line 188 (`ReadInt32`), then read in bulk from that same stream at line 191 — and nowhere in this method is `keyLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). A file the caller did not write therefore chooses the size directly: a value near `int.MaxValue` allocates until the process dies, and a value that overflows the cast to `int` goes negative and throws out of a parser whose failure path was written for malformed input, not for hostile input. Bound `keyLength` against the bytes actually remaining in the stream before spending it. — libs/server/Objects/SortedSet/SortedSetObject.cs:191
What to do
Each finding names the read that takes the length from the input and the site that spends it, and states that the value is never compared in between. Confirm from the two, then bound the length against the remaining stream before using it.
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.
`c` is a `GarnetClientSession`, which implements `IDisposable`, and it is created here (line 464). Every use of it in `GarnetClientSessionOperateThreadRunner` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var c = …;`), which releases it at the end of the scope on every path including a throw. — benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:464
`client` is a `LightClient`, which implements `IDisposable`, and it is created here (line 424). Every use of it in `OpRunnerLightClient` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var client = …;`), which releases it at the end of the scope on every path including a throw. — benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:424
`waitCallback` is a `ManualResetEventSlim`, which implements `IDisposable`, and it is created here (line 757). Every use of it in `OpRunnerGarnetClientSync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var waitCallback = …;`), which releases it at the end of the scope on every path including a throw. — benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:757
`client` is a `GarnetClientSession`, which implements `IDisposable`, and it is created here (line 326). Every use of it in `LoadData` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var client = …;`), which releases it at the end of the scope on every path including a throw. — benchmark/Resp.benchmark/TxnPerfBench.cs:326
`ReplicationManager` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `resetHandler` itself (line 28), which makes that instance its own. But `resetHandler` is named in none of the methods the disposal search covered: `Dispose` (line 489) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`resetHandler?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree. — libs/cluster/Server/Replication/ReplicationManager.cs:28
`RangeIndexMigrationReceiveState` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `currentDeserializer` itself (line 25), which makes that instance its own. But `currentDeserializer` is named in none of the methods the disposal search covered: `Dispose` (line 134), `DisposeInternal` (line 145) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`currentDeserializer?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree. — libs/cluster/Session/RangeIndexMigrationReceiveSession.cs:25
`GarnetTcpNetworkSender` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `responseObject` itself (line 29), which makes that instance its own. But `responseObject` is named in none of the methods the disposal search covered: `Dispose` (line 282), `DisposeNetworkSender` (line 285) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`responseObject?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree. — libs/common/Networking/GarnetTcpNetworkSender.cs:29
`parser` is a `Parser`, which implements `IDisposable`, and it is created here (line 48). Every use of it in `TryParseCommandLineArguments` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var parser = …;`), which releases it at the end of the scope on every path including a throw. — libs/host/ServerSettingsManager.cs:48
`logReader` is a `ObjectLogReader`, which implements `IDisposable`, and it is created here (line 1226). Every use of it in `VerifyRecordFromDiskCallback` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var logReader = …;`), which releases it at the end of the scope on every path including a throw. — libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:1226
`logReader` is a `ObjectLogReader`, which implements `IDisposable`, and it is created here (line 1339). Every use of it in `DeserializeObjectsOnPage` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var logReader = …;`), which releases it at the end of the scope on every path including a throw. — libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:1339
`NativeStorageDevice` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `shardIndex` itself (line 242), which makes that instance its own. But `shardIndex` is named in none of the methods the disposal search covered: `Dispose` (line 1924), `NativeDevice_Destroy` (line 762), `NativeDevice_WakeCompletionWorker` (line 792), `GetNativeLastError` (line 817), `TotalInFlight` (line 937), `TotalLeases` (line 971) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`shardIndex?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree. — libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:242
`completionEvent` is a `ManualResetEventSlim`, which implements `IDisposable`, and it is created here (line 222). Every use of it in `RemoveSegment` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var completionEvent = …;`), which releases it at the end of the scope on every path including a throw. — libs/storage/Tsavorite/cs/src/core/Device/StorageDeviceBase.cs:222
`DeviceLogCommitCheckpointManager` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `deleteQueue` itself (line 70), which makes that instance its own. But `deleteQueue` is named in none of the methods the disposal search covered: `Dispose` (line 149) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`deleteQueue?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree. — libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/DeviceLogCommitCheckpointManager.cs:70
`lightClient` is a `LightClientRequest`, which implements `IDisposable`, and it is created here (line 188). Every use of it in `TryGetCommandsInfo` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var lightClient = …;`), which releases it at the end of the scope on every path including a throw. — playground/CommandInfoUpdater/CommandInfoUpdater.cs:188
`parser` is a `Parser`, which implements `IDisposable`, and it is created here (line 34). Every use of it in `Main` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var parser = …;`), which releases it at the end of the scope on every path including a throw. — playground/CommandInfoUpdater/Program.cs:34
`progress` is a `ProgressBar`, which implements `IDisposable`, and it is created here (line 16). Every use of it in `RunPingDispose` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var progress = …;`), which releases it at the end of the scope on every path including a throw. — playground/GarnetClientStress/SimpleStressTests.cs:16
`cts` is a `CancellationTokenSource`, which implements `IDisposable`, and it is created here (line 203). Every use of it in `ShortRunningTask` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var cts = …;`), which releases it at the end of the scope on every path including a throw. — playground/GarnetClientStress/TaskScaling.cs:203
`cts` is a `CancellationTokenSource`, which implements `IDisposable`, and it is created here (line 44). Every use of it in `RunSimulation` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var cts = …;`), which releases it at the end of the scope on every path including a throw. — samples/ETag/Caching.cs:44
`cts` is a `CancellationTokenSource`, which implements `IDisposable`, and it is created here (line 68). Every use of it in `RunSimulation` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var cts = …;`), which releases it at the end of the scope on every path including a throw. — samples/ETag/OccSimulation.cs:68
`e` is a `ManualResetEventSlim`, which implements `IDisposable`, and it is created here (line 77). Every use of it in `SetGetSync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var e = …;`), which releases it at the end of the scope on every path including a throw. — samples/GarnetClientSample/GarnetClientSamples.cs:77
`parser` is a `Parser`, which implements `IDisposable`, and it is created here (line 22). Every use of it in `Run` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var parser = …;`), which releases it at the end of the scope on every path including a throw. — libs/storage/Tsavorite/cs/benchmark/KV.benchmark/EntryPoint.cs:22
What to do
Each finding names the value and the span that decides who owns it — the `new` that created it, or the constructor parameter that handed it over. Confirm ownership from that span, then make the disposal match it: release what this type created, leave what it was injected with to whoever created THAT, and drop a finalizer whose type holds nothing unmanaged to release.
Other · Code Health — Whether a method that temporarily changes state belonging to the whole process — the working directory, an environment variable — puts it back on EVERY path: a restore reached only when nothing throws leaks the change to the rest of the process.
Method: Roslyn syntax + semantics: method bodies that write the process working directory or an environment variable and write it back in the same body, checked for whether that restore sits in a `finally`/`catch` or only on the straight-line path. On a repository with no .NET source the same rule reads production JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not): `process.chdir`, `process.env.NAME =`/`["NAME"] =` and `delete process.env.NAME`, and Deno’s `Deno.chdir`/`Deno.env.set`/`Deno.env.delete`, paired per function body (a nested function or arrow is its own body, and module top-level code is none), where the last write puts back a local the body captured from the same global or deletes a variable the first write set, with at least one statement between them; a write in a `catch`/`finally` of that body silences it. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether async methods accept a CancellationToken so work can be cancelled (adoption curve).
Method: Roslyn scan: every async method (excluding framework-fixed overrides/Blazor handlers) checked for CancellationToken parameter presence. Deterministic, adoption percentage. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same question: every named async function that itself makes a request an AbortSignal can cancel (global `fetch`, axios and its file-local instances, ky, ofetch) counts, and it is compliant when its parameters or body name a signal or it hands one of its own parameters to the request as options; signatures a framework fixes (JSX event handlers, route and lifecycle exports, request-first handlers, `override`, `'use server'` modules, TanStack `mutationFn`) are exempt unless they take a signal. Deterministic, adoption percentage.
Only 184/383 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
No CancellationToken parameter — this work can't be stopped early once started. (×33) — benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:37, benchmark/BDN.benchmark/Network/BasicOperations.cs:25, benchmark/BDN.benchmark/Network/RawStringOperations.cs:69, …
Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one. (×5) — benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:621, benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:631, benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:641, …
No CancellationToken parameter — the body observes an ambient token instead (a field or a context object), so the work does stop on cancellation, but a caller cannot cancel this call independently of the owner that created that token. — libs/client/GarnetClient.cs:475
What to do
Thread a CancellationToken through async methods so work stops promptly on cancellation.
Other · Code Health — Whether an argument guard throws the exception its own condition describes — a guard that rejects a value for being EMPTY and reports it as `ArgumentNullException` tells the caller a parameter was null when it provably was not.
Method: Roslyn syntax: `throw new ArgumentNullException(nameof(p))` statements controlled by an `if`, whose condition is read for a test that is true of a NON-null `p` — an emptiness test that dereferences it (`p.Count == 0`, `!p.Any()`) or a BCL predicate documented true of the empty value (`string.IsNullOrEmpty(p)`). Deterministic, provable per finding. Advisory.
The guard on line 36 rejects `name` and line 37 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(name)` is true of a value that is NOT null: it is satisfied by an EMPTY `name`, and on that path `name` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows the empty case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` for the empty case, or split the guard and throw each on its own condition. — libs/server/Custom/CustomProcedureWrapper.cs:37
What to do
Each finding names the throw and the test in its own condition that is true of a NON-null value. Confirm from the two, then throw the exception that describes what was actually wrong: `ArgumentException` for a value that arrived empty, or the .NET 8 helpers that spell the whole guard in one line and pick the type for you — `ArgumentException.ThrowIfNullOrEmpty(s)` / `ThrowIfNullOrWhiteSpace(s)` for strings, `ArgumentNullException.ThrowIfNull(x)` followed by `ArgumentOutOfRangeException.ThrowIfZero(x.Count)` for a collection. Splitting the two conditions is usually clearer than picking one exception for both: they are different failures and the caller may want to handle them differently.
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 guard4.0 / 10Weak✓ Tool-verified
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.
This condition tests `remaining` for emptiness and then indexes it on a branch that test does not reach. `remaining[0]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `remaining` being empty — so an empty `remaining` indexes position 0 of nothing and throws. This same condition already shows the intended bracketing: `remaining[1]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `remaining` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `remaining`. (×2) — libs/server/Resp/Vector/ExprCompiler.cs:59, libs/server/Resp/Vector/ExprCompiler.cs:94
What to do
Each finding names the index access that escapes the guard and the line of the correctly bracketed access beside it. Compare the two: they differ only in where one parenthesis sits. Move it so the emptiness test brackets every access to that symbol — and if the value provably cannot be empty at this point, delete the test rather than leave a condition that guards one access and not its neighbour.
Do you agree with this assessment?
X29 · Per-element action decided by a fixed element7.2 / 10Strong✓ Tool-verified
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.
This loop runs once per element of `workers`, and the statement it guards acts on the element it is on — `workers[i]`. The test deciding whether that statement runs does not: `replicaOf != null && replicaOf.Equals(workers[LOCAL_WORKER_ID].Nodeid, String...` reads `workers[LOCAL_WORKER_ID]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out. — libs/cluster/Server/ClusterConfig.cs:304
What to do
Each finding names the test and the statement it guards, which index the same collection at two different subscripts — one fixed, one the loop variable. Confirm from the two, then decide which subscript the test meant. If it was meant to be per-element, give it the loop variable so each element is judged on itself. If it really is one answer for the whole collection, hoist the test OUT of the loop, where a reader can see it is asked once and where it is not re-evaluated on every pass — leaving it inside, reading a fixed element, is the one arrangement that cannot be right under either reading.
Other · Code Health — Whether exceptions are handled rather than silently swallowed or rethrown with lost stack traces.
Method: Roslyn syntax scan: every catch clause counted; empty catches and bare rethrows flagged. Population is all catch clauses, not estimated. Deterministic, hard fact.
An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it. (×30) — libs/client/ClientSession/GarnetClientSession.cs:415, libs/client/GarnetClient.cs:508, libs/client/GarnetClient.cs:522, …
An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else). (×7) — libs/cluster/Server/Gossip/GarnetServerNode.cs:230, libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncDriverStore.cs:307, libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncTask.cs:169, …
`catch (Exception)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. (×2) — libs/server/Databases/MultiDatabaseManager.cs:370, libs/server/Databases/MultiDatabaseManager.cs:546
`catch` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch. — libs/server/Lua/LuaRunner.cs:361
What to do
Swallowed exception (empty catch)
Do you agree with this assessment?
X30 · Support guard that admits what it rejects10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a guard written as a NEGATED `||` says what its author meant — `!(a || b || x != k)` is `!a && !b && x == k` by De Morgan, so a bail-out that mixes capabilities the code needs with a fault it refuses turns inside out: it fires only where the capabilities are ABSENT, and lets every value the fault term names walk straight into the body that cannot handle it.
Method: Roslyn syntax only, no semantic model: every logical-not whose operand is a parenthesised `||` chain of two or more disjuncts, flattened (a left-nested `a || b || c` read once would see `(a || b)` as one disjunct). A site enters the population on that shape alone. A finding additionally needs the disjuncts to DISAGREE in polarity: at least one bare boolean read — an identifier or member access, never an invocation, which is a predicate rather than a capability flag — and at least one `x != <constant>`, the only form that negates into an exact-value pin (`== null` negates into a looser requirement and is outside the fault set). Consistently-polarised disjunctions, all-fault or all-capability, are counted and never reported; a negated `&&` is outside the population entirely. No same-receiver gate: it was measured to cost a real defect and remove no false positive. Deterministic, provable per finding. Advisory.
Do you agree with this assessment?
X32 · Type resolved by simple name across every loaded assembly10.0 / 10Exemplary○ Nothing flagged
Other · Code Health — Whether a plugin lookup names the type it means — searching every assembly loaded into the process for a candidate whose SIMPLE name equals a string supplied at runtime, and taking the first one found, is decided by assembly LOAD ORDER rather than by this source, so the same name can resolve to a different type on the next run.
Method: Roslyn syntax only, no semantic model: every invocation of `First`/`FirstOrDefault`/`Single`/`SingleOrDefault` whose OWN expression subtree contains both a `GetAssemblies()` call and a `GetTypes()`/`GetExportedTypes()` call — a single-element pick out of every type loaded into the process. A nested selector in the same chain sees no `GetAssemblies()` in its own subtree and is outside the population, so one lookup counts once however many links its chain has. A finding additionally needs both remaining halves: the selector must be `First`/`FirstOrDefault` (`Single`/`SingleOrDefault` reports the ambiguity rather than resolving it, and is counted and never reported), and the chain must carry an `==` comparison of `<lambda parameter>.Name` against something that is not a literal. The receiver must be a plain identifier bound by one of the chain’s own lambdas, which places `assembly.GetName().Name == "X"` outside the rule by construction. One exemption: a `.Name` test joined by `&&` to a `FullName`/`AssemblyQualifiedName` test on the same identifier is spared; joined by `||` it is not. Deterministic, provable per finding. Advisory.
Other · Code Health — Whether log calls use message templates (queryable) rather than interpolated strings.
Method: Roslyn syntax scan: every log call-site counted; interpolated-string first-argument violations flagged. Population is all log calls, not estimated. On a repository with no .NET source it reads JavaScript/TypeScript off the engine’s own token stream (test, vendored and minified paths not) with the same rule: a `trace`/`debug`/`info`/`warn`/`error`/`fatal`/`verbose`/`silly`/`http`/`log` call on a receiver named for a logger, in a package whose own or an enclosing `package.json` declares a logger that carries values as fields (pino, pino-http, nestjs-pino, Fastify, winston, bunyan, tslog, LogTape, roarr), whose first deciding argument is a template literal with substitutions; an object-literal fields argument is stepped over, a plain string message clears the call. Python is read the same way: a `debug`/`info`/`warning`/`error`/`exception`/`critical`/`log` call on a logger in a file that imports the standard library’s `logging` or structlog (loguru, which formats at the call, is not judged), whose message is a whole f-string with a non-constant field; a `%`-formatted, `.format()`-ed or concatenated message is not convicted, as in C#. PHP is read the same way: a PSR-3 level call (`emergency`…`debug`, `log`) on a logger (`$logger`, `$this->logger`, Laravel’s `Log::`, `logger()`, `\Drupal::logger()`) in a package whose `composer.json` requires a PSR-3 logger or a framework that hands one out (psr/log, Monolog, Laravel, Symfony, Drupal, CakePHP), or a file that imports one, whose message is a double-quoted string interpolating a variable; a single-quoted message clears the call, and `sprintf` or `.` concatenation is not convicted, as in C#. Dart is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on Sentry’s structured logger (`Sentry.logger`) whose message is a whole string literal interpolating a value (`$name`, `${…}`); the `Sentry.logger.fmt` template API clears the call. Dart that logs only through loggers with one message and no fields (package:logging, package:logger, talker, dart:developer) is not applicable rather than a reach gap. Ruby is read the same way: a `trace`/`debug`/`info`/`warn`/`error`/`fatal` call on the console gem’s `Console` (declared by a Gemfile, gemspec or Gemfile.lock, or required) or, where SemanticLogger, Ougai or dry-logger is declared or required, on a receiver named for a logger (`logger`, `@logger`, `Rails.logger`, `log`), whose first deciding argument is, as the whole argument, a double-quoted string interpolating a non-constant value (`#{…}`, `#@ivar`); a plain literal clears the call, keyword arguments are the fields, and a block, `%`-format or `+` concatenation is not convicted. Ruby that logs only through the standard Logger (Rails.logger) is not applicable rather than a reach gap. Deterministic.
Other · Code Health — Whether nullable reference types are enabled and not undermined by heavy `!` suppression.
Method: Roslyn compiler-options scan: NullableContextOptions per project; null-forgiving (!) suppression density per 1k syntax nodes. Deterministic, adoption plus suppression penalty.
This method contradicts itself about `primaryRedis`: line 868 writes `primaryRedis?.Dispose`, which says `primaryRedis` can be null, but line 753 then dereferences it directly as `primaryRedis.GetDatabase` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `primaryRedis` truly cannot be null here, the `?.` is misleading. Settle it one way — test `primaryRedis` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:753
This method contradicts itself about `client`: line 53 writes `client?.Dispose`, which says `client` can be null, but line 46 then dereferences it directly as `client.IsConnected` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `client` truly cannot be null here, the `?.` is misleading. Settle it one way — test `client` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — libs/cluster/Server/Failover/ReplicaFailoverSession.cs:46
This method contradicts itself about `task`: line 141 tests it for null before doing anything with it — the author's own statement that null is an input this code expects — but that `if` scopes only the block beneath it, and line 148 then dereferences `task` as `task.ConfigureAwait` AFTER the block has closed, where the guard no longer applies. A null `task` skips the guarded body and reaches that line anyway, throwing NullReferenceException on exactly the input the guard was written for. If the dereference belongs to the guarded work, move it inside the block; if `task` truly cannot be null by then, the guard above is misleading and should go. — libs/cluster/Server/Replication/PrimaryOps/DisklessReplication/ReplicaSyncSession.cs:148
This method contradicts itself about `retSession`: line 153 writes `retSession?.Dispose`, which says `retSession` can be null, but line 131 then dereferences it directly as `retSession.replicaNodeId` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `retSession` truly cannot be null here, the `?.` is misleading. Settle it one way — test `retSession` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — libs/cluster/Server/Replication/PrimaryOps/ReplicaSyncSessionTaskStore.cs:131
This method contradicts itself about `icVal`: line 517 assigns it with `as IComparable`, which hands back null rather than throwing when the value is not a `IComparable`, but line 518 then dereferences it directly as `icVal.CompareTo` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `icVal` once before the first use and handle the null case, or cast with `(IComparable)` so the failure is reported where it happens — rather than leaving the two readings side by side. — libs/host/Configuration/OptionsValidators.cs:518
This method contradicts itself about `targetSession`: line 1959 writes `targetSession?.clusterSession`, which says `targetSession` can be null, but line 1952 then dereferences it directly as `targetSession.Id` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `targetSession` truly cannot be null here, the `?.` is misleading. Settle it one way — test `targetSession` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — libs/server/Resp/BasicCommands.cs:1952
This method contradicts itself about `endPoint`: line 380 assigns it with `as IPEndPoint`, which hands back null rather than throwing when the value is not a `IPEndPoint`, but line 381 then dereferences it directly as `endPoint.Address` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `endPoint` once before the first use and handle the null case, or cast with `(IPEndPoint)` so the failure is reported where it happens — rather than leaving the two readings side by side. — libs/server/StoreWrapper.cs:381
This method contradicts itself about `endPoint`: line 389 assigns it with `as IPEndPoint`, which hands back null rather than throwing when the value is not a `IPEndPoint`, but line 390 then dereferences it directly as `endPoint.Address` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `endPoint` once before the first use and handle the null case, or cast with `(IPEndPoint)` so the failure is reported where it happens — rather than leaving the two readings side by side. — libs/server/StoreWrapper.cs:390
This method contradicts itself about `snapshotObjectReadBuffers`: line 1031 writes `snapshotObjectReadBuffers?.Dispose`, which says `snapshotObjectReadBuffers` can be null, but line 974 then dereferences it directly as `snapshotObjectReadBuffers.OnBeginRecord` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `snapshotObjectReadBuffers` truly cannot be null here, the `?.` is misleading. Settle it one way — test `snapshotObjectReadBuffers` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:974
This method contradicts itself about `epochAccessor`: line 546 writes `epochAccessor?.TrySuspend`, which says `epochAccessor` can be null, but line 556 then dereferences it directly as `epochAccessor.Resume` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `epochAccessor` truly cannot be null here, the `?.` is misleading. Settle it one way — test `epochAccessor` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.Chunked.cs:556
This method contradicts itself about `args`: line 61 writes `args?.`, which says `args` can be null, but line 72 then dereferences it directly as `args.Length` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `args` truly cannot be null here, the `?.` is misleading. Settle it one way — test `args` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side. — libs/storage/Tsavorite/cs/benchmark/BDN-Tsavorite.Benchmark/BenchmarkDotNetTestsApp.cs:72
5/32 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.
~0.8 `!` suppressions per 1k syntax nodes — 17 suppression(s) across the 20164 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.
What to do
Where a method uses `?.` on a symbol and then dereferences it directly, settle the question once: test it before the first use and handle null, or drop the `?.`.
Where a method null-tests a symbol and then uses it after the guarded block closes, move the trailing work inside the block — the guard skips its body on null, it does not stop the method.
Enable <Nullable>enable</Nullable> across all projects and resolve warnings rather than suppressing with `!`.
Do you agree with this assessment?
Reference — by lens
The score is the rank-weighted fold of these lenses (worst-heaviest), each including its meta-dimensions; a lens with a Critical contributor is capped at Fair (its band reads "gated by …") and is never the strongest area however high its average.
Unscored — 3 check(s) recorded observations but carry no score
These checks ran and found something, but they do not carry a score — either by design (an advisory check reports evidence rather than grading it) or because they could not be scored here. They are excluded from the score for that reason, not because there was nothing to see.
P12 CI test-gate honesty — 1 observation(s) recorded · Reported, not scored — this card publishes what the CI gate does with the test inventory rather than grading it. The findings above are its output.
X10 Duplicated predicate — 25 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
X7 Silent fallback defaults — 5 observation(s) recorded · Advisory — this card reports evidence and never carries a score.
Not evidenced — 2 control(s) we could not find positive evidence for
These checks grade a working control, and the repository shows no evidence of one. That is deliberately not scored as a zero: a repository cannot show an ops runbook, a database TTL or an infrastructure-side audit log, so absence of evidence here is not evidence the control is missing. It is also not a statement that the check is irrelevant to this codebase — the thing it grades applies; we just could not see it. Excluded from the score either way.
C3 Audit Trail — Repo shows no audit-logging mechanism (IAuditable, an immutable audit log, an EF SaveChanges interceptor) for sensitive changes — absence of evidence is not evidence of a working control. Record an audit trail in code (or document where it lives) so this dimension can be scored.
C5 Data-Subject Rights — Repo shows no corroborated data-subject-rights mechanism (erasure / export-portability / consent) tied to a subject id or GDPR vocabulary — absence of evidence is not evidence of a working control. Implement erasure, data export/portability and consent tracking over the subject's records.
Not included — 33 check(s) not relevant to this codebase
These checks had nothing to measure here (no tests, no git history, the codebase is small, or the architecture style doesn't apply), so they're omitted above rather than scored low.
AC1 Text alternatives — No web markup found — accessibility is not applicable to this repository.
AC2 Forms & labels — No web markup found — accessibility is not applicable to this repository.
AC3 Page structure — No web markup found — accessibility is not applicable to this repository.
AC4 Keyboard semantics — No web markup found — accessibility is not applicable to this repository.
AC5 ARIA correctness — No web markup found — accessibility is not applicable to this repository.
AC6 Visual & motion safety — No web markup found — accessibility is not applicable to this repository.
AC7 A11y enforcement — No web markup found — accessibility is not applicable to this repository.
AX1 Captive dependencies — no DI registrations detected
AX2 Stateful singletons — no singleton implementations detected
AX7 Slice cohesion — not applicable — not a vertical-slice architecture
AX9 CQS / query purity — no CQRS query handlers detected — query purity is not applicable to this codebase
AXB2 Runtime readiness — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
AXR1 Runtime accessibility — docker build failed (exit 1) — DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
Install the buildx component to build images with BuildKit:
https://docs.docker.com/go/bui…; 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.
D11 Test Reliability — Test reliability not included
D22 Internal API Consistency — No intentionally-exposed public API to evaluate for consistency.
D23 Boundary Type-Coupling — Cross-context type coupling could not be assessed — this codebase's bounded contexts are neither declared nor inferable.
D25 ADR Conformance — no ADRs to check
D32 Data Compliance (PII/GDPR) — 117 file(s) were not parsed by semgrep — the PII/GDPR ruleset never ran over them
D39 IL Efficiency — IL not measured — the analyzer's build of the target did not succeed
D42 Runtime Threat Enforcement — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
D44 Platform End-of-Life — Platform end-of-life not assessed — this repository declares no platform this pass reads
D7 Architectural Integrity — no checkable ADRs and no dependency cycles — architectural integrity not assessed
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 Domain Modelling — not scored — this repository shows only 1 of the 3 signals this lens looks for (1 value object(s))
ED2 Event/command shape — not scored — deciding whether a command has more than one competing handler requires resolving the call graph, and a call made through an inferred or generic receiver has no resolvable owner in the source. Reported as guidance rather than measured
ED5 Idempotency — 1 mutating command handler(s)/consumer(s) detected and 1 handler method(s) walked, but no persistent write was recognised in any of them — idempotency not assessed
ES1 Event Sourcing — not scored — this repository shows none of the 3 signals this lens looks for
P7 Outbound HTTP resilience — no outbound HTTP usage detected — no HttpClient/IHttpClientFactory/AddHttpClient in source, and no Refit/RestSharp/Flurl.Http namespace or package reference
P8 Schema migrations — no EF Core usage detected
P9 Domain vs controller coverage — no coverage report found on disk — produce a coverage report in a standard format (Cobertura — `dotnet test --collect:"XPlat Code Coverage"` with a `coverlet.collector` PackageReference) 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
SC1 Supply-chain hygiene — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
X6 Hand-rolled structured-format parsing — Advisory — this card reports evidence and never carries a score, so there is nothing missing here.
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.
EmptyCatchBlock libs/client/ClientSession/GarnetClientSession.cs:415— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/client/GarnetClient.cs:508— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/client/GarnetClient.cs:522— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/client/NetworkWriter.cs:372— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/cluster/Server/Gossip/GarnetServerNode.cs:230— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncDriverStore.cs:307— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncDriverStore.cs:568— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncDriverStore.cs:644— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncTask.cs:159— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncTask.cs:169— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncTask.cs:178— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/cluster/Server/Replication/PrimaryOps/DiskbasedReplication/FileDataSource.cs:166— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/cluster/Server/Replication/ReplicaOps/DiskbasedReplication/FileDataSink.cs:126— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/common/Networking/GarnetTcpNetworkSender.cs:397— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/common/Networking/TcpNetworkHandlerBase.cs:111— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/host/GarnetServer.cs:628— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/server/Databases/MultiDatabaseManager.cs:1068— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/server/Module/ModuleUtils.cs:147— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/server/Objects/ItemBroker/CollectionItemBroker.cs:762— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/server/Resp/PubSubCommands.cs:56— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/server/Resp/PubSubCommands.cs:100— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/server/Resp/RespServerSession.cs:418— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/server/Resp/Vector/VectorManager.Replication.cs:66— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/server/Servers/GarnetServerTcp.cs:464— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
EmptyCatchBlock libs/server/Transaction/TransactionManager.cs:399— empty catch block — the error is discarded with nothing recorded, so a failure here leaves no trace anywhere. Record it through whatever this codebase already uses to report problems, or let it propagate. Where swallowing one specific failure really is correct — as it often is on a teardown/dispose path where throwing would mask the original failure — catch exactly that exception type and write down WHY in a comment on the catch. Both are needed: a comment on a catch-all still swallows every failure nobody anticipated, and a note that only restates the swallow ("ignored", "do nothing") is read as no explanation at all.
WriteOnlyPrivateField benchmark/BDN.benchmark/BfTree/BfTreeOperations.cs:32— private PinnedSpanByte pinnedValue — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField benchmark/Resp.benchmark/OfflineBench/AOFBench/AofBench.cs:41— private StringBuilder stats — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField benchmark/Resp.benchmark/OfflineBench/AOFBench/AofBench.cs:49— private AofAddress aofTailAddress — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField benchmark/Resp.benchmark/TxnPerfBench.cs:40— private AsyncPool<GarnetClientSession> gcsPool — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/cluster/Server/Migration/MigrationManager.cs:15— private ILogger logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/cluster/Server/Replication/PrimaryOps/DiskbasedReplication/FileTransmitSource.cs:21— private ILogger logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/cluster/Server/Replication/PrimaryOps/DiskbasedReplication/RangeIndexFileDataSource.cs:43— private ILogger logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/cluster/Server/Replication/PrimaryOps/DiskbasedReplication/RangeIndexFileTransmitSource.cs:27— private ILogger logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/storage/Tsavorite/cs/src/core/ClientSession/ClientSession.cs:40— private ILogger logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/cluster/Server/Replication/GarnetClusterCheckpointManager.cs:22— private bool safelyRemoveOutdated — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/common/CoarseTimeProvider.cs:28— private ITimer timer — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/common/LightClient.cs:32— private int BufferSize — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/common/StreamProvider.cs:192— private bool readOnly — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/server/AOF/ReadConsistency/ReplicaReadSessionContext.cs:80— private GarnetServerOptions serverOptions — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/server/Lua/ScriptHashKey.cs:19— private byte[] arrRef — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/server/Objects/ItemBroker/CollectionItemBroker.cs:56— private Task mainLoopTask — assigned 2 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/server/Resp/HyperLogLog/HyperLogLog.cs:39— private byte pbit — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/FixedLenYcsbBenchmark.cs:43— private FixedLengthKey[] init_keys_ — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/storage/Tsavorite/cs/src/core/Allocator/WorkQueueLIFO.cs:19— private Task processQueue — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/storage/Tsavorite/cs/src/core/ClientSession/ClientSession.cs:39— private ILoggerFactory loggerFactory — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:307— private ulong nativeSegmentSizeBytes — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/StorageErrorHandler.cs:18— private string account — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/StorageErrorHandler.cs:19— private string taskHub — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField modules/GarnetJSON/JsonCommands.cs:18— private ILogger? logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
WriteOnlyPrivateField modules/GarnetJSON/JsonCommands.cs:90— private ILogger? logger — assigned 1 time(s), read never — this field is written and never read anywhere its type can be reached from, so the state it keeps answers no question: every assignment to it computes a value that nothing observes, on every instance, for the lifetime of each one. It reads as a flag the code branches on, and nothing branches on it. Delete the field and its assignments — or, if the value was MEANT to be consulted, the missing read is the defect this row is pointing at, and the branch that should have depended on it is not there.
FileScopedPragmaDisable libs/server/Resp/Bitmap/BitmapManager.cs:9— #pragma warning disable IDE1006 // Naming Styles — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/server/Resp/HyperLogLog/HyperLogLog.cs:15— #pragma warning disable IDE1006 // Naming Styles — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/src/core/Index/Common/LogSettings.cs:4— #pragma warning disable IDE1006 // Naming Styles — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/src/core/Index/Common/ReadCacheSettings.cs:4— #pragma warning disable IDE1006 // Naming Styles — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/test/test.hlog/DeviceLogTests.cs:17— #pragma warning disable IDE1006 // Naming Styles — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/test/test.hlog/LogScanTests.cs:11— #pragma warning disable IDE1006 // Naming Styles — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/test/test.hlog/LogTests.cs:16— #pragma warning disable IDE1006 // Naming Styles — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/benchmark/BDN-Tsavorite.Benchmark/IterationTests.cs:11— #pragma warning disable IDE0130 // Namespace does not match folder structure — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/benchmark/BDN-Tsavorite.Benchmark/OperationTests.cs:12— #pragma warning disable IDE0130 // Namespace does not match folder structure — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/SessionFixedLenFunctions.cs:11— #pragma warning disable IDE0130 // Namespace does not match folder structure — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/FixedLenYcsbBenchmark.cs:10— #pragma warning disable IDE0007 // Use implicit type — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ObjectYcsbBenchmark.cs:10— #pragma warning disable IDE0007 // Use implicit type — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/SpanByteYcsbBenchmark.cs:10— #pragma warning disable IDE0007 // Use implicit type — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/Input.cs:4— #pragma warning disable 1591 — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/Output.cs:4— #pragma warning disable 1591 — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/src/core/Index/Interfaces/SessionFunctionsBase.cs:4— #pragma warning disable 1591 — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/src/core/Allocator/CountdownWrapper.cs:4— #pragma warning disable 0162 — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/src/core/Allocator/MallocFixedPageSize.cs:4— #pragma warning disable 0162 — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/src/core/TsavoriteLog/CommitFailureException.cs:4— #pragma warning disable 0162 — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/src/core/TsavoriteLog/CommitInfo.cs:4— #pragma warning disable 0162 — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/src/core/Allocator/ObjectSerialization/ObjectLogReader.cs:42— #pragma warning disable IDE0290 // Use primary constructor — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/src/core/Allocator/ObjectSerialization/ObjectLogWriter.cs:62— #pragma warning disable IDE0290 // Use primary constructor — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/src/core/Allocator/TsavoriteLogAllocatorImpl.cs:19— #pragma warning disable IDE0290 // Use primary constructor — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/src/core/Index/Common/LogAddress.cs:4— #pragma warning disable IDE1006 // Naming Styles: Must begin with uppercase letter — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
FileScopedPragmaDisable libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Constants.cs:4— #pragma warning disable IDE1006 // Naming Styles: Must begin with uppercase letter — the disable has no matching restore anywhere in this file, so it does not end with the construct that needed it: it runs to the end of the file and silences the rule for everything written below, including code added years later that nobody weighed against it. Close it with the matching restore directive immediately after the construct it covers — that alone turns a standing exemption into a scoped one — or fix the cause and drop the directive entirely.
NoWarnInCsproj — 7 warning codes suppressed in one element playground/LightEpochLitmus/LightEpochLitmus.csproj:13— A single <NoWarn> suppresses 7 warning codes (1701;1702;1591;IDE0130;IDE0065;IDE0007;IDE0048) in one stroke — one team-wide decision, not 7 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 7 warning codes suppressed in one element libs/storage/Tsavorite/cs/test/Tsavorite.test.csproj:10— A single <NoWarn> suppresses 7 warning codes (1701;1702;1591;IDE0130;IDE0065;IDE0007;IDE0048) in one stroke — one team-wide decision, not 7 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 7 warning codes suppressed in one element libs/storage/Tsavorite/cs/test/test.stress/Tsavorite.test.stress.csproj:10— A single <NoWarn> suppresses 7 warning codes (1701;1702;1591;IDE0130;IDE0065;IDE0007;IDE0048) in one stroke — one team-wide decision, not 7 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 7 warning codes suppressed in one element libs/storage/Tsavorite/cs/test/test.session/Tsavorite.test.session.csproj:10— A single <NoWarn> suppresses 7 warning codes (1701;1702;1591;IDE0130;IDE0065;IDE0007;IDE0048) in one stroke — one team-wide decision, not 7 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 7 warning codes suppressed in one element libs/storage/Tsavorite/cs/test/test.session.context/Tsavorite.test.session.context.csproj:10— A single <NoWarn> suppresses 7 warning codes (1701;1702;1591;IDE0130;IDE0065;IDE0007;IDE0048) in one stroke — one team-wide decision, not 7 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 7 warning codes suppressed in one element libs/storage/Tsavorite/cs/test/test.recovery/Tsavorite.test.recovery.csproj:10— A single <NoWarn> suppresses 7 warning codes (1701;1702;1591;IDE0130;IDE0065;IDE0007;IDE0048) in one stroke — one team-wide decision, not 7 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 7 warning codes suppressed in one element libs/storage/Tsavorite/cs/test/test.recordops/Tsavorite.test.recordops.csproj:10— A single <NoWarn> suppresses 7 warning codes (1701;1702;1591;IDE0130;IDE0065;IDE0007;IDE0048) in one stroke — one team-wide decision, not 7 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 7 warning codes suppressed in one element libs/storage/Tsavorite/cs/test/test.hlog/Tsavorite.test.hlog.csproj:10— A single <NoWarn> suppresses 7 warning codes (1701;1702;1591;IDE0130;IDE0065;IDE0007;IDE0048) in one stroke — one team-wide decision, not 7 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 7 warning codes suppressed in one element libs/storage/Tsavorite/cs/test/test.epoch/Tsavorite.test.epoch.csproj:8— A single <NoWarn> suppresses 7 warning codes (1701;1702;1591;IDE0130;IDE0065;IDE0007;IDE0048) in one stroke — one team-wide decision, not 7 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj — 7 warning codes suppressed in one element libs/storage/Tsavorite/cs/test/stress/MLPAStress/MLPAStress.csproj:11— A single <NoWarn> suppresses 7 warning codes (1701;1702;1591;IDE0130;IDE0065;IDE0007;IDE0048) in one stroke — one team-wide decision, not 7 independent debts. Review the set centrally rather than code-by-code; each code you can re-enable is one less blanket suppression. (Every code still counts toward the score and metrics.)
NoWarnInCsproj libs/host/Garnet.host.csproj:65— NU5118 — this warning is switched off for the WHOLE project, including builds years from now. It is raised by the build itself — the packaging, restore or SDK step — about the project as a whole, not by the compiler or an analyzer at a line of code, so there is no call site to narrow it to and no per-site directive that could carry a reason: this element is the only place the decision can be recorded. Say WHY here, in a comment on the entry, or fix what the rule is reporting and drop the code from the list.
Orphaned knowledge modules/GarnetJSON/JSONPath/JsonPath.cs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge libs/server/Resp/RespCommandKeySpecification.cs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge libs/server/Resp/RespCommandsInfo.cs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Orphaned knowledge libs/server/Resp/RespCommandArgument.cs:1— No living knowledge remains for this large file — its last meaningful change has decayed away; if it breaks, no one currently understands it. Schedule a read-through / add characterisation tests before it bites.
Namespace dependency cycle libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.Chunked.cs:8— The namespaces Tsavorite.core ↔ Tsavorite.core.Allocator.ObjectSerialization depend on each other. The lightest dependency in the cycle is Tsavorite.core → Tsavorite.core.Allocator.ObjectSerialization (Tsavorite.core.CachedChunkSerializer → Tsavorite.core.Allocator.ObjectSerialization.ChunkedObjectSerializer, 3 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
Namespace dependency cycle metrics/HdrHistogram/HistogramBase.cs:15— The namespaces HdrHistogram ↔ HdrHistogram.Iteration depend on each other. The lightest dependency in the cycle is HdrHistogram → HdrHistogram.Iteration (HdrHistogram.HistogramBase → HdrHistogram.Iteration.HistogramIterationValue, 2 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
Namespace dependency cycle libs/common/LightClient.cs:12— The namespaces Garnet.common ↔ Garnet.networking ↔ Garnet.server ↔ Garnet.server.ACL ↔ Garnet.server.Auth ↔ Garnet.server.Auth.Settings ↔ Garnet.server.Custom ↔ Garnet.server.Lua depend on each other. The lightest dependency in the cycle is Garnet.common → Garnet.server (Garnet.common.LightClient → Garnet.server.LightClientTcpNetworkHandler, 1 type pair(s)); cut that one first, e.g. by moving the shared type to a namespace both can use or inverting it behind an interface.
NoWarnInCsproj repeated across 21 files test/standalone/Garnet.test/Garnet.test.csproj:10— The identical NoWarnInCsproj (`1701`) appears in 21 files (21 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 21 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
NoWarnInCsproj repeated across 21 files test/standalone/Garnet.test/Garnet.test.csproj:10— The identical NoWarnInCsproj (`1702`) appears in 21 files (21 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 21 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
NoWarnInCsproj repeated across 21 files test/standalone/Garnet.test/Garnet.test.csproj:10— The identical NoWarnInCsproj (`1591`) appears in 21 files (21 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 21 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
AnalyzerSeverityNone .editorconfig:68— VSTHRD003 — this rule is switched off for every file the section matches, in every project under this directory, and the only record that it was ever switched off is this line: nothing at the sites it would have reported says so, so a reader of that code has no reason to look here, and code added years from now inherits the decision silently. Fix what the rule reports and delete the entry, or — where some sites really are legitimate — leave the rule on and suppress it at those sites with their reasons, so it keeps protecting the rest of the tree. If the rule is genuinely unwanted here, say why — on this line after the entry, or in the comment run directly above it: a comment that only repeats the rule's own title is read as no explanation at all and leaves this row in place.
AnalyzerSeverityNone .editorconfig:69— VSTHRD114 — this rule is switched off for every file the section matches, in every project under this directory, and the only record that it was ever switched off is this line: nothing at the sites it would have reported says so, so a reader of that code has no reason to look here, and code added years from now inherits the decision silently. Fix what the rule reports and delete the entry, or — where some sites really are legitimate — leave the rule on and suppress it at those sites with their reasons, so it keeps protecting the rest of the tree. If the rule is genuinely unwanted here, say why — on this line after the entry, or in the comment run directly above it: a comment that only repeats the rule's own title is read as no explanation at all and leaves this row in place.
InvertedNullGuard libs/cluster/Server/Gossip/Gossip.cs:286— if (lastGsn == null) … lastGsn.TryInitializeAsync — the guard has already decided this variable is null on the way into this branch, and nothing here gives it another value, so this dereference cannot run without throwing a NullReferenceException. It survives because the branch is the uncommon one: the code is correct on every input where the variable is set, and crashes on exactly the case the branch was written to handle. Decide which the line meant — if it is reporting the absence, it must not read through the missing value (use the other variable that identifies it, or a literal); if it is meant to work on a value, it belongs in the other branch.
FileScopedPragmaDisable repeated across 10 files libs/server/Objects/Hash/HashObject.cs:18— The identical FileScopedPragmaDisable (`#pragma warning disable CS1591 // Missing XML comment for publicly visible type or member`) appears in 10 files (10 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 10 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
FileScopedPragmaDisable repeated across 27 files libs/server/Storage/Functions/UnifiedStore/ReadMethods.cs:10— The identical FileScopedPragmaDisable (`#pragma warning disable IDE0065 // Misplaced using directive`) appears in 27 files (27 occurrences) — a single repo-wide policy (e.g. a Directory.Build.props decision or an idiomatic suppression), not 27 independent debts. Decide it once centrally rather than file-by-file. (Every occurrence still counts toward the score and metrics.)
S1 · Cryptographic Hygiene· Password hashing without a KDF · ×1
Password hashing without a KDF libs/server/ACL/ACLPassword.cs:37— `SHA256.HashData(…)` puts the password `password` through SHA256, a fast general-purpose digest, so a stolen hash is guessed at billions of candidates a second whether or not it is salted — no key-derivation function (PBKDF2/scrypt/Argon2/bcrypt) stands between the password and the stored value.
TLS certificate validation disabled playground/GarnetClientStress/StressTestUtil.cs:40— `RemoteCertificateValidationCallback` is assigned a callback that returns `true` unconditionally, so every TLS peer certificate is accepted — including one an attacker presents. Chain, expiry, revocation and hostname are all skipped, so an attacker on the network path can present any certificate and read or rewrite the traffic — the connection is encrypted to the attacker, not to the intended host. Delete the override and let the platform validate. If a specific self-signed or internally-issued certificate genuinely has to be trusted, pin THAT one — compare the presented certificate's public key or thumbprint against the expected value and return `false` for everything else — and scope it to the single handler that talks to that host rather than to the whole process. If the override exists only to get past a development certificate, gate it on a build configuration or an explicit opt-in setting so it cannot ship.
S1 · Cryptographic Hygiene· Cryptographic key material is a compile-time constant · ×1
Cryptographic key material is a compile-time constant benchmark/BDN.benchmark/Operations/OperationsBase.cs:188— The value is the token-signing key and is a compile-time constant, so the secret this operation depends on is published with the source. A key that ships with the source is not secret: every contributor, fork, mirror and released binary carries it, so anyone holding the repository can decrypt what any installation encrypted, and there is no way to invalidate what was already protected because every deployment built from this source shares the value. Where the constant is a password salt the consequence differs but is no smaller — one global salt means precomputation amortises across every installation, which is the property salting exists to destroy. Read the value from configuration, an environment variable or a secrets manager at startup and FAIL FAST when it is absent, so a missing key stops the process instead of silently falling back to a shared default; treat the committed value as disclosed and rotate it rather than only deleting the line. For a salt, generate a fresh random one per password and store it alongside the hash.
TodoComment benchmark/BDN.benchmark/Operations/OperationsBase.cs:126— // TODO: Should this change to a LocalMemoryDevice as well (perhaps optionally) to test the write impact against that? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/cluster/Server/Failover/FailoverSession.cs:62— // TODO: move connection initialization at start of async primary failover — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/cluster/Server/Failover/ReplicaFailoverSession.cs:317— //TODO: implement voting — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/cluster/Server/Migration/MigrationDriver.cs:85— // TODO: Need to relinquish any migrating Vector Set contexts from target node — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/cluster/Server/Replication/PrimaryOps/ReplicationPrimaryAofSync.cs:45— // TODO: why do we need to verify this? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/cluster/Server/Replication/ReplicationManager.cs:61— // Replica will adjust replication offset as it receives data from primary (TODO: since AOFs are synced this might obsolete) — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/common/ClientBase.cs:97— //TODO: Re-enable to catch token counting errors. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/common/GarnetKeyComparer.cs:137— // TODO: Better hash construction? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/common/GarnetKeyComparer.cs:144— // TODO: Better hash construction? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/common/LightClient.cs:289— // TODO: Re-enable to catch token counting errors. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/AOF/AofProcessor.cs:687— // TODO native deserializer to avoid alloc and copy — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/AOF/AofProcessor.cs:770— // TODO native deserializer to avoid alloc and copy — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/AOF/GarnetAppendOnlyFile.cs:200— // TODO: shouldn't we use the remote cEntry's tail address here since replica will recover to that? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/AOF/Recover/AofRecover.cs:96— // TODO perf: convert to push iterator that doesn't need a copy to the entry. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/AOF/Recover/AofRecover.cs:151— // TODO: Can we async this method rather than blocking? We're in recovery. — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/Databases/DatabaseManagerBase.cs:572— // TODO: replica should instead wait until the next AOF commit is done via primary — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/GarnetDatabase.cs:19— // TODO: Change map size to a reasonable number — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/Lua/LuaStateWrapper.cs:51— // TODO: Consider a better way to do this? — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/Objects/SortedSetGeo/GeoHash.cs:26— // TODO: These are "wrong" in a sense that according to EPSG:3857 latitude should be from -85.05112878 to 85.05112878 — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/Resp/HyperLogLog/HyperLogLog.cs:944— //TODO: check if we can update in place or need to grow by counting srcBlob non-zero — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/Resp/Parser/RespCommand.cs:654— // TODO: validate if these cases need to be excluded — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/Resp/RangeIndex/RangeIndexManager.Migration.cs:141— // TODO(RI): Implement REPLACE for RI keys — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/Resp/RangeIndex/RangeIndexManager.Migration.cs:154— // TODO(RI): Acquire Checkpoint lock to prevent a concurrent checkpoint from deleting the — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/Resp/RangeIndex/RangeIndexManager.Migration.cs:157— // TODO(RI): Create RangeIndex first in Tsavorite and only then chunk and replicate through AOF — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
TodoComment libs/server/Resp/RangeIndex/RangeIndexManager.Migration.cs:165— // TODO(RI): The KeyExists check above is not race-free. The destination slot is in — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
Dead code: OperationParamsProvider benchmark/BDN.benchmark/Operations/RangeIndexOperations.cs:44— Method OperationParamsProvider — Roslyn's SymbolFinder walked every project the solution loads, including BDN.benchmark, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: maxChunkSize benchmark/Resp.benchmark/OfflineBench/AOFBench/AofReplayStream.cs:14— Field maxChunkSize — Roslyn's SymbolFinder walked every project the solution loads, including Resp.benchmark, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: GetClusterNodes benchmark/Resp.benchmark/OfflineBench/AOFBench/AofReplayStream.cs:55— Method GetClusterNodes — Roslyn's SymbolFinder walked every project the solution loads, including Resp.benchmark, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: GetRespServerSession benchmark/Resp.benchmark/OfflineBench/GarnetServerInstance.cs:52— Method GetRespServerSession — Roslyn's SymbolFinder walked every project the solution loads, including Resp.benchmark, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: LoadDatabaseStringSet benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:611— Method LoadDatabaseStringSet — Roslyn's SymbolFinder walked every project the solution loads, including Resp.benchmark, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: PadRandom benchmark/Resp.benchmark/OnlineBench/OnlineReqGen.cs:208— Method PadRandom — Roslyn's SymbolFinder walked every project the solution loads, including Resp.benchmark, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: WriteOrSendSegmentedRecordAsync libs/cluster/Server/Migration/MigrateSessionCommonUtils.cs:259— Method WriteOrSendSegmentedRecordAsync — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.cluster, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: TryValidateAddress libs/common/Format.cs:247— Method TryValidateAddress — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.common, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: MurmurHash3x64A libs/common/HashUtils.cs:38— Method MurmurHash3x64A — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.common, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: MurmurHash3x64 libs/common/HashUtils.cs:94— Method MurmurHash3x64 — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.common, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: SetNumMessagesProtocol libs/common/Networking/BatchHeader.cs:60— Method SetNumMessagesProtocol — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.common, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: TaskToApm libs/common/Networking/TaskToApm.cs:23— NamedType TaskToApm — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.common, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: TryReadByteArrayWithLengthHeader libs/common/RespReadUtils.cs:747— Method TryReadByteArrayWithLengthHeader — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.common, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: TryReadDoubleWithLengthHeader libs/common/RespReadUtils.cs:1151— Method TryReadDoubleWithLengthHeader — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.common, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: TryOpen libs/common/Synchronization/ActiveWorkerMonitor.cs:62— Method TryOpen — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.common, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: FileToContentTransformer libs/host/Configuration/GarnetCustomTransformers.cs:41— NamedType FileToContentTransformer — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.host, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: ArrayToFirstItemTransformer libs/host/Configuration/GarnetCustomTransformers.cs:73— NamedType ArrayToFirstItemTransformer — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.host, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: Localhost libs/host/Configuration/OptionsValidators.cs:353— Field Localhost — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.host, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: ClearUsers libs/server/ACL/AccessControlList.cs:109— Method ClearUsers — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.server, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: ACLUserDoesNotExistException libs/server/ACL/ACLException.cs:76— NamedType ACLUserDoesNotExistException — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.server, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: MinExchange libs/server/AOF/AofAddress.cs:300— Method MinExchange — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.server, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: AofStoreType libs/server/AOF/AofEntryType.cs:106— NamedType AofStoreType — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.server, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: GetBeginAddress libs/server/AOF/GarnetLog.cs:289— Method GetBeginAddress — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.server, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: FormatScratch libs/server/ArgSlice/ScratchBufferBuilder.cs:256— Method FormatScratch — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.server, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
Dead code: FormatScratch libs/server/ArgSlice/ScratchBufferBuilder.cs:326— Method FormatScratch — Roslyn's SymbolFinder walked every project the solution loads, including Garnet.server, and found no reference to it. That walk cannot see three kinds of caller, so check them before removing it: code outside the solution file (a solution is a curated list, not the repository — a sibling test tree with its own .sln is invisible), a call resolved by reflection or dependency injection from the symbol's name, and any project the workspace could not load. This is 'no caller found by this walk', not a verdict that the symbol is unused.
TooManyMethods: RespServerSession libs/server/Resp/BasicCommands.cs— TooManyMethods — 9691 significant lines (blank, comment-only and punctuation-only lines excluded), 399 methods, declared across 34 files: Resp/BasicCommands.cs (49), Resp/RespServerSession.cs (45), Resp/RespServerSessionOutput.cs (32), Objects/SortedSetCommands.cs (27), +30 more file(s). The bar is 30 methods; this is 369 over it, 13.30× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: StorageSession libs/server/Storage/Session/ObjectStore/SortedSetOps.cs— TooManyMethods — 3983 significant lines (blank, comment-only and punctuation-only lines excluded), 269 methods, declared across 21 files: ObjectStore/SortedSetOps.cs (49), MainStore/MainStoreOps.cs (33), ObjectStore/HashOps.cs (27), ObjectStore/SetOps.cs (27), +17 more file(s). The bar is 30 methods; this is 239 over it, 8.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GarnetApi libs/server/API/GarnetApiObjectCommands.cs— TooManyMethods — 529 significant lines (blank, comment-only and punctuation-only lines excluded), 237 methods, declared across 3 files: API/GarnetApiObjectCommands.cs (129), API/GarnetApi.cs (93), API/GarnetApiUnifiedCommands.cs (15). The bar is 30 methods; this is 207 over it, 7.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: TsavoriteKV libs/storage/Tsavorite/cs/src/core/Index/Recovery/Recovery.cs— TooManyMethods — 3481 significant lines (blank, comment-only and punctuation-only lines excluded), 204 methods, declared across 29 files: Recovery/Recovery.cs (35), Tsavorite/Tsavorite.cs (34), Implementation/Helpers.cs (19), Implementation/FindRecord.cs (10), +25 more file(s). The bar is 30 methods; this is 174 over it, 6.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: GarnetClient libs/client/GarnetClientAPI/GarnetClientBasicRespCommands.cs— TooManyMethods — 1453 significant lines (blank, comment-only and punctuation-only lines excluded), 192 methods, declared across 9 files: GarnetClientAPI/GarnetClientBasicRespCommands.cs (63), GarnetClientAPI/GarnetClientExecuteAPI.cs (62), client/GarnetClient.cs (30), GarnetClientAPI/GarnetClientSortedSetCommands.cs (10), +5 more file(s). The bar is 30 methods; this is 162 over it, 6.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.
TooManyMethods: TsavoriteLog libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs— TooManyMethods — 1822 significant lines (blank, comment-only and punctuation-only lines excluded), 135 methods, declared across 2 files: TsavoriteLog/TsavoriteLog.cs (120), TsavoriteLog/TsavoriteLog.Chunked.cs (15). The bar is 30 methods; this is 105 over it, 4.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.
TooManyMethods: VectorManager libs/server/Resp/Vector/VectorManager.cs— TooManyMethods — 2741 significant lines (blank, comment-only and punctuation-only lines excluded), 125 methods, declared across 12 files: Vector/VectorManager.cs (31), Vector/VectorManager.Replication.cs (21), Vector/VectorManager.Index.cs (11), Vector/VectorManager.Cleanup.cs (10), +8 more file(s). The bar is 30 methods; this is 95 over it, 4.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: AllocatorBase libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorBase.cs— TooManyMethods — 1444 significant lines (blank, comment-only and punctuation-only lines excluded), 113 methods, declared across 3 files: Allocator/AllocatorBase.cs (95), Allocator/AllocatorScan.cs (14), Recovery/Recovery.cs (4). The bar is 30 methods; this is 83 over it, 3.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: GarnetWatchApi libs/server/API/GarnetWatchApi.cs— TooManyMethods — 277 significant lines (blank, comment-only and punctuation-only lines excluded), 89 methods. The bar is 30 methods; this is 59 over it, 2.97× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ClusterSession libs/cluster/Session/RespClusterBasicCommands.cs— TooManyMethods — 1970 significant lines (blank, comment-only and punctuation-only lines excluded), 88 methods, declared across 14 files: Session/RespClusterBasicCommands.cs (17), Session/ClusterSession.cs (14), Session/RespClusterReplicationCommands.cs (14), Session/RespClusterSlotManagementCommands.cs (14), +10 more file(s). The bar is 30 methods; this is 58 over it, 2.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ClusterConfig libs/cluster/Server/ClusterConfig.cs— TooManyMethods — 824 significant lines (blank, comment-only and punctuation-only lines excluded), 80 methods, declared across 2 files: Server/ClusterConfig.cs (71), Server/ClusterConfigSerializer.cs (9). The bar is 30 methods; this is 50 over it, 2.67× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: MainSessionFunctions libs/server/Storage/Functions/MainStore/PrivateMethods.cs— TooManyMethods — 2032 significant lines (blank, comment-only and punctuation-only lines excluded), 77 methods, declared across 10 files: MainStore/PrivateMethods.cs (21), MainStore/RMWMethods.Etags.cs (12), MainStore/UpsertMethods.cs (11), MainStore/RMWMethods.cs (9), +6 more file(s). The bar is 30 methods; this is 47 over it, 2.57× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: NativeMethods libs/server/Lua/NativeMethods.cs— TooManyMethods — 204 significant lines (blank, comment-only and punctuation-only lines excluded), 75 methods. The bar is 30 methods; this is 45 over it, 2.50× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
TooManyMethods: NativeStorageDevice libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs— TooManyMethods — 842 significant lines (blank, comment-only and punctuation-only lines excluded), 74 methods. The bar is 30 methods; this is 44 over it, 2.47× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LuaRunner libs/server/Lua/LuaRunner.Functions.cs— TooManyMethods — 3309 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods, declared across 4 files: Lua/LuaRunner.Functions.cs (35), Lua/LuaRunner.cs (22), Lua/LuaRunner.Functions.Struct.cs (9), Lua/LuaRunner.Loader.cs (2). The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TransactionalContext libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs— TooManyMethods — 412 significant lines (blank, comment-only and punctuation-only lines excluded), 68 methods. The bar is 30 methods; this is 38 over it, 2.27× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: TransactionalUnsafeContext libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs— TooManyMethods — 248 significant lines (blank, comment-only and punctuation-only lines excluded), 65 methods. The bar is 30 methods; this is 35 over it, 2.17× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ClientRequestProvider benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs— TooManyMethods — 1537 significant lines (blank, comment-only and punctuation-only lines excluded), 64 methods, declared across 4 files: ClusterBench/ClientRequestProvider.WorkerPool.cs (27), ClusterBench/ClientRequestProvider.cs (18), ClusterBench/ClientRequestProvider.Offline.cs (13), ClusterBench/ClientRequestProvider.Online.cs (6). The bar is 30 methods; this is 34 over it, 2.13× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: HyperLogLog libs/server/Resp/HyperLogLog/HyperLogLog.cs— TooManyMethods — 571 significant lines (blank, comment-only and punctuation-only lines excluded), 63 methods. The bar is 30 methods; this is 33 over it, 2.10× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: RangeIndexManager libs/server/Resp/RangeIndex/RangeIndexManager.cs— TooManyMethods — 842 significant lines (blank, comment-only and punctuation-only lines excluded), 62 methods, declared across 5 files: RangeIndex/RangeIndexManager.cs (28), RangeIndex/RangeIndexManager.Replication.cs (12), RangeIndex/RangeIndexManager.Index.cs (11), RangeIndex/RangeIndexManager.Migration.cs (6), +1 more file(s). 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: TransactionalConsistentReadContext libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalConsistentReadContext.cs— TooManyMethods — 196 significant lines (blank, comment-only and punctuation-only lines excluded), 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: DatabaseManagerBase libs/server/Databases/DatabaseManagerBase.cs— TooManyMethods — 328 significant lines (blank, comment-only and punctuation-only lines excluded), 61 methods. The bar is 30 methods; this is 31 over it, 2.03× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: LogRecord libs/storage/Tsavorite/cs/src/core/Allocator/LogRecord.cs— TooManyMethods — 767 significant lines (blank, comment-only and punctuation-only lines excluded), 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: ObjectAllocatorImpl libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs— TooManyMethods — 765 significant lines (blank, comment-only and punctuation-only lines excluded), 60 methods. The bar is 30 methods; this is 30 over it, 2.00× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
TooManyMethods: SortedSetObject libs/server/Objects/SortedSet/SortedSetObject.cs— TooManyMethods — 1096 significant lines (blank, comment-only and punctuation-only lines excluded), 58 methods, declared across 3 files: SortedSet/SortedSetObject.cs (28), SortedSet/SortedSetObjectImpl.cs (25), SortedSetGeo/SortedSetGeoObjectImpl.cs (5). The bar is 30 methods; this is 28 over it, 1.93× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
MethodTooLong: LuaRunner.WriteResponse libs/server/Lua/LuaRunner.cs:1570— MethodTooLong — WriteResponse runs 421 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 321 over it, 4.21× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RespServerSession.NetworkVSIM libs/server/Resp/Vector/RespServerSessionVectors.cs:804— MethodTooLong — NetworkVSIM runs 356 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 256 over it, 3.56× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MainSessionFunctions.InPlaceUpdaterWorker libs/server/Storage/Functions/MainStore/RMWMethods.cs:460— MethodTooLong — InPlaceUpdaterWorker runs 301 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 201 over it, 3.01× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LuaRunner.CMsgPackUnpack libs/server/Lua/LuaRunner.Functions.cs:2159— MethodTooLong — CMsgPackUnpack runs 298 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 198 over it, 2.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: MainSessionFunctions.CopyUpdater libs/server/Storage/Functions/MainStore/RMWMethods.cs:1068— MethodTooLong — CopyUpdater runs 284 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 184 over it, 2.84× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RespCommandHashLookup.PopulatePrimaryTable libs/server/Resp/Parser/RespCommandHashLookupData.cs:14— MethodTooLong — PopulatePrimaryTable runs 265 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 165 over it, 2.65× 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: LuaRunner.ProcessSingleRespTerm libs/server/Lua/LuaRunner.cs:579— MethodTooLong — ProcessSingleRespTerm runs 262 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 162 over it, 2.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: ReqGen.WriteOp benchmark/Resp.benchmark/OfflineBench/ReqGenUtils.cs:22— MethodTooLong — WriteOp runs 253 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 153 over it, 2.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LuaRunner.CMsgPackPack libs/server/Lua/LuaRunner.Functions.cs:1652— MethodTooLong — CMsgPackPack runs 253 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 153 over it, 2.53× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: RespServerSession.NetworkVADD libs/server/Resp/Vector/RespServerSessionVectors.cs:293— MethodTooLong — NetworkVADD runs 241 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 141 over it, 2.41× 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: Options.GetServerOptions libs/host/Configuration/Options.cs:804— MethodTooLong — GetServerOptions runs 228 significant lines (blank, comment-only and punctuation-only lines excluded) 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: LuaRunner.StructPack libs/server/Lua/LuaRunner.Functions.Struct.cs:267— MethodTooLong — StructPack runs 198 significant lines (blank, comment-only and punctuation-only lines excluded) 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: MainSessionFunctions.InitialUpdater libs/server/Storage/Functions/MainStore/RMWMethods.cs:78— MethodTooLong — InitialUpdater runs 189 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 89 over it, 1.89× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: BitmapManager.InvokeNaryBitwiseOperation libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:66— MethodTooLong — InvokeNaryBitwiseOperation runs 177 significant lines (blank, comment-only and punctuation-only lines excluded) 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: LuaRunner.StructUnpack libs/server/Lua/LuaRunner.Functions.Struct.cs:649— MethodTooLong — StructUnpack runs 173 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 73 over it, 1.73× 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: ClusterSession.NetworkTryMIGRATE libs/cluster/Session/MigrateCommand.cs:63— MethodTooLong — NetworkTryMIGRATE runs 170 significant lines (blank, comment-only and punctuation-only lines excluded) 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: TsavoriteKV.CreateNewRecordRMW libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:379— MethodTooLong — CreateNewRecordRMW runs 169 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 69 over it, 1.69× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: MainSessionFunctions.CopyRespToWithInput libs/server/Storage/Functions/MainStore/PrivateMethods.cs:88— MethodTooLong — CopyRespToWithInput runs 166 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 66 over it, 1.66× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: LuaRunner.CJsonEncode libs/server/Lua/LuaRunner.Functions.cs:1107— MethodTooLong — CJsonEncode runs 165 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 65 over it, 1.65× 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: RespServerSession.ProcessArrayCommands libs/server/Resp/RespServerSession.cs:956— MethodTooLong — ProcessArrayCommands runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× 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: SessionParseStateExtensions.TryGetGeoSearchOptions libs/server/SessionParseStateExtensions.cs:264— MethodTooLong — TryGetGeoSearchOptions runs 164 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 64 over it, 1.64× 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: AofReplayCoordinator.ProcessTransactionGroup libs/server/AOF/ReplayCoordinator/AofReplayCoordinator.cs:394— MethodTooLong — ProcessTransactionGroup runs 155 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 55 over it, 1.55× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
MethodTooLong: ObjectAllocatorImpl.WriteAsync libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:699— MethodTooLong — WriteAsync runs 146 significant lines (blank, comment-only and punctuation-only lines excluded) 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: ClusterSession.NetworkClusterMigrate libs/cluster/Session/RespClusterMigrateCommands.cs:74— MethodTooLong — NetworkClusterMigrate runs 137 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 37 over it, 1.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.
MethodTooLong: GarnetServerOptions.GetSettings libs/server/Servers/GarnetServerOptions.cs:1016— MethodTooLong — GetSettings runs 136 significant lines (blank, comment-only and punctuation-only lines excluded) in one body. The bar is 100 significant lines; this is 36 over it, 1.36× the bar. This is length, not branching: a long straight-line body scores low on complexity and is still read whole to change any part of it, so the complexity numbers beside this row neither confirm nor excuse it. To reduce it, extract each cohesive step of the body — the runs of statements that work on the same values and would earn the same name — into its own named unit, and have this one call them in order.
Sync-over-async blocking — 126 blocking call(s) on async work (.Wait()/.GetAwaiter().GetResult()) — these waste a thread and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/BDN.benchmark/Cluster/EpochBumpContention.cs:156— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/BDN.benchmark/Cluster/EpochBumpContention.cs:158— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:623— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:635— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:636— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:688— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:698— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:320— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:334— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:360— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:391— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:404— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:122— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:132— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:133— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:264— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:266— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:268— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:448— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:458— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:847— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:864— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:967— `.GetAwaiter().GetResult()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Sync-over-async blocking benchmark/Resp.benchmark/OfflineBench/AOFBench/AofBench.cs:164— `waiter.Wait()` blocks this thread until the async work completes — it wastes a thread-pool thread for as long as the work runs and can deadlock wherever a synchronization context is in play (a UI thread, or a caller that has one).
Hotspot: libs/server/Storage/Functions/MainStore/RMWMethods.cs libs/server/Storage/Functions/MainStore/RMWMethods.cs:460— libs/server/Storage/Functions/MainStore/RMWMethods.cs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 107 in MainSessionFunctions.InPlaceUpdaterWorker at line 460. 4 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Storage/Functions/MainStore/RMWMethods.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/Resp/Vector/RespServerSessionVectors.cs libs/server/Resp/Vector/RespServerSessionVectors.cs:804— libs/server/Resp/Vector/RespServerSessionVectors.cs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 122 in RespServerSession.NetworkVSIM at line 804. 2 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Resp/Vector/RespServerSessionVectors.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/host/Configuration/Options.cs libs/host/Configuration/Options.cs:804— libs/host/Configuration/Options.cs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in Options.GetServerOptions at line 804. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/host/Configuration/Options.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:699— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs changed 10 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 38 in ObjectAllocatorImpl.WriteAsync at line 699. 6 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/Resp/Vector/VectorManager.cs libs/server/Resp/Vector/VectorManager.cs:320— libs/server/Resp/Vector/VectorManager.cs changed 13 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 29 in VectorManager.ReconcileRecoveredState at line 320. 7 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Resp/Vector/VectorManager.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/Servers/GarnetServerOptions.cs libs/server/Servers/GarnetServerOptions.cs:1016— libs/server/Servers/GarnetServerOptions.cs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 43 in GarnetServerOptions.GetSettings at line 1016. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Servers/GarnetServerOptions.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/AOF/AofProcessor.cs libs/server/AOF/AofProcessor.cs:240— libs/server/AOF/AofProcessor.cs changed 9 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in AofProcessor.ProcessAofRecordInternal at line 240. 2 of those changes were fix/bug commits, and the other 7 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/AOF/AofProcessor.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/Storage/Functions/MainStore/VarLenInputMethods.cs libs/server/Storage/Functions/MainStore/VarLenInputMethods.cs:210— libs/server/Storage/Functions/MainStore/VarLenInputMethods.cs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 51 in MainSessionFunctions.GetRMWModifiedFieldInfo at line 210. 2 of those changes were fix/bug commits, and the other 3 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Storage/Functions/MainStore/VarLenInputMethods.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:379— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in TsavoriteKV.CreateNewRecordRMW at line 379. 3 of those changes were fix/bug commits, so the churn is repair rather than feature work. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/Resp/BasicCommands.cs libs/server/Resp/BasicCommands.cs:605— libs/server/Resp/BasicCommands.cs changed 8 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 31 in RespServerSession.NetworkSETEXNX at line 605. 2 of those changes were fix/bug commits, and the other 6 changed it for other reasons — this file is under both repair and feature pressure. Before the next change lands here, make sure the area it touches is under test, then split that area out of the file so the following change is smaller than this one — a file this often edited pays the complexity back every time. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Resp/BasicCommands.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/Storage/Functions/MainStore/PrivateMethods.cs libs/server/Storage/Functions/MainStore/PrivateMethods.cs:88— libs/server/Storage/Functions/MainStore/PrivateMethods.cs changed 3 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 61 in MainSessionFunctions.CopyRespToWithInput at line 88. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Storage/Functions/MainStore/PrivateMethods.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/Resp/Vector/VectorManager.Locking.cs libs/server/Resp/Vector/VectorManager.Locking.cs:152— libs/server/Resp/Vector/VectorManager.Locking.cs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 30 in VectorManager.ReadVectorIndexCore at line 152. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Resp/Vector/VectorManager.Locking.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/cluster/Server/Gossip/Gossip.cs libs/cluster/Server/Gossip/Gossip.cs:320— libs/cluster/Server/Gossip/Gossip.cs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 27 in ClusterManager.GossipMainAsync at line 320. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/cluster/Server/Gossip/Gossip.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/host/GarnetServer.cs libs/host/GarnetServer.cs:170— libs/host/GarnetServer.cs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in GarnetServer.InitializeServer at line 170. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/host/GarnetServer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/Resp/Objects/SortedSetCommands.cs libs/server/Resp/Objects/SortedSetCommands.cs:1048— libs/server/Resp/Objects/SortedSetCommands.cs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 26 in RespServerSession.SortedSetIntersect at line 1048. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Resp/Objects/SortedSetCommands.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/Resp/Vector/VectorManager.Replication.cs libs/server/Resp/Vector/VectorManager.Replication.cs:519— libs/server/Resp/Vector/VectorManager.Replication.cs changed 7 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in VectorManager.QueueVectorReplay at line 519. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Resp/Vector/VectorManager.Replication.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/Resp/RespServerSession.cs libs/server/Resp/RespServerSession.cs:545— libs/server/Resp/RespServerSession.cs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 24 in RespServerSession.TryConsumeMessages at line 545. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Resp/RespServerSession.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:1402— libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 32 in NativeStorageDevice.EnsureNativeDeviceCreated at line 1402. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/cluster/Session/MigrateCommand.cs libs/cluster/Session/MigrateCommand.cs:63— libs/cluster/Session/MigrateCommand.cs changed 2 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 63 in ClusterSession.NetworkTryMIGRATE at line 63. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/cluster/Session/MigrateCommand.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:3050— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs changed 6 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 17 in TsavoriteLog.RestoreSpecificCommitAsync at line 3050. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/cluster/Server/ClusterProvider.cs libs/cluster/Server/ClusterProvider.cs:218— libs/cluster/Server/ClusterProvider.cs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 20 in ClusterProvider.GetReplicationInfo at line 218. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/cluster/Server/ClusterProvider.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/storage/Tsavorite/cs/src/core/Index/Recovery/IndexCheckpoint.cs libs/storage/Tsavorite/cs/src/core/Index/Recovery/IndexCheckpoint.cs:139— libs/storage/Tsavorite/cs/src/core/Index/Recovery/IndexCheckpoint.cs changed 5 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 18 in TsavoriteBase.BeginMainIndexCheckpoint at line 139. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/storage/Tsavorite/cs/src/core/Index/Recovery/IndexCheckpoint.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/Resp/Vector/VectorManager.Quantization.cs libs/server/Resp/Vector/VectorManager.Quantization.cs:99— libs/server/Resp/Vector/VectorManager.Quantization.cs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in VectorManager.StartQuantizationAndImportTasks at line 99. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Resp/Vector/VectorManager.Quantization.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/cluster/Session/RespClusterBasicCommands.cs libs/cluster/Session/RespClusterBasicCommands.cs:362— libs/cluster/Session/RespClusterBasicCommands.cs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 22 in ClusterSession.NetworkClusterGossip at line 362. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/cluster/Session/RespClusterBasicCommands.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Hotspot: libs/server/Resp/Objects/ListCommands.cs libs/server/Resp/Objects/ListCommands.cs:847— libs/server/Resp/Objects/ListCommands.cs changed 4 times in last 90 days, and the most complex body those changes touched has cyclomatic complexity 21 in RespServerSession.ListBlockingPopMultiple at line 847. Frequent change and high complexity in one file compound: schedule the next change to it to include carving out the part being edited, with the area under test before it moves. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Resp/Objects/ListCommands.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Swallowed exception (empty catch) libs/client/ClientSession/GarnetClientSession.cs:415— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/client/GarnetClient.cs:508— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/client/GarnetClient.cs:522— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/client/NetworkWriter.cs:372— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/cluster/Server/Gossip/GarnetServerNode.cs:230— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else).
Swallowed exception (empty catch) libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncDriverStore.cs:307— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else).
Swallowed exception (empty catch) libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncDriverStore.cs:568— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncDriverStore.cs:644— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncTask.cs:159— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncTask.cs:169— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else).
Swallowed exception (empty catch) libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncTask.cs:178— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else).
Swallowed exception (empty catch) libs/cluster/Server/Replication/PrimaryOps/DiskbasedReplication/FileDataSource.cs:166— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/cluster/Server/Replication/ReplicaOps/DiskbasedReplication/FileDataSink.cs:126— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/common/Networking/GarnetTcpNetworkSender.cs:397— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/common/Networking/TcpNetworkHandlerBase.cs:111— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/host/GarnetServer.cs:628— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/server/Databases/MultiDatabaseManager.cs:1068— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/server/Module/ModuleUtils.cs:147— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/server/Objects/ItemBroker/CollectionItemBroker.cs:762— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else).
Swallowed exception (empty catch) libs/server/Resp/PubSubCommands.cs:56— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/server/Resp/PubSubCommands.cs:100— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/server/Resp/RespServerSession.cs:418— An empty catch block silently discards the error — failures vanish with no log and no rethrow. On a teardown path letting it propagate is not an option (throwing out of `Dispose()` masks the failure already in flight and abandons the rest of the cleanup), so make the swallow deliberate instead: record it through whatever this codebase already uses to report problems — or, if one specific failure truly cannot matter, catch exactly that exception type and say why in a comment on the catch (a comment on a catch-all still swallows everything else).
Swallowed exception (empty catch) libs/server/Resp/Vector/VectorManager.Replication.cs:66— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/server/Servers/GarnetServerTcp.cs:464— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Swallowed exception (empty catch) libs/server/Transaction/TransactionManager.cs:399— An empty catch block silently discards the error — failures vanish with no log and no rethrow. Log it, handle it, or don't catch it.
Unfinished stub — throws NotImplementedException benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:22— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:23— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:35— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/common/Networking/GarnetTcpNetworkSender.cs:270— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/common/Networking/GarnetTcpNetworkSender.cs:276— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/host/Configuration/ConfigProviders.cs:252— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/host/Configuration/ConfigProviders.cs:257— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/host/Configuration/ConfigProviders.cs:259— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/host/Configuration/ConfigProviders.cs:261— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/host/Configuration/GarnetCustomTransformers.cs:63— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/host/Configuration/GarnetCustomTransformers.cs:103— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/server/Custom/CustomObjectFunctions.cs:43— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/server/Custom/CustomObjectFunctions.cs:65— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/server/Custom/CustomObjectFunctions.cs:76— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/server/InputHeader.cs:626— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/server/InputHeader.cs:645— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/server/InputHeader.cs:646— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:550— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:552— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:554— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:556— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException metrics/HdrHistogram/LongConcurrentHistogram.cs:129— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException modules/GarnetJSON/GarnetJsonObject.cs:133— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException modules/NoOpModule/NoOpCommandRead.cs:16— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException modules/NoOpModule/NoOpCommandRead.cs:19— A shipped member still throws NotImplementedException — generated scaffolding that was never completed. Implement it or remove the dead surface.
FileTooLong: Lua/LuaRunner.Functions.cs libs/server/Lua/LuaRunner.Functions.cs— FileTooLong — 1772 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1272 over it, 3.54× 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: TsavoriteLog/TsavoriteLog.cs libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs— FileTooLong — 1630 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 1130 over it, 3.26× 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: Allocator/AllocatorBase.cs libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorBase.cs— FileTooLong — 1208 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 708 over it, 2.42× 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: Lua/LuaRunner.cs libs/server/Lua/LuaRunner.cs— FileTooLong — 1200 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 700 over it, 2.40× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Vector/RespServerSessionVectors.cs libs/server/Resp/Vector/RespServerSessionVectors.cs— FileTooLong — 1145 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 645 over it, 2.29× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Resp/BasicCommands.cs libs/server/Resp/BasicCommands.cs— FileTooLong — 988 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 488 over it, 1.98× 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: Resp/RespServerSession.cs libs/server/Resp/RespServerSession.cs— FileTooLong — 982 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 482 over it, 1.96× 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: Objects/SortedSetCommands.cs libs/server/Resp/Objects/SortedSetCommands.cs— FileTooLong — 970 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 470 over it, 1.94× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: MainStore/RMWMethods.cs libs/server/Storage/Functions/MainStore/RMWMethods.cs— FileTooLong — 929 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 429 over it, 1.86× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Vector/VectorManager.cs libs/server/Resp/Vector/VectorManager.cs— FileTooLong — 878 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 378 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: Device/NativeStorageDevice.cs libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs— FileTooLong — 859 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 359 over it, 1.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Configuration/Options.cs libs/host/Configuration/Options.cs— FileTooLong — 858 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 358 over it, 1.72× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: Parser/RespCommand.cs libs/server/Resp/Parser/RespCommand.cs— FileTooLong — 857 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 357 over it, 1.71× 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: OnlineBench/RespOnlineBench.cs benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs— FileTooLong — 837 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 337 over it, 1.67× 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: Allocator/ObjectAllocatorImpl.cs libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs— FileTooLong — 778 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 278 over it, 1.56× 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: Allocator/LogRecord.cs libs/storage/Tsavorite/cs/src/core/Allocator/LogRecord.cs— FileTooLong — 772 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 272 over it, 1.54× 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: ObjectStore/SortedSetOps.cs libs/server/Storage/Session/ObjectStore/SortedSetOps.cs— FileTooLong — 762 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 262 over it, 1.52× 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: Server/ClusterConfig.cs libs/cluster/Server/ClusterConfig.cs— FileTooLong — 711 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 211 over it, 1.42× 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: Recovery/Recovery.cs libs/storage/Tsavorite/cs/src/core/Index/Recovery/Recovery.cs— FileTooLong — 683 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 183 over it, 1.37× 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: client/GarnetClient.cs libs/client/GarnetClient.cs— FileTooLong — 680 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 180 over it, 1.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: AOF/GarnetLog.cs libs/server/AOF/GarnetLog.cs— FileTooLong — 630 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 130 over it, 1.26× 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: ClusterBench/ClientRequestProvider.WorkerPool.cs benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs— FileTooLong — 597 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 97 over it, 1.19× 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: Utilities/BufferPool.OriginReturn.cs libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.OriginReturn.cs— FileTooLong — 595 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 95 over it, 1.19× 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: Resp/AdminCommands.cs libs/server/Resp/AdminCommands.cs— FileTooLong — 587 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 87 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
FileTooLong: JSONPath/JsonPath.cs modules/GarnetJSON/JSONPath/JsonPath.cs— FileTooLong — 584 significant lines (blank, comment-only and punctuation-only lines excluded). The bar is 500 significant lines; this is 84 over it, 1.17× the bar. To reduce it, split the file along the responsibilities already in it: move each cohesive group of declarations into its own sibling file in the same module or package, so no one file has to be read whole to change one of them.
+ 8 more in this group — see findings.md.
X2 · Cancellation propagation· Async method without CancellationToken · ×33
Async method without CancellationToken: Send benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:37— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: InlinePing benchmark/BDN.benchmark/Network/BasicOperations.cs:25— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Set benchmark/BDN.benchmark/Network/RawStringOperations.cs:69— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: SetEx benchmark/BDN.benchmark/Network/RawStringOperations.cs:73— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: SetNx benchmark/BDN.benchmark/Network/RawStringOperations.cs:77— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: SetXx benchmark/BDN.benchmark/Network/RawStringOperations.cs:81— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: GetFound benchmark/BDN.benchmark/Network/RawStringOperations.cs:85— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: GetNotFound benchmark/BDN.benchmark/Network/RawStringOperations.cs:89— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Increment benchmark/BDN.benchmark/Network/RawStringOperations.cs:93— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: Decrement benchmark/BDN.benchmark/Network/RawStringOperations.cs:97— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: IncrementBy benchmark/BDN.benchmark/Network/RawStringOperations.cs:101— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: DecrementBy benchmark/BDN.benchmark/Network/RawStringOperations.cs:105— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: OpRunnerGarnetClientSession benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:557— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: OpRunnerGarnetClientSessionParallel benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:660— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: OpRunnerGarnetClient benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:858— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: OpRunnerGarnetClientParallel benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:937— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: OpRunnerSERedis benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:1013— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: OpRunnerSERedisParallel benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:1099— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: StringSetAsync libs/client/GarnetClientAPI/GarnetClientBasicRespCommands.cs:191— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: StringSetAsync libs/client/GarnetClientAPI/GarnetClientBasicRespCommands.cs:210— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: KeyDeleteAsync libs/client/GarnetClientAPI/GarnetClientBasicRespCommands.cs:252— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: KeyDeleteAsync libs/client/GarnetClientAPI/GarnetClientBasicRespCommands.cs:269— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: KeyDeleteAsync libs/client/GarnetClientAPI/GarnetClientBasicRespCommands.cs:308— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: KeyDeleteAsync libs/client/GarnetClientAPI/GarnetClientBasicRespCommands.cs:337— No CancellationToken parameter — this work can't be stopped early once started.
Async method without CancellationToken: StringIncrement libs/client/GarnetClientAPI/GarnetClientBasicRespCommands.cs:370— No CancellationToken parameter — this work can't be stopped early once started.
+ 8 more in this group — see findings.md.
D10 · Test Quality· Fixed-sleep synchronisation · ×29
Fixed-sleep synchronisation: ClusterMigrateRangeIndexWhileReadingAsync test/cluster/Garnet.test.cluster.migrate.rangeindex/ClusterRangeIndexMigrateTests.cs:1098— This test starts a background task and then orders itself against it with `Task.Delay(1_000)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: ClusterAllowWritesDuringMigrateTestAsync test/cluster/Garnet.test.cluster.migrate/ClusterMigrateTests.cs:1570— This test starts a background task and then orders itself against it with `Thread.Sleep(TimeSpan.FromSeconds(2))` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: ReplicaSyncTaskFaultsRecoverAsync test/cluster/Garnet.test.cluster.replication/ReplicationTests/ClusterReplicationBaseTests.cs:1517— This test starts a background task and then orders itself against it with `Task.Delay(100)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: MigrateVectorSetWhileModifyingAsync test/cluster/Garnet.test.cluster.vectorsets/VectorSets/ClusterVectorSetTests.cs:1451— This test starts a background task and then orders itself against it with `Task.Delay(1_000)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: MigrateVectorStressAsync test/cluster/Garnet.test.cluster.vectorsets/VectorSets/ClusterVectorSetTests.cs:1760— This test starts a background task and then orders itself against it with `Task.Delay(1_000)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: ConcurrentVSETATTRUpdatesAsync test/cluster/Garnet.test.cluster.vectorsets/VectorSets/ClusterVectorSetTests.cs:2529— This test starts a background task and then orders itself against it with `Task.Delay(1_000)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: PrimaryUnavailableRecoveryAsync test/cluster/Garnet.test.cluster/ClusterManagementTests.cs:1212— This test starts a background task and then orders itself against it with `Task.Delay(10_000)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: DisposeDuringProcessRecord_DefersCleanupToWorker test/cluster/Garnet.test.cluster/RangeIndexMigrationReceiveStateTests.cs:91— This test starts a thread it started and then orders itself against it with `Thread.Sleep(100)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: BlockingListMoveWakesDestinationObserver test/standalone/Garnet.test.collections/RespBlockingCollectionTests.cs:1150— This test starts a background task and then orders itself against it with `Thread.Sleep(1000)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: BlockingListMovePreservesKeyExpiration test/standalone/Garnet.test.collections/RespBlockingCollectionTests.cs:1214— This test starts a background task and then orders itself against it with `Thread.Sleep(500)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: BlockingPopServesAllWaitersFromSingleMultiItemPush test/standalone/Garnet.test.collections/RespBlockingCollectionTests.cs:1255— This test starts a background task and then orders itself against it with `Thread.Sleep(1000)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: BlockingListMoveSameKeyServesAllWaiters test/standalone/Garnet.test.collections/RespBlockingCollectionTests.cs:1305— This test starts a background task and then orders itself against it with `Thread.Sleep(1000)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: ExclusiveLockStarvation test/standalone/Garnet.test.extensions/ReadOptimizedLockTests.cs:280— This test starts a thread it started and then orders itself against it with `Thread.Sleep(250)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: FastParticipantBlocksUntilCohortArrives test/standalone/Garnet.test/DoubleTurnstileBarrierTests.cs:85— This test starts a background task and then orders itself against it with `Thread.Sleep(200)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: SignalWorkReadyWaitThrowsOnCancellation test/standalone/Garnet.test/DoubleTurnstileBarrierTests.cs:129— This test starts a background task and then orders itself against it with `Thread.Sleep(100)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: ClientsThatStopReadingDoNotDelayOtherConnections test/standalone/Garnet.test/NetworkSendStallTests.cs:218— This test starts a thread it started and then orders itself against it with `Thread.Sleep(1000)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: ASendCompletionHeldPastTheSendTimeoutDoesNotOutliveItsConnection test/standalone/Garnet.test/NetworkSendStallTests.cs:314— This test starts a background task and then orders itself against it with `Thread.Sleep(200)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: MultipleClientsUnblockAndAddTest test/standalone/Garnet.test/RespTests.cs:5749— This test starts a background task and then orders itself against it with `Task.Delay(1000)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: Dispose_ReleasesParkedWaitersAndNeverThrows libs/storage/Tsavorite/cs/test/CompletionEventTests.cs:117— This test starts a thread it started and then orders itself against it with `Thread.Sleep(50)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: Dispose_ReleasesEveryWaiter libs/storage/Tsavorite/cs/test/CompletionEventTests.cs:155— This test starts a thread it started and then orders itself against it with `Thread.Sleep(50)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: Set_WakesWaitersWhereInitializeWouldStrandThem libs/storage/Tsavorite/cs/test/CompletionEventTests.cs:201— This test starts a thread it started and then orders itself against it with `Thread.Sleep(50)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: CoalescedSignal_CaptureBeforeClear_NeverParksWithWorkOutstanding libs/storage/Tsavorite/cs/test/CompletionEventTests.cs:238— This test starts a thread it started and then orders itself against it with `Thread.Sleep(4000)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: EnqueueWaitCommitBasicTest libs/storage/Tsavorite/cs/test/EnqueueAndWaitForCommit.cs:64— This test starts a background task and then orders itself against it with `Task.Delay(100)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: OnTruncateFiresWithNewBeginAddress libs/storage/Tsavorite/cs/test/RecordTriggersExtTests.cs:177— This test starts a background task and then orders itself against it with `Thread.Sleep(50)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Fixed-sleep synchronisation: HeavySoakWithChurn libs/storage/Tsavorite/cs/test/SectorAlignedBufferPoolStressTests.cs:310— This test starts a thread it started and then orders itself against it with `Thread.Sleep(50)` — a fixed wait, not a signal that the work is done. Whether it passes depends on how loaded the machine is, which is why a test written this way is green on a developer's box and random in CI. Wait for the event itself instead: the process's own exit or output, a completion handle, or a condition polled to a timeout.
Duplicated block (13 lines × 2) libs/server/Storage/Functions/VectorStore/VectorSessionFunctions.cs:323— libs/server/Storage/Functions/VectorStore/VectorSessionFunctions.cs:323-335 | libs/server/Storage/Functions/VectorStore/VectorSessionFunctions.cs:390-402 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/server/Resp/Bitmap/BitmapManagerBitfield.cs:360— libs/server/Resp/Bitmap/BitmapManagerBitfield.cs:360-372 | libs/server/Resp/Bitmap/BitmapManagerBitfield.cs:410-422 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) libs/server/Lua/LuaRunner.cs:758— libs/server/Lua/LuaRunner.cs:758-770 | libs/server/Lua/LuaRunner.cs:842-854 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) libs/server/Resp/BasicCommands.cs:1361— libs/server/Resp/BasicCommands.cs:1361-1373 | libs/server/Resp/BasicCommands.cs:1397-1409 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/server/Resp/Objects/ListCommands.cs:455— libs/server/Resp/Objects/ListCommands.cs:455-467 | libs/server/Resp/Objects/ListCommands.cs:503-515 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/cluster/Session/RespClusterSlotManagementCommands.cs:488— libs/cluster/Session/RespClusterSlotManagementCommands.cs:488-500 | libs/cluster/Session/RespClusterSlotManagementCommands.cs:588-600 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (13 lines × 2) libs/server/Lua/LuaRunner.Functions.cs:96— libs/server/Lua/LuaRunner.Functions.cs:96-108 | libs/server/Lua/LuaRunner.Functions.cs:129-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.cs:96` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/server/Storage/Session/ObjectStore/SetOps.cs:33— libs/server/Storage/Session/ObjectStore/SetOps.cs:33-45 | libs/server/Storage/Session/ObjectStore/SetOps.cs:96-108 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SetOps.cs:33` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13 lines × 2) libs/cluster/Session/RespClusterReplicationCommands.cs:459— libs/cluster/Session/RespClusterReplicationCommands.cs:459-471 | libs/cluster/Session/RespClusterReplicationCommands.cs:506-518 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Session/RespClusterReplicationCommands.cs:459` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (13 lines × 2) libs/common/AsciiUtils.cs:97— libs/common/AsciiUtils.cs:97-109 | libs/common/AsciiUtils.cs:129-141 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/common/AsciiUtils.cs:97` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/server/Resp/Objects/SortedSetCommands.cs:556— libs/server/Resp/Objects/SortedSetCommands.cs:556-568 | libs/server/Resp/Objects/SortedSetCommands.cs:789-801 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/SortedSetCommands.cs:556` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:146— libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:146-158 | libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:172-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:146` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:197— libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:197-209 | libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:223-235 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:197` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:374— libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:374-386 | libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:400-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:374` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:425— libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:425-437 | libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:449-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:425` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:598— libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:598-610 | libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:625-637 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:598` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:651— libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:651-663 | libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:676-688 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:651` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:1031— libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:1031-1043 | libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:1056-1068 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:1031` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/client/LightEpoch.cs:533— libs/client/LightEpoch.cs:533-545 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:557-569 — before extracting anything, compare `libs/client/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 326 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) libs/client/RespReadResponseUtils.cs:79— libs/client/RespReadResponseUtils.cs:79-91 | libs/common/RespReadUtils.cs:926-938 — before extracting anything, compare `libs/client/RespReadResponseUtils.cs` and `libs/common/RespReadUtils.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (13 lines × 2) libs/cluster/Server/Replication/ReplicationManager.cs:428— libs/cluster/Server/Replication/ReplicationManager.cs:428-440 | libs/cluster/Server/Replication/ReplicationManager.cs:444-456 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Server/Replication/ReplicationManager.cs:428` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13 lines × 2) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1268— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1268-1280 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1504-1516 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1283` calls `CopyDiff` and `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1517` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13 lines × 2) libs/common/RespWriteUtils.cs:368— libs/common/RespWriteUtils.cs:368-380 | libs/common/RespWriteUtils.cs:391-403 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `items` to `IEnumerable<byte[]>` in one and `ReadOnlySpan<byte[]>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (13 lines × 2) libs/server/Lua/LuaRunner.Functions.cs:2646— libs/server/Lua/LuaRunner.Functions.cs:2646-2658 | libs/server/Lua/LuaRunner.Functions.cs:2694-2706 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.cs:2646` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 2) libs/server/Resp/Objects/HashCommands.cs:86— libs/server/Resp/Objects/HashCommands.cs:86-98 | libs/server/Resp/Objects/HashCommands.cs:170-183 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Unfinished stub — throws NotImplementedException benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:22— `RemoteEndpointName` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:23— `LocalEndpointName` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:35— `TryClose` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/common/Networking/GarnetTcpNetworkSender.cs:270— `SendResponse` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/common/Networking/GarnetTcpNetworkSender.cs:276— `SendCallback` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/host/Configuration/ConfigProviders.cs:252— `TryExportOptions` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/host/Configuration/ConfigProviders.cs:257— `TrySerializeOptions` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/host/Configuration/ConfigProviders.cs:259— `TryDeserializeOptions` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/host/Configuration/ConfigProviders.cs:261— `TryDeserializeOptions` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/host/Configuration/GarnetCustomTransformers.cs:63— `TransformBack` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/host/Configuration/GarnetCustomTransformers.cs:103— `TransformBack` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/server/InputHeader.cs:626— `SerializedLength` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/server/InputHeader.cs:645— `CopyTo` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/server/InputHeader.cs:646— `DeserializeFrom` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:550— `AsyncState` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:552— `AsyncWaitHandle` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:554— `CompletedSynchronously` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:556— `IsCompleted` is a shipped property whose accessors only throw NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException metrics/HdrHistogram/LongConcurrentHistogram.cs:129— `SetCountAtIndex` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException modules/GarnetJSON/GarnetJsonObject.cs:133— `Scan` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException modules/NoOpModule/NoOpCommandRead.cs:16— `GetInitialLength` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException modules/NoOpModule/NoOpCommandRead.cs:19— `GetLength` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException modules/NoOpModule/NoOpCommandRead.cs:23— `InitialUpdater` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException modules/NoOpModule/NoOpCommandRead.cs:28— `InPlaceUpdater` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Unfinished stub — throws NotImplementedException modules/NoOpModule/NoOpCommandRead.cs:33— `CopyUpdater` is a shipped member whose whole body throws NotImplementedException — scaffolding that was never completed. Implement it or remove the dead surface.
Duplicated block (11 lines × 2) libs/common/Synchronization/ReadOptimizedLock.cs:423— libs/common/Synchronization/ReadOptimizedLock.cs:423-433 | libs/common/Synchronization/ReadOptimizedLock.cs:606-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/common/Synchronization/ReadOptimizedLock.cs:435` calls `SkipInit` and `libs/common/Synchronization/ReadOptimizedLock.cs:619` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1551— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1551-1561 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1603-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1551` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (11 lines × 2) libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs:560— libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs:560-570 | libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs:616-626 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs:560` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/TsavoriteIterator.cs:130— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/TsavoriteIterator.cs:130-140 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/TsavoriteIterator.cs:189-199 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/TsavoriteIterator.cs:130` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) libs/server/Objects/Hash/HashObject.cs:299— libs/server/Objects/Hash/HashObject.cs:299-309 | main/GarnetServer/Extensions/MyDictObject.cs:138-148 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `key` to `ReadOnlySpan<byte>` in one and `byte[]` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) libs/client/LightEpoch.cs:289— libs/client/LightEpoch.cs:289-299 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:312-322 — before extracting anything, compare `libs/client/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 326 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (11 lines × 2) libs/cluster/Server/Replication/PrimaryOps/DiskbasedReplication/TsavoriteCheckpointReader.cs:169— libs/cluster/Server/Replication/PrimaryOps/DiskbasedReplication/TsavoriteCheckpointReader.cs:169-179 | libs/cluster/Server/Replication/ReplicaOps/ReplicaDiskbasedSync.cs:257-267 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) libs/server/Objects/SortedSetGeo/SortedSetGeoObjectImpl.cs:86— libs/server/Objects/SortedSetGeo/SortedSetGeoObjectImpl.cs:86-96 | libs/server/Objects/SortedSetGeo/SortedSetGeoObjectImpl.cs:145-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Objects/SortedSetGeo/SortedSetGeoObjectImpl.cs:86` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) libs/server/Resp/Vector/VectorManager.cs:962— libs/server/Resp/Vector/VectorManager.cs:962-972 | libs/server/Resp/Vector/VectorManager.cs:1178-1188 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/server/Resp/Vector/VectorManager.cs:973` calls `PrepareVectorData` and `libs/server/Resp/Vector/VectorManager.cs:1190` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) libs/server/Storage/Session/MainStore/VectorStoreOps.cs:254— libs/server/Storage/Session/MainStore/VectorStoreOps.cs:254-264 | libs/server/Storage/Session/MainStore/VectorStoreOps.cs:293-303 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/VectorStoreOps.cs:254` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:16— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:16-26 | libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs:16-26 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 236 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:544— libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:544-554 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:605-615 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `desiredValue` to `ReadOnlySpan<byte>` in one and `IHeapObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (11 lines × 2) libs/cluster/Server/Replication/GarnetClusterCheckpointManager.cs:148— libs/cluster/Server/Replication/GarnetClusterCheckpointManager.cs:148-158 | libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/DeviceLogCommitCheckpointManager.cs:309-319 — 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/server/Resp/Bitmap/BitmapManagerBitCount.cs:239— libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:239-249 | playground/Bitmap/BitCount.cs:157-167 — before extracting anything, compare `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs` and `playground/Bitmap/BitCount.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:239` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) libs/server/Resp/PubSubCommands.cs:305— libs/server/Resp/PubSubCommands.cs:305-315 | libs/server/Resp/PubSubCommands.cs:383-395 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/PubSubCommands.cs:305` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 2) libs/server/Resp/Vector/VectorManager.Migration.cs:116— libs/server/Resp/Vector/VectorManager.Migration.cs:116-126 | libs/server/Resp/Vector/VectorManager.Migration.cs: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) libs/server/Storage/Functions/MainStore/RMWMethods.cs:1355— libs/server/Storage/Functions/MainStore/RMWMethods.cs:1355-1365 | libs/server/Storage/Functions/MainStore/RMWMethods.cs:1370-1380 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Functions/MainStore/RMWMethods.cs:1355` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) libs/server/Storage/Functions/ObjectStore/RMWMethods.cs:224— libs/server/Storage/Functions/ObjectStore/RMWMethods.cs:224-234 | libs/server/Storage/Functions/ObjectStore/ReadMethods.cs:50-60 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Functions/ObjectStore/RMWMethods.cs:224` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:217— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:217-230 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:305-315 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 42 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:233` calls `SetTombstone` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:318` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 2) libs/client/ClientSession/AsyncPool.cs:46— libs/client/ClientSession/AsyncPool.cs:46-56 | libs/storage/Tsavorite/cs/src/core/Device/AsyncPool.cs:46-56 — before extracting anything, compare `libs/client/ClientSession/AsyncPool.cs` and `libs/storage/Tsavorite/cs/src/core/Device/AsyncPool.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) libs/client/ClientSession/AsyncPool.cs:65— libs/client/ClientSession/AsyncPool.cs:65-75 | libs/storage/Tsavorite/cs/src/core/Device/AsyncPool.cs:65-75 — before extracting anything, compare `libs/client/ClientSession/AsyncPool.cs` and `libs/storage/Tsavorite/cs/src/core/Device/AsyncPool.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 35 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) libs/client/Utility.cs:178— libs/client/Utility.cs:178-188 | libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs:467-477 — before extracting anything, compare `libs/client/Utility.cs` and `libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (11 lines × 2) samples/GarnetClientSample/GarnetClientSamples.cs:109— samples/GarnetClientSample/GarnetClientSamples.cs:109-119 | samples/GarnetClientSample/GarnetClientSamples.cs:134-144 — both copies are in the same file, so extract the block into 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) samples/ETag/OccSimulation.cs:155— samples/ETag/OccSimulation.cs:155-165 | samples/ETag/OccSimulation.cs:174-184 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `samples/ETag/OccSimulation.cs:155` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Sync-over-async (deadlock risk) benchmark/BDN.benchmark/Cluster/EpochBumpContention.cs:156— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/BDN.benchmark/Cluster/EpochBumpContention.cs:158— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:623— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:635— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:636— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:688— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:698— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:320— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:334— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:360— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:391— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:404— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:122— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:132— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:133— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:264— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:266— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:268— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:448— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:458— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:847— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:864— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:173— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Sync-over-async (deadlock risk) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:184— Blocking on a Task with `.Wait()`/`.GetAwaiter().GetResult()` can deadlock (and wastes a thread). Prefer awaiting it: make the caller `async` and `await` instead. Where a synchronous entry point must stay — a public sync API you cannot break, or a process entry point that must not return until the work finishes — the block belongs in ONE documented bridge and never inside code that is already async; and where it already is that bridge, give the wait a TIMEOUT so a hung task fails the call instead of hanging the process.
Duplicated block (7 lines × 2) libs/server/Metrics/Latency/RespLatencyCommands.cs:61— libs/server/Metrics/Latency/RespLatencyCommands.cs:61-67 | libs/server/Metrics/Latency/RespLatencyCommands.cs:107-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Metrics/Latency/RespLatencyCommands.cs:61` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) libs/server/Resp/Vector/RespServerSessionVectors.cs:776— libs/server/Resp/Vector/RespServerSessionVectors.cs:776-782 | libs/server/Resp/Vector/RespServerSessionVectors.cs:1226-1232 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (7 lines × 2) libs/server/Lua/LuaRunner.cs:793— libs/server/Lua/LuaRunner.cs:793-799 | libs/server/Lua/LuaRunner.cs:877-883 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.cs:793` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) libs/server/Lua/LuaRunner.Functions.Struct.cs:534— libs/server/Lua/LuaRunner.Functions.Struct.cs:534-540 | libs/server/Lua/LuaRunner.Functions.Struct.cs:570-576 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) libs/server/Objects/Hash/HashObject.cs:184— libs/server/Objects/Hash/HashObject.cs:184-190 | libs/server/Objects/SortedSet/SortedSetObject.cs:289-295 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Objects/Hash/HashObject.cs:184` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/server/Objects/Hash/HashObject.cs:191` calls `Write` and `libs/server/Objects/SortedSet/SortedSetObject.cs:296` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) libs/server/Storage/Session/MainStore/VectorStoreOps.cs:681— libs/server/Storage/Session/MainStore/VectorStoreOps.cs:681-687 | libs/server/Storage/Session/MainStore/VectorStoreOps.cs:732-738 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/VectorStoreOps.cs:681` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) libs/cluster/Server/Replication/ReplicaOps/ReplicaDiskbasedSync.cs:35— libs/cluster/Server/Replication/ReplicaOps/ReplicaDiskbasedSync.cs:35-41 | libs/cluster/Server/Replication/ReplicaOps/ReplicaDisklessSync.cs:29-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Server/Replication/ReplicaOps/ReplicaDiskbasedSync.cs:35` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) libs/common/Synchronization/ReadOptimizedLock.cs:412— libs/common/Synchronization/ReadOptimizedLock.cs:412-418 | libs/common/Synchronization/ReadOptimizedLock.cs:592-598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/common/Synchronization/ReadOptimizedLock.cs:412` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) libs/server/Storage/Functions/MainStore/PrivateMethods.cs:59— libs/server/Storage/Functions/MainStore/PrivateMethods.cs:59-65 | libs/server/Storage/Functions/MainStore/PrivateMethods.cs:77-83 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (7 lines × 2) REDACTED:201— REDACTED:201-207 | REDACTED:239-245 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `REDACTED:201` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `REDACTED:208` calls `ValidateCertificateName` and `REDACTED:246` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:464— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:464-470 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:312-318 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 2) libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:730— libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:730-736 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:688-694 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 364 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 2) libs/cluster/Session/RespClusterReplicationCommands.cs:270— libs/cluster/Session/RespClusterReplicationCommands.cs:270-276 | libs/cluster/Session/RespClusterReplicationCommands.cs:443-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/cluster/Session/RespClusterReplicationCommands.cs:269` calls `GetString` and `libs/cluster/Session/RespClusterReplicationCommands.cs:441` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 2) libs/common/HashUtils.cs:240— libs/common/HashUtils.cs:240-247 | libs/common/HashUtils.cs:249-255 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) libs/server/Resp/Parser/RespCommandHashLookup.cs:316— libs/server/Resp/Parser/RespCommandHashLookup.cs:316-322 | libs/server/Resp/Parser/RespCommandHashLookup.cs:339-345 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Parser/RespCommandHashLookup.cs:316` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) libs/server/Resp/Vector/VectorManager.Callbacks.cs:362— libs/server/Resp/Vector/VectorManager.Callbacks.cs:362-368 | libs/server/Resp/Vector/VectorManager.Callbacks.cs:416-423 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/VectorManager.Callbacks.cs:362` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) libs/server/Resp/Vector/VectorManager.Import.cs:49— libs/server/Resp/Vector/VectorManager.Import.cs:49-55 | libs/server/Resp/Vector/VectorManager.Replication.cs:661-667 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:16— libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:16-22 | libs/storage/Tsavorite/cs/src/core/ClientSession/UnsafeContext.cs:17-23 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:16— libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:16-22 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs:17-23 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs` and `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:16` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) playground/CommandInfoUpdater/CommandDocsUpdater.cs:73— playground/CommandInfoUpdater/CommandDocsUpdater.cs:73-79 | playground/CommandInfoUpdater/CommandInfoUpdater.cs:65-72 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `playground/CommandInfoUpdater/CommandDocsUpdater.cs:73` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 2) playground/CommandInfoUpdater/RespCommandInfoParser.cs:429— playground/CommandInfoUpdater/RespCommandInfoParser.cs:429-435 | playground/CommandInfoUpdater/RespCommandInfoParser.cs:480-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. Read the line range as the matched WINDOW rather than a finished unit: at `playground/CommandInfoUpdater/RespCommandInfoParser.cs:480` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:190— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:190-196 | libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs:189-195 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 236 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) libs/server/Resp/ACLCommands.cs:62— libs/server/Resp/ACLCommands.cs:62-71 | libs/server/Resp/ACLCommands.cs:90-99 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/ACLCommands.cs:62` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) libs/host/Configuration/OptionsValidators.cs:154— libs/host/Configuration/OptionsValidators.cs:154-163 | libs/host/Configuration/OptionsValidators.cs:273-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/host/Configuration/OptionsValidators.cs:154` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) libs/server/Resp/AdminCommands.cs:666— libs/server/Resp/AdminCommands.cs:666-675 | libs/server/Resp/AdminCommands.cs:699-708 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/AdminCommands.cs:666` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) libs/server/Storage/Session/ObjectStore/HashOps.cs:157— libs/server/Storage/Session/ObjectStore/HashOps.cs:157-166 | libs/server/Storage/Session/ObjectStore/HashOps.cs:192-201 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) playground/Bitmap/BitOp.cs:1414— playground/Bitmap/BitOp.cs:1414-1423 | playground/Bitmap/BitOp.cs:1448-1457 — both copies are in the same file, so extract the block into 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) libs/cluster/Server/ClusterManagerSlotState.cs:343— libs/cluster/Server/ClusterManagerSlotState.cs:343-352 | libs/cluster/Server/ClusterManagerSlotState.cs:378-387 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (10 lines × 2) libs/cluster/Server/Replication/ReplicaOps/AOFReplay/ReplicaReplayDriver.cs:187— libs/cluster/Server/Replication/ReplicaOps/AOFReplay/ReplicaReplayDriver.cs:187-196 | libs/server/AOF/Recover/RecoverLogDriver.cs:119-128 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Server/Replication/ReplicaOps/AOFReplay/ReplicaReplayDriver.cs:187` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) libs/server/Custom/CustomProcedureBase.cs:76— libs/server/Custom/CustomProcedureBase.cs:76-85 | libs/server/Custom/CustomProcedureBase.cs:104-113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Custom/CustomProcedureBase.cs:76` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `values` to `params PinnedSpanByte[]` in one and `List<PinnedSpanByte>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (10 lines × 2) libs/server/Resp/RangeIndex/RangeIndexManager.Replication.cs:191— libs/server/Resp/RangeIndex/RangeIndexManager.Replication.cs:191-200 | libs/server/Resp/RangeIndex/RangeIndexManager.Replication.cs:222-231 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/RangeIndex/RangeIndexManager.Replication.cs:191` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) libs/server/Storage/Functions/VectorStore/VectorSessionFunctions.cs:275— libs/server/Storage/Functions/VectorStore/VectorSessionFunctions.cs:275-284 | libs/server/Storage/Functions/VectorStore/VectorSessionFunctions.cs:411-420 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Functions/VectorStore/VectorSessionFunctions.cs:275` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Storage/Functions/VectorStore/VectorSessionFunctions.cs:273` calls `Clear` and `libs/server/Storage/Functions/VectorStore/VectorSessionFunctions.cs:409` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) libs/server/Storage/Session/MainStore/VectorStoreOps.cs:553— libs/server/Storage/Session/MainStore/VectorStoreOps.cs:553-562 | libs/server/Storage/Session/MainStore/VectorStoreOps.cs:627-636 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/VectorStoreOps.cs:553` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) libs/server/Storage/Session/ObjectStore/SetOps.cs:483— libs/server/Storage/Session/ObjectStore/SetOps.cs:483-492 | libs/server/Storage/Session/ObjectStore/SetOps.cs:913-922 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SetOps.cs:483` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 2) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:118— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:118-127 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:149-158 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:118` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (10 lines × 2) libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:230— libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:230-239 | libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:299-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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:297` calls `HandleCapacity` and `libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:229` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) libs/common/Networking/NetworkHandler.cs:275— libs/common/Networking/NetworkHandler.cs:275-284 | libs/common/Networking/NetworkHandler.cs:345-354 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/common/Networking/NetworkHandler.cs:275` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 2) libs/server/Storage/Session/ObjectStore/SetOps.cs:387— libs/server/Storage/Session/ObjectStore/SetOps.cs:387-396 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:724-733 — before extracting anything, compare `libs/server/Storage/Session/ObjectStore/SetOps.cs` and `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SetOps.cs:387` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/server/Storage/Session/ObjectStore/SetOps.cs:398` calls `foreach` and `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:735` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10 lines × 2) libs/server/Resp/Vector/VectorManager.Locking.cs:577— libs/server/Resp/Vector/VectorManager.Locking.cs:577-586 | libs/server/Storage/Functions/MainStore/RMWMethods.cs:311-320 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (10 lines × 2) libs/storage/Tsavorite/cs/src/core/Utilities/MultiLevelPageArray.cs:308— libs/storage/Tsavorite/cs/src/core/Utilities/MultiLevelPageArray.cs:308-321 | libs/storage/Tsavorite/cs/src/core/Utilities/MultiLevelPageArray.cs:356-365 — both copies are in the same file, so extract the block into 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) libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:388— libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:388-397 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:379-388 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 364 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (10 lines × 2) libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:834— libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:834-843 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:787-796 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 364 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) libs/server/Storage/Functions/MainStore/PrivateMethods.cs:355— libs/server/Storage/Functions/MainStore/PrivateMethods.cs:355-360 | libs/server/Storage/Functions/UnifiedStore/PrivateMethods.cs:121-126 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:65— libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:65-70 | libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:77-82 — both copies are in the same file, so extract the block into 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/server/Storage/Session/MainStore/VectorStoreOps.cs:527— libs/server/Storage/Session/MainStore/VectorStoreOps.cs:527-532 | libs/server/Storage/Session/MainStore/VectorStoreOps.cs:588-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/VectorStoreOps.cs:527` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) libs/server/AOF/AofProcessor.ChunkReplay.cs:164— libs/server/AOF/AofProcessor.ChunkReplay.cs:164-169 | libs/server/AOF/AofProcessor.ChunkReplay.cs:270-275 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/AOF/AofProcessor.ChunkReplay.cs:164` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) libs/server/Resp/Vector/ExprCompiler.cs:203— libs/server/Resp/Vector/ExprCompiler.cs:203-208 | libs/server/Resp/Vector/ExprCompiler.cs:221-226 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/ExprCompiler.cs:203` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:15— libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:15-20 | libs/storage/Tsavorite/cs/src/core/ClientSession/ConsistentReadContext.cs:15-20 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:15` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/ContinuePending.cs:165— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/ContinuePending.cs:165-170 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRead.cs:187-192 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 2) main/GarnetServer/Extensions/SampleDeleteTxn.cs:35— main/GarnetServer/Extensions/SampleDeleteTxn.cs:35-40 | main/GarnetServer/Extensions/SampleUpdateTxn.cs:36-41 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (6 lines × 2) playground/GarnetClientStress/Options.cs:8— playground/GarnetClientStress/Options.cs:8-13 | samples/MetricsMonitor/Options.cs:9-14 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `playground/GarnetClientStress/Options.cs:8` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `playground/GarnetClientStress/Options.cs:16` calls `Option` and `samples/MetricsMonitor/Options.cs:15` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) libs/server/Resp/Vector/VectorManager.cs:1413— libs/server/Resp/Vector/VectorManager.cs:1413-1419 | libs/server/Resp/Vector/VectorManager.cs:1679-1684 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `element` to `PinnedSpanByte` in one and `ReadOnlySpan<byte>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (6 lines × 2) libs/server/Resp/Vector/VectorManager.Locking.cs:323— libs/server/Resp/Vector/VectorManager.Locking.cs:323-329 | libs/server/Resp/Vector/VectorManager.Locking.cs:593-598 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/server/Resp/Vector/VectorManager.Locking.cs:599` calls `SetArgument`, `FromPinnedSpan`, `CreateSpan` and `libs/server/Resp/Vector/VectorManager.Locking.cs:331` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 2) libs/server/Storage/Functions/MainStore/RMWMethods.cs:884— libs/server/Storage/Functions/MainStore/RMWMethods.cs:884-891 | libs/server/Storage/Functions/MainStore/RMWMethods.cs:1464-1469 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Functions/MainStore/RMWMethods.cs:1464` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorScan.cs:298— libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorScan.cs:298-313 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/ConditionalCopyToTail.cs:106-111 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorScan.cs:298` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalConsistentReadContext.cs:14— libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalConsistentReadContext.cs:14-20 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:15-20 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalConsistentReadContext.cs:14` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRead.cs:60— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRead.cs:60-71 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRead.cs:279-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (6 lines × 2) playground/Bitmap/BitOp.cs:225— playground/Bitmap/BitOp.cs:225-230 | playground/Bitmap/BitOp.cs:234-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) playground/Bitmap/BitOp.cs:594— playground/Bitmap/BitOp.cs:594-599 | playground/Bitmap/BitOp.cs:603-608 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (6 lines × 2) playground/CommandInfoUpdater/RespCommandInfoParser.cs:47— playground/CommandInfoUpdater/RespCommandInfoParser.cs:47-52 | playground/CommandInfoUpdater/RespCommandInfoParser.cs:75-80 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/CommandInfoUpdater/RespCommandInfoParser.cs:47` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (6 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:121— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:121-126 | libs/storage/Tsavorite/cs/src/core/Allocator/TsavoriteLogAllocatorImpl.cs:29-34 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (6 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:64— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:64-69 | libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs:63-68 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 236 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
DeadPreprocessorBranch libs/common/Format.cs:13— #if UNIX_SOCKET — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch test/cluster/Garnet.test.cluster/ClientClusterConfig.cs:42— #if UNIX_SOCKET — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/common/Networking/NetworkHandler.cs:949— #if MESSAGETRAGE — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/common/Networking/NetworkHandler.cs:978— #if MESSAGETRAGE — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ConcurrentDictionaryBenchmark.cs:55— #if DASHBOARD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ConcurrentDictionaryBenchmark.cs:98— #if DASHBOARD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ConcurrentDictionaryBenchmark.cs:140— #if DASHBOARD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ConcurrentDictionaryBenchmark.cs:169— #if DASHBOARD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ConcurrentDictionaryBenchmark.cs:240— #if DASHBOARD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ConcurrentDictionaryBenchmark.cs:263— #if DASHBOARD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ConcurrentDictionaryBenchmark.cs:282— #if DASHBOARD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ConcurrentDictionaryBenchmark.cs:299— #if DASHBOARD — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/src/core/Allocator/LogRecord.cs:1712— #if false — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.cs:335— #if CHECK_FOR_LEAKS — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.cs:391— #if CHECK_FOR_LEAKS — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.cs:433— #if CHECK_FOR_LEAKS — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.cs:451— #if CHECK_FOR_LEAKS — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
DeadPreprocessorBranch libs/storage/Tsavorite/cs/test/ExpirationTests.cs:658— #if false // TODO - Add to ExpirationFunctions the knowledge of whether we're calling from here or the main test part — no definition of that symbol was found anywhere this analysis looks: not in a <DefineConstants> in any project file, props or targets under any condition, not on a build script's command line, not in a #define, and not in a project-template manifest; nor is it one the compiler or SDK defines itself. On that evidence the condition is decided the same way in every configuration this repository can build, and the code on the dead side of it never compiles — including the part a reader will assume is what ships. Either define the symbol in the configuration that is supposed to have it, or delete the branch and keep the behaviour you are actually shipping. If some other mechanism binds it, that mechanism is outside the list above and this row is a gap in what we read, not a fact about your code.
Duplicated block (12 lines × 2) libs/server/Resp/Objects/ListCommands.cs:555— libs/server/Resp/Objects/ListCommands.cs:555-566 | libs/server/Resp/Objects/ListCommands.cs:654-665 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) libs/server/Resp/Vector/RespServerSessionVectors.cs:870— libs/server/Resp/Vector/RespServerSessionVectors.cs:870-881 | libs/server/Resp/Vector/RespServerSessionVectors.cs:888-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) libs/server/AOF/ReplayCoordinator/AofReplayCoordinator.cs:426— libs/server/AOF/ReplayCoordinator/AofReplayCoordinator.cs:426-437 | libs/server/AOF/ReplayCoordinator/AofReplayCoordinator.cs:665-676 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/AOF/ReplayCoordinator/AofReplayCoordinator.cs:426` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/server/AOF/ReplayCoordinator/AofReplayCoordinator.cs:440` calls `GetOrAdd`, `CoordinatedTransaction`, `Add` and `libs/server/AOF/ReplayCoordinator/AofReplayCoordinator.cs:679` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 2) libs/server/ArgSlice/ScratchBufferBuilder.cs:258— libs/server/ArgSlice/ScratchBufferBuilder.cs:258-269 | libs/server/ArgSlice/ScratchBufferBuilder.cs:328-339 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note first that the copies are not typed on the same thing: the declarations holding them bind `arg` to `PinnedSpanByte` in one and `ReadOnlySpan<byte>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (12 lines × 2) libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:1739— libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:1739-1750 | libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:1818-1829 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:1739` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) playground/MigrateBench/MigrateRequest.cs:147— playground/MigrateBench/MigrateRequest.cs:147-158 | playground/MigrateBench/MigrateRequest.cs:181-192 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (12 lines × 2) libs/client/Utility.cs:192— libs/client/Utility.cs:192-203 | libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs:481-492 — before extracting anything, compare `libs/client/Utility.cs` and `libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (12 lines × 2) libs/server/Resp/Vector/VectorManager.ElementData.cs:289— libs/server/Resp/Vector/VectorManager.ElementData.cs:289-300 | libs/server/Resp/Vector/VectorManager.ElementData.cs:318-329 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/VectorManager.ElementData.cs:289` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:1387— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:1387-1398 | libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:1478-1489 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:1387` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:280— libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:280-291 | libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:308-319 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:280` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) libs/cluster/Session/RespClusterReplicationCommands.cs:316— libs/cluster/Session/RespClusterReplicationCommands.cs:316-327 | libs/cluster/Session/RespClusterReplicationCommands.cs:400-412 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Session/RespClusterReplicationCommands.cs:400` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) libs/server/Custom/CustomRespCommands.cs:166— libs/server/Custom/CustomRespCommands.cs:166-179 | libs/server/Custom/CustomRespCommands.cs:341-352 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Custom/CustomRespCommands.cs:166` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 2) libs/server/Resp/PubSubCommands.cs:207— libs/server/Resp/PubSubCommands.cs:207-220 | libs/server/Resp/PubSubCommands.cs:251-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/PubSubCommands.cs:207` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) libs/server/Resp/Vector/RespServerSessionVectors.cs:238— libs/server/Resp/Vector/RespServerSessionVectors.cs:238-249 | libs/server/Resp/Vector/RespServerSessionVectors.cs:275-286 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/RespServerSessionVectors.cs:238` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 2) libs/server/Storage/Functions/MainStore/PrivateMethods.cs:483— libs/server/Storage/Functions/MainStore/PrivateMethods.cs:483-494 | libs/server/Storage/Functions/MainStore/PrivateMethods.cs:514-526 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12 lines × 2) libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:560— libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:560-571 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:621-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `desiredValue` to `ReadOnlySpan<byte>` in one and `IHeapObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
X18 · Disposal-pattern correctness· Disposable created and abandoned in the method that made it · ×16
Disposable created and abandoned in the method that made it benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:464— `c` is a `GarnetClientSession`, which implements `IDisposable`, and it is created here (line 464). Every use of it in `GarnetClientSessionOperateThreadRunner` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var c = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:424— `client` is a `LightClient`, which implements `IDisposable`, and it is created here (line 424). Every use of it in `OpRunnerLightClient` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var client = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:757— `waitCallback` is a `ManualResetEventSlim`, which implements `IDisposable`, and it is created here (line 757). Every use of it in `OpRunnerGarnetClientSync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var waitCallback = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it benchmark/Resp.benchmark/TxnPerfBench.cs:326— `client` is a `GarnetClientSession`, which implements `IDisposable`, and it is created here (line 326). Every use of it in `LoadData` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var client = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it libs/host/ServerSettingsManager.cs:48— `parser` is a `Parser`, which implements `IDisposable`, and it is created here (line 48). Every use of it in `TryParseCommandLineArguments` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var parser = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:1226— `logReader` is a `ObjectLogReader`, which implements `IDisposable`, and it is created here (line 1226). Every use of it in `VerifyRecordFromDiskCallback` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var logReader = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:1339— `logReader` is a `ObjectLogReader`, which implements `IDisposable`, and it is created here (line 1339). Every use of it in `DeserializeObjectsOnPage` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var logReader = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it libs/storage/Tsavorite/cs/src/core/Device/StorageDeviceBase.cs:222— `completionEvent` is a `ManualResetEventSlim`, which implements `IDisposable`, and it is created here (line 222). Every use of it in `RemoveSegment` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var completionEvent = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it playground/CommandInfoUpdater/CommandInfoUpdater.cs:188— `lightClient` is a `LightClientRequest`, which implements `IDisposable`, and it is created here (line 188). Every use of it in `TryGetCommandsInfo` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var lightClient = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it playground/CommandInfoUpdater/Program.cs:34— `parser` is a `Parser`, which implements `IDisposable`, and it is created here (line 34). Every use of it in `Main` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var parser = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it playground/GarnetClientStress/SimpleStressTests.cs:16— `progress` is a `ProgressBar`, which implements `IDisposable`, and it is created here (line 16). Every use of it in `RunPingDispose` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var progress = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it playground/GarnetClientStress/TaskScaling.cs:203— `cts` is a `CancellationTokenSource`, which implements `IDisposable`, and it is created here (line 203). Every use of it in `ShortRunningTask` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var cts = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it samples/ETag/Caching.cs:44— `cts` is a `CancellationTokenSource`, which implements `IDisposable`, and it is created here (line 44). Every use of it in `RunSimulation` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var cts = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it samples/ETag/OccSimulation.cs:68— `cts` is a `CancellationTokenSource`, which implements `IDisposable`, and it is created here (line 68). Every use of it in `RunSimulation` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var cts = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it samples/GarnetClientSample/GarnetClientSamples.cs:77— `e` is a `ManualResetEventSlim`, which implements `IDisposable`, and it is created here (line 77). Every use of it in `SetGetSync` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var e = …;`), which releases it at the end of the scope on every path including a throw.
Disposable created and abandoned in the method that made it libs/storage/Tsavorite/cs/benchmark/KV.benchmark/EntryPoint.cs:22— `parser` is a `Parser`, which implements `IDisposable`, and it is created here (line 22). Every use of it in `Run` reads a member through it — it is never returned, never stored, never handed to anything else, and never disposed — so this method both creates the value and is the last thing that can release it, and does not. Nothing announces the leak: the object holds its resource until finalization if its type has a finalizer, and until the process ends if it does not, so the cost accumulates once per CALL rather than showing up as a failure. Declare it with `using` (`using var parser = …;`), which releases it at the end of the scope on every path including a throw.
Duplicated block (9 lines × 2) libs/server/Lua/LuaRunner.Functions.cs:2569— libs/server/Lua/LuaRunner.Functions.cs:2569-2577 | libs/server/Lua/LuaRunner.Functions.cs:2614-2622 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.cs:2569` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1232— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1232-1240 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1294-1302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9 lines × 2) libs/server/Resp/ArrayCommands.cs:56— libs/server/Resp/ArrayCommands.cs:56-64 | libs/server/Resp/BasicCommands.cs:407-415 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:250— libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:250-258 | libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:398-406 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:250` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) libs/server/Storage/Session/ObjectStore/HashOps.cs:43— libs/server/Storage/Session/ObjectStore/HashOps.cs:43-51 | libs/server/Storage/Session/ObjectStore/HashOps.cs:126-134 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (9 lines × 2) libs/client/LightEpoch.cs:190— libs/client/LightEpoch.cs:190-198 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:227-235 — before extracting anything, compare `libs/client/LightEpoch.cs` and `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 184 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (9 lines × 2) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1190— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1190-1198 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1226-1234 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1190` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) libs/server/Custom/CustomRespCommands.cs:99— libs/server/Custom/CustomRespCommands.cs:99-107 | libs/server/Custom/CustomRespCommands.cs:263-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Custom/CustomRespCommands.cs:99` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) libs/server/Resp/Vector/VectorManager.cs:1015— libs/server/Resp/Vector/VectorManager.cs:1015-1024 | libs/server/Resp/Vector/VectorManager.cs:1214-1222 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/VectorManager.cs:1015` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 2) libs/server/Storage/Session/ObjectStore/ListOps.cs:36— libs/server/Storage/Session/ObjectStore/ListOps.cs:36-45 | libs/server/Storage/Session/ObjectStore/ListOps.cs:73-81 — both copies are in the same file, so extract the block into 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) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:40— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:40-48 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:80-88 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (9 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/LogRecord.cs:1537— libs/storage/Tsavorite/cs/src/core/Allocator/LogRecord.cs:1537-1546 | libs/storage/Tsavorite/cs/src/core/Allocator/LogRecord.cs:1663-1671 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Allocator/LogRecord.cs:1537` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:127— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:127-135 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:165-173 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:137` calls `AdvancedOpCode` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:175` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9 lines × 2) playground/CommandInfoUpdater/RespCommandDocsParser.cs:42— playground/CommandInfoUpdater/RespCommandDocsParser.cs:42-50 | playground/CommandInfoUpdater/RespCommandDocsParser.cs:138-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/CommandInfoUpdater/RespCommandDocsParser.cs:42` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) libs/server/SessionParseStateExtensions.cs:883— libs/server/SessionParseStateExtensions.cs:883-890 | libs/server/SessionParseStateExtensions.cs:907-914 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/SessionParseStateExtensions.cs:883` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) libs/server/Storage/Session/ObjectStore/SortedSetGeoOps.cs:160— libs/server/Storage/Session/ObjectStore/SortedSetGeoOps.cs:160-167 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:778-785 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SortedSetGeoOps.cs:160` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:132— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:132-139 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:126-133 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:132` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (8 lines × 2) libs/common/RespWriteUtils.cs:777— libs/common/RespWriteUtils.cs:777-784 | libs/common/RespWriteUtils.cs:809-816 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/common/RespWriteUtils.cs:786` calls `CopyTo`, `WriteNewline` and `libs/common/RespWriteUtils.cs:818` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/DeviceLogCommitCheckpointManager.cs:225— libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/DeviceLogCommitCheckpointManager.cs:225-232 | libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/DeviceLogCommitCheckpointManager.cs:278-285 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/DeviceLogCommitCheckpointManager.cs:225` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) libs/server/Storage/Session/MainStore/VectorStoreOps.cs:498— libs/server/Storage/Session/MainStore/VectorStoreOps.cs:498-505 | libs/server/Storage/Session/MainStore/VectorStoreOps.cs:524-531 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/VectorStoreOps.cs:498` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) libs/common/Synchronization/ReadOptimizedLock.cs:411— libs/common/Synchronization/ReadOptimizedLock.cs:411-418 | libs/common/Synchronization/ReadOptimizedLock.cs:454-462 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/common/Synchronization/ReadOptimizedLock.cs:411` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 2) libs/server/Lua/LuaLimitedManagedAllocator.cs:452— libs/server/Lua/LuaLimitedManagedAllocator.cs:452-461 | libs/server/Lua/LuaTrackedAllocator.cs:110-117 — before extracting anything, compare `libs/server/Lua/LuaLimitedManagedAllocator.cs` and `libs/server/Lua/LuaTrackedAllocator.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 2) libs/server/Resp/KeyAdminCommands.cs:421— libs/server/Resp/KeyAdminCommands.cs:421-428 | libs/server/Storage/Session/UnifiedStore/UnifiedStoreOps.cs:200-207 — 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) libs/client/Utility.cs:127— libs/client/Utility.cs:127-134 | libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs:395-402 — before extracting anything, compare `libs/client/Utility.cs` and `libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 2) libs/client/Utility.cs:163— libs/client/Utility.cs:163-170 | libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs:451-459 — before extracting anything, compare `libs/client/Utility.cs` and `libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs:449` calls `MethodImpl` and `libs/client/Utility.cs:153` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:452— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:452-460 | libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs:452-459 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 236 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) libs/native/bftree-garnet/src/lib.rs:110— libs/native/bftree-garnet/src/lib.rs:110-117 | libs/native/bftree-garnet/src/lib.rs:442-449 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (8 lines × 2) samples/MetricsMonitor/ClientMonitor.cs:127— samples/MetricsMonitor/ClientMonitor.cs:127-135 | samples/MetricsMonitor/ClientMonitor.cs:162-169 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `samples/MetricsMonitor/ClientMonitor.cs:127` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) libs/server/Lua/LuaRunner.Functions.cs:2699— libs/server/Lua/LuaRunner.Functions.cs:2699-2715 | libs/server/Lua/LuaRunner.Functions.cs:2754-2770 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.cs:2699` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) libs/server/Objects/Hash/HashObjectImpl.cs:322— libs/server/Objects/Hash/HashObjectImpl.cs:322-338 | libs/server/Objects/Hash/HashObjectImpl.cs:399-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Objects/Hash/HashObjectImpl.cs:322` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) libs/server/Resp/Objects/HashCommands.cs:689— libs/server/Resp/Objects/HashCommands.cs:689-705 | libs/server/Resp/Objects/HashCommands.cs:768-784 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) libs/server/Resp/Objects/ListCommands.cs:282— libs/server/Resp/Objects/ListCommands.cs:282-298 | libs/server/Resp/Objects/SortedSetCommands.cs:1582-1598 — before extracting anything, compare `libs/server/Resp/Objects/ListCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Resp/Objects/ListCommands.cs:278` calls `TryGetTimeout`, `AbortWithErrorMessage` and `libs/server/Resp/Objects/SortedSetCommands.cs:1579` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17 lines × 2) libs/server/Resp/Objects/SortedSetCommands.cs:1851— libs/server/Resp/Objects/SortedSetCommands.cs:1851-1867 | libs/server/Resp/Objects/SortedSetCommands.cs:1937-1953 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17 lines × 2) libs/server/Objects/Hash/HashObjectImpl.cs:288— libs/server/Objects/Hash/HashObjectImpl.cs:288-304 | libs/server/Objects/Hash/HashObjectImpl.cs:367-383 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Objects/Hash/HashObjectImpl.cs:288` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) libs/server/Resp/PubSubCommands.cs:321— libs/server/Resp/PubSubCommands.cs:321-337 | libs/server/Resp/PubSubCommands.cs:401-417 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/PubSubCommands.cs:321` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) libs/cluster/Session/RespClusterSlotManagementCommands.cs:148— libs/cluster/Session/RespClusterSlotManagementCommands.cs:148-164 | libs/cluster/Session/RespClusterSlotManagementCommands.cs:361-377 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Session/RespClusterSlotManagementCommands.cs:148` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17 lines × 2) libs/server/Storage/Session/MainStore/RangeIndexOps.cs:613— libs/server/Storage/Session/MainStore/RangeIndexOps.cs:613-629 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:663-679 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/RangeIndexOps.cs:613` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:75— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:75-91 | libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs:74-90 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 236 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:868— libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:868-884 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:821-837 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 364 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (17 lines × 2) libs/server/Lua/LuaRunner.Functions.cs:2587— libs/server/Lua/LuaRunner.Functions.cs:2587-2603 | libs/server/Lua/LuaRunner.Functions.cs:2726-2743 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.cs:2587` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (17 lines × 2) libs/server/Lua/LuaRunner.Functions.Struct.cs:346— libs/server/Lua/LuaRunner.Functions.Struct.cs:346-363 | libs/server/Lua/LuaRunner.Functions.Struct.cs:765-781 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.Struct.cs:346` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
ClassTooLong: RespOnlineBench benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs— ClassTooLong — 828 significant lines (blank, comment-only and punctuation-only lines excluded), 16 methods. The bar is 400 significant lines; this is 428 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.
ClassTooLong: Options libs/host/Configuration/Options.cs— ClassTooLong — 828 significant lines (blank, comment-only and punctuation-only lines excluded), 6 methods. The bar is 400 significant lines; this is 428 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.
ClassTooLong: ReqGen benchmark/Resp.benchmark/OfflineBench/ReqGen.cs— ClassTooLong — 718 significant lines (blank, comment-only and punctuation-only lines excluded), 25 methods, declared across 3 files: OfflineBench/ReqGen.cs (12), OfflineBench/ReqGenUtils.cs (9), OfflineBench/ReqGenLoadBuffers.cs (4). The bar is 400 significant lines; this is 318 over it, 1.80× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: RespCommandHashLookup libs/server/Resp/Parser/RespCommandHashLookup.cs— ClassTooLong — 608 significant lines (blank, comment-only and punctuation-only lines excluded), 15 methods, declared across 2 files: Parser/RespCommandHashLookup.cs (14), Parser/RespCommandHashLookupData.cs (1). The bar is 400 significant lines; this is 208 over it, 1.52× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: ClusterBench benchmark/Resp.benchmark/ClusterBench/ClusterWorkloadDriver.cs— ClassTooLong — 590 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods, declared across 3 files: ClusterBench/ClusterWorkloadDriver.cs (16), ClusterBench/ClusterWorkloadDriver.Offline.cs (5), ClusterBench/ClusterWorkloadDriver.Online.cs (5). The bar is 400 significant lines; this is 190 over it, 1.48× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: JsonPath modules/GarnetJSON/JSONPath/JsonPath.cs— ClassTooLong — 578 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods. The bar is 400 significant lines; this is 178 over it, 1.45× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: CmdStrings libs/server/Resp/CmdStrings.cs— ClassTooLong — 506 significant lines (blank, comment-only and punctuation-only lines excluded), 0 methods. The bar is 400 significant lines; this is 106 over it, 1.27× the bar. The type holds no instance state, so there is no shared data to group its members by. To reduce it, split it by area instead: give each cohesive family of members its own smaller type, so no one type has to be read whole to change one of them.
ClassTooLong: MigrateSession libs/cluster/Server/Migration/MigrateSession.cs— ClassTooLong — 499 significant lines (blank, comment-only and punctuation-only lines excluded), 26 methods, declared across 5 files: Migration/MigrateSession.cs (10), Migration/MigrateSessionCommonUtils.cs (7), Migration/MigrationDriver.cs (4), Migration/MigrateSessionKeys.cs (3), +1 more file(s). The bar is 400 significant lines; this is 99 over it, 1.25× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: GarnetServerOptions libs/server/Servers/GarnetServerOptions.cs— ClassTooLong — 493 significant lines (blank, comment-only and punctuation-only lines excluded), 30 methods. The bar is 400 significant lines; this is 93 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.
ClassTooLong: KvBenchmark libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvBenchmark.cs— ClassTooLong — 486 significant lines (blank, comment-only and punctuation-only lines excluded), 19 methods, declared across 4 files: KV.benchmark/KvBenchmark.cs (10), KV.benchmark/KvBenchmark.Setup.cs (6), KV.benchmark/KvBenchmark.Worker.cs (2), KV.benchmark/KvBenchmark.Validate.cs (1). The bar is 400 significant lines; this is 86 over it, 1.22× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
ClassTooLong: TsavoriteLogScanIterator libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs— ClassTooLong — 472 significant lines (blank, comment-only and punctuation-only lines excluded), 23 methods. The bar is 400 significant lines; this is 72 over it, 1.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: GarnetInfoMetrics libs/server/Metrics/Info/GarnetInfoMetrics.cs— ClassTooLong — 442 significant lines (blank, comment-only and punctuation-only lines excluded), 24 methods. The bar is 400 significant lines; this is 42 over it, 1.11× the bar. To reduce it, group the members that share the same data into a smaller type of their own and delegate to it, so no single type carries every responsibility.
D4 · Code Duplication· Members sharing a duplicated core (4 members, 50+ identical tokens) · ×11
Members sharing a duplicated core (4 members, 50+ identical tokens) libs/common/Synchronization/ReadOptimizedLock.cs:411— libs/common/Synchronization/ReadOptimizedLock.cs:411-446 | libs/common/Synchronization/ReadOptimizedLock.cs:454-496 | libs/common/Synchronization/ReadOptimizedLock.cs:504-540 | libs/common/Synchronization/ReadOptimizedLock.cs:587-650 — 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) libs/server/Custom/CustomCommandManager.cs:86— libs/server/Custom/CustomCommandManager.cs:86-102 | libs/server/Custom/CustomCommandManager.cs:115-130 | libs/server/Custom/CustomCommandManager.cs:159-185 | libs/server/Custom/CustomCommandManager.cs:197-214 — 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) libs/server/Resp/Objects/SetCommands.cs:121— libs/server/Resp/Objects/SetCommands.cs:121-150 | libs/server/Resp/Objects/SetCommands.cs:160-221 | libs/server/Resp/Objects/SetCommands.cs:276-305 | libs/server/Resp/Objects/SetCommands.cs:745-774 — 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) libs/server/Resp/Objects/SortedSetCommands.cs:1005— libs/server/Resp/Objects/SortedSetCommands.cs:1005-1040 | libs/server/Resp/Objects/SortedSetCommands.cs:1172-1234 | libs/server/Resp/Objects/SortedSetCommands.cs:1245-1334 | libs/server/Resp/Objects/SortedSetCommands.cs:1473-1559 — 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) libs/server/Resp/Objects/SortedSetCommands.cs:1050— libs/server/Resp/Objects/SortedSetCommands.cs:1050-1163 | libs/server/Resp/Objects/SortedSetCommands.cs:1245-1334 | libs/server/Resp/Objects/SortedSetCommands.cs:1344-1463 | libs/server/Resp/Objects/SortedSetCommands.cs:1473-1559 — 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) libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:209— libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:209-222 | libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:245-263 | libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:266-279 | libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:282-298 — 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) libs/server/Storage/Session/MainStore/MainStoreOps.cs:17— libs/server/Storage/Session/MainStore/MainStoreOps.cs:17-42 | libs/server/Storage/Session/MainStore/MainStoreOps.cs:127-153 | libs/server/Storage/Session/MainStore/MainStoreOps.cs:157-181 | libs/server/Storage/Session/MainStore/MainStoreOps.cs:216-240 — 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) libs/server/Storage/Session/ObjectStore/SetOps.cs:30— libs/server/Storage/Session/ObjectStore/SetOps.cs:30-45 | libs/server/Storage/Session/ObjectStore/SetOps.cs:60-79 | libs/server/Storage/Session/ObjectStore/SetOps.cs:93-108 | libs/server/Storage/Session/ObjectStore/SetOps.cs:124-142 — 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) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:31— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:31-52 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:66-94 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:173-206 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:221-262 — 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) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1689— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1689-1709 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1767-1787 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1808-1828 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1849-1869 — 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) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2214— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2214-2260 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2326-2372 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2383-2429 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2441-2487 — 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 (14 lines × 2) libs/server/Storage/Session/ObjectStore/ListOps.cs:224— libs/server/Storage/Session/ObjectStore/ListOps.cs:224-237 | libs/server/Storage/Session/ObjectStore/SetOps.cs:267-280 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/ListOps.cs:224` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 2) libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:247— libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:247-260 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:674-687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:247` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 2) libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:825— libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:825-838 | libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:852-865 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:825` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:879— libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:879-892 | libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:906-919 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/GarnetClientAPI/GarnetClientExecuteAPI.cs:879` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 2) libs/server/Config/RuntimeServerConfig.cs:396— libs/server/Config/RuntimeServerConfig.cs:396-409 | libs/server/Config/RuntimeServerConfig.cs:411-424 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Config/RuntimeServerConfig.cs:396` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 2) libs/server/Lua/LuaRunner.Functions.cs:1327— libs/server/Lua/LuaRunner.Functions.cs:1327-1341 | libs/server/Lua/LuaRunner.Functions.cs:1371-1384 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14 lines × 2) libs/server/Lua/LuaRunner.Functions.cs:2514— libs/server/Lua/LuaRunner.Functions.cs:2514-2527 | libs/server/Lua/LuaRunner.Functions.cs:2632-2646 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.cs:2514` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) libs/server/Storage/Session/MainStore/HyperLogLogOps.cs:130— libs/server/Storage/Session/MainStore/HyperLogLogOps.cs:130-144 | libs/server/Storage/Session/MainStore/HyperLogLogOps.cs:231-244 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Storage/Session/MainStore/HyperLogLogOps.cs:231` calls `FromPinnedPointer` and `libs/server/Storage/Session/MainStore/HyperLogLogOps.cs:130` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (14 lines × 2) libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.Legacy.cs:120— libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.Legacy.cs:120-139 | libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.OriginReturn.cs:620-633 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) playground/Bitmap/BitOp.cs:280— playground/Bitmap/BitOp.cs:280-293 | playground/Bitmap/BitOp.cs:448-463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitOp.cs:280` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteAllocatorImpl.cs:39— libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteAllocatorImpl.cs:39-52 | libs/storage/Tsavorite/cs/src/core/Allocator/TsavoriteLogAllocatorImpl.cs:42-55 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteAllocatorImpl.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/TsavoriteLogAllocatorImpl.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 2) libs/cluster/Session/RespClusterSlotManagementCommands.cs:22— libs/cluster/Session/RespClusterSlotManagementCommands.cs:22-40 | libs/cluster/Session/RespClusterSlotManagementCommands.cs:189-207 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) libs/server/Resp/Objects/SetCommands.cs:182— libs/server/Resp/Objects/SetCommands.cs:182-200 | libs/server/Resp/Objects/SortedSetCommands.cs:1194-1212 — before extracting anything, compare `libs/server/Resp/Objects/SetCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/SetCommands.cs:182` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) libs/common/Format.cs:121— libs/common/Format.cs:121-139 | libs/common/Format.cs:196-214 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/common/Format.cs:121` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (19 lines × 2) libs/server/Resp/BasicEtagCommands.cs:28— libs/server/Resp/BasicEtagCommands.cs:28-46 | libs/server/Resp/BasicEtagCommands.cs:60-78 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/BasicEtagCommands.cs:28` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:134— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:134-152 | libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs:133-151 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 236 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 2) libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:807— libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:807-825 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:760-778 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 364 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/HashBucket.cs:92— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/HashBucket.cs:92-110 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/HashBucket.cs:133-151 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/HashBucket.cs:92` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (19 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteAllocatorImpl.cs:226— libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteAllocatorImpl.cs:226-244 | libs/storage/Tsavorite/cs/src/core/Allocator/TsavoriteLogAllocatorImpl.cs:117-135 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteAllocatorImpl.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/TsavoriteLogAllocatorImpl.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteAllocatorImpl.cs:226` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs:95— libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs:95-113 | libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs:130-148 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs:95` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 2) playground/Bitmap/BitCount.cs:322— playground/Bitmap/BitCount.cs:322-340 | playground/Bitmap/BitCount.cs:467-485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitCount.cs:322` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 2) libs/client/ClientSession/GarnetClientSession.cs:340— libs/client/ClientSession/GarnetClientSession.cs:340-358 | libs/client/GarnetClient.cs:412-430 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (5 lines × 2) libs/server/Resp/Objects/ListCommands.cs:871— libs/server/Resp/Objects/ListCommands.cs:871-875 | libs/server/Resp/Objects/SortedSetCommands.cs:1647-1651 — before extracting anything, compare `libs/server/Resp/Objects/ListCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (5 lines × 2) libs/server/Resp/Vector/ExprCompiler.cs:77— libs/server/Resp/Vector/ExprCompiler.cs:77-81 | libs/server/Resp/Vector/ExprCompiler.cs:87-91 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/ExprCompiler.cs:77` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/SplitIndex.cs:176— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/SplitIndex.cs:176-180 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/SplitIndex.cs:185-189 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/SplitIndex.cs:176` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.Legacy.cs:103— libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.Legacy.cs:103-107 | libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.OriginReturn.cs:536-540 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (5 lines × 2) libs/client/LightEpoch.cs:668— libs/client/LightEpoch.cs:668-672 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:692-696 — before extracting anything, compare `libs/client/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 326 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/LightEpoch.cs:668` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 2) libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:314— libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:314-320 | libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:1109-1113 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:314` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 2) playground/Bitmap/BitCount.cs:268— playground/Bitmap/BitCount.cs:268-272 | playground/Bitmap/BitCount.cs:413-417 — both copies are in the same file, so extract the block into 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/storage/Tsavorite/cs/src/core/ClientSession/NoOpSessionFunctions.cs:40— libs/storage/Tsavorite/cs/src/core/ClientSession/NoOpSessionFunctions.cs:40-44 | libs/storage/Tsavorite/cs/src/core/Index/Interfaces/SessionFunctionsBase.cs:41-45 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (5 lines × 2) libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:853— libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:853-857 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:806-810 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 364 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (5 lines × 2) libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs:397— libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs:397-401 | libs/storage/Tsavorite/cs/src/core/ClientSession/UnsafeContext.cs:289-293 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs` and `libs/storage/Tsavorite/cs/src/core/ClientSession/UnsafeContext.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 45 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 2) playground/Bitmap/BitOp.cs:423— playground/Bitmap/BitOp.cs:423-427 | playground/Bitmap/BitOp.cs:432-436 — both copies are in the same file, so extract the block into 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/server/Resp/Objects/HashCommands.cs:144— libs/server/Resp/Objects/HashCommands.cs:144-158 | libs/server/Resp/Objects/ListCommands.cs:526-540 — before extracting anything, compare `libs/server/Resp/Objects/HashCommands.cs` and `libs/server/Resp/Objects/ListCommands.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/HashCommands.cs:144` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) libs/server/Resp/Vector/RespServerSessionVectors.cs:406— libs/server/Resp/Vector/RespServerSessionVectors.cs:406-420 | libs/server/Resp/Vector/RespServerSessionVectors.cs:427-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) libs/common/Format.cs:93— libs/common/Format.cs:93-107 | libs/common/Format.cs:168-182 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/common/Format.cs:93` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) libs/server/Resp/HyperLogLog/HyperLogLog.cs:841— libs/server/Resp/HyperLogLog/HyperLogLog.cs:841-855 | libs/server/Resp/HyperLogLog/HyperLogLog.cs:907-921 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/HyperLogLog/HyperLogLog.cs:841` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (15 lines × 2) libs/cluster/Session/RespClusterSlotManagementCommands.cs:273— libs/cluster/Session/RespClusterSlotManagementCommands.cs:273-287 | libs/cluster/Session/RespClusterSlotManagementCommands.cs:634-648 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15 lines × 2) libs/server/Storage/Functions/MainStore/RMWMethods.cs:1179— libs/server/Storage/Functions/MainStore/RMWMethods.cs:1179-1193 | libs/server/Storage/Functions/MainStore/RMWMethods.cs:1199-1213 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Functions/MainStore/RMWMethods.cs:1179` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15 lines × 2) libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:484— libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:484-498 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:475-489 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 364 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (15 lines × 2) libs/server/Lua/LuaRunner.Functions.cs:2550— libs/server/Lua/LuaRunner.Functions.cs:2550-2564 | libs/server/Lua/LuaRunner.Functions.cs:2679-2694 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.cs:2550` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15 lines × 2) libs/server/Resp/Vector/RespServerSessionVectors.cs:593— libs/server/Resp/Vector/RespServerSessionVectors.cs:593-607 | libs/server/Resp/Vector/RespServerSessionVectors.cs:1050-1064 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/RespServerSessionVectors.cs:593` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (15 lines × 2) libs/server/Storage/Functions/MainStore/RMWMethods.cs:758— libs/server/Storage/Functions/MainStore/RMWMethods.cs:758-772 | libs/server/Storage/Functions/MainStore/RMWMethods.cs:826-840 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
X5 · Nullable reference types· Symbol treated as nullable, then dereferenced unguarded · ×10
Symbol treated as nullable, then dereferenced unguarded benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:753— This method contradicts itself about `primaryRedis`: line 868 writes `primaryRedis?.Dispose`, which says `primaryRedis` can be null, but line 753 then dereferences it directly as `primaryRedis.GetDatabase` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `primaryRedis` truly cannot be null here, the `?.` is misleading. Settle it one way — test `primaryRedis` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded libs/cluster/Server/Failover/ReplicaFailoverSession.cs:46— This method contradicts itself about `client`: line 53 writes `client?.Dispose`, which says `client` can be null, but line 46 then dereferences it directly as `client.IsConnected` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `client` truly cannot be null here, the `?.` is misleading. Settle it one way — test `client` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded libs/cluster/Server/Replication/PrimaryOps/ReplicaSyncSessionTaskStore.cs:131— This method contradicts itself about `retSession`: line 153 writes `retSession?.Dispose`, which says `retSession` can be null, but line 131 then dereferences it directly as `retSession.replicaNodeId` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `retSession` truly cannot be null here, the `?.` is misleading. Settle it one way — test `retSession` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded libs/host/Configuration/OptionsValidators.cs:518— This method contradicts itself about `icVal`: line 517 assigns it with `as IComparable`, which hands back null rather than throwing when the value is not a `IComparable`, but line 518 then dereferences it directly as `icVal.CompareTo` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `icVal` once before the first use and handle the null case, or cast with `(IComparable)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded libs/server/Resp/BasicCommands.cs:1952— This method contradicts itself about `targetSession`: line 1959 writes `targetSession?.clusterSession`, which says `targetSession` can be null, but line 1952 then dereferences it directly as `targetSession.Id` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `targetSession` truly cannot be null here, the `?.` is misleading. Settle it one way — test `targetSession` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded libs/server/StoreWrapper.cs:381— This method contradicts itself about `endPoint`: line 380 assigns it with `as IPEndPoint`, which hands back null rather than throwing when the value is not a `IPEndPoint`, but line 381 then dereferences it directly as `endPoint.Address` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `endPoint` once before the first use and handle the null case, or cast with `(IPEndPoint)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded libs/server/StoreWrapper.cs:390— This method contradicts itself about `endPoint`: line 389 assigns it with `as IPEndPoint`, which hands back null rather than throwing when the value is not a `IPEndPoint`, but line 390 then dereferences it directly as `endPoint.Address` with no null test between them and no guard around it. If the `as` is right, that dereference throws NullReferenceException on the input it was written for — and the NullReferenceException names neither the cast nor the type that failed. Settle it one way — test `endPoint` once before the first use and handle the null case, or cast with `(IPEndPoint)` so the failure is reported where it happens — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:974— This method contradicts itself about `snapshotObjectReadBuffers`: line 1031 writes `snapshotObjectReadBuffers?.Dispose`, which says `snapshotObjectReadBuffers` can be null, but line 974 then dereferences it directly as `snapshotObjectReadBuffers.OnBeginRecord` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `snapshotObjectReadBuffers` truly cannot be null here, the `?.` is misleading. Settle it one way — test `snapshotObjectReadBuffers` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.Chunked.cs:556— This method contradicts itself about `epochAccessor`: line 546 writes `epochAccessor?.TrySuspend`, which says `epochAccessor` can be null, but line 556 then dereferences it directly as `epochAccessor.Resume` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `epochAccessor` truly cannot be null here, the `?.` is misleading. Settle it one way — test `epochAccessor` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
Symbol treated as nullable, then dereferenced unguarded libs/storage/Tsavorite/cs/benchmark/BDN-Tsavorite.Benchmark/BenchmarkDotNetTestsApp.cs:72— This method contradicts itself about `args`: line 61 writes `args?.`, which says `args` can be null, but line 72 then dereferences it directly as `args.Length` with no null test between them and no guard around it. If the `?.` is right, that dereference throws NullReferenceException on the input it was written for; if `args` truly cannot be null here, the `?.` is misleading. Settle it one way — test `args` once before the first use and handle the null case, or drop the `?.` — rather than leaving the two readings side by side.
Duplicated block (24 lines × 2) libs/server/Storage/Session/ObjectStore/SetOps.cs:452— libs/server/Storage/Session/ObjectStore/SetOps.cs:452-475 | libs/server/Storage/Session/ObjectStore/SetOps.cs:889-912 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SetOps.cs:452` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (24 lines × 2) libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:495— libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:495-518 | libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:591-614 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:495` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) libs/server/Resp/Objects/HashCommands.cs:585— libs/server/Resp/Objects/HashCommands.cs:585-608 | libs/server/Resp/Objects/SortedSetCommands.cs:1744-1767 — before extracting anything, compare `libs/server/Resp/Objects/HashCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 196 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call 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) libs/server/Custom/ExpandableMap.cs:87— libs/server/Custom/ExpandableMap.cs:87-110 | libs/server/Custom/ExpandableMap.cs:120-143 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. Note first that the copies are not typed on the same thing: the declarations holding them bind `value` to `ref T` in one and `T` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (24 lines × 2) libs/server/Resp/RespServerSession.cs:1329— libs/server/Resp/RespServerSession.cs:1329-1352 | libs/server/Resp/RespServerSession.cs:1363-1386 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (24 lines × 2) libs/server/Storage/Functions/MainStore/RMWMethods.cs:591— libs/server/Storage/Functions/MainStore/RMWMethods.cs:591-614 | libs/server/Storage/Functions/MainStore/RMWMethods.cs:631-654 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Functions/MainStore/RMWMethods.cs:591` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:507— libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:507-530 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:498-521 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 364 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (24 lines × 2) modules/GarnetJSON/JSONPath/ScanArrayIndexFilter.cs:84— modules/GarnetJSON/JSONPath/ScanArrayIndexFilter.cs:84-107 | modules/GarnetJSON/JSONPath/ScanArrayMultipleIndexFilter.cs:83-106 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `modules/GarnetJSON/JSONPath/ScanArrayIndexFilter.cs:84` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24 lines × 2) libs/cluster/Session/MigrateCommand.cs:245— libs/cluster/Session/MigrateCommand.cs:245-268 | libs/cluster/Session/MigrateCommand.cs:297-320 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Session/MigrateCommand.cs:245` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 2) libs/server/SessionParseStateExtensions.cs:303— libs/server/SessionParseStateExtensions.cs:303-320 | libs/server/SessionParseStateExtensions.cs:390-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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) libs/server/Storage/Session/MainStore/RangeIndexOps.cs:477— libs/server/Storage/Session/MainStore/RangeIndexOps.cs:477-494 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:529-546 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18 lines × 2) libs/server/Storage/Session/ObjectStore/Common.cs:452— libs/server/Storage/Session/ObjectStore/Common.cs:452-469 | libs/server/Storage/Session/ObjectStore/Common.cs:520-537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/Common.cs:452` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (18 lines × 2) libs/server/InputHeader.cs:412— libs/server/InputHeader.cs:412-429 | libs/server/InputHeader.cs:533-550 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 2) libs/server/Lua/LuaLimitedManagedAllocator.cs:1149— libs/server/Lua/LuaLimitedManagedAllocator.cs:1149-1166 | libs/server/Lua/LuaTrackedAllocator.cs:159-176 — before extracting anything, compare `libs/server/Lua/LuaLimitedManagedAllocator.cs` and `libs/server/Lua/LuaTrackedAllocator.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 2) libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:56— libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:56-73 | libs/storage/Tsavorite/cs/src/core/Device/RandomAccessLocalStorageDevice.cs:130-147 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/Device/RandomAccessLocalStorageDevice.cs:152` calls `DrainPendingIO` and `libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:78` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18 lines × 2) playground/Embedded.perftest/PerformanceTestLoggerProvider.cs:75— playground/Embedded.perftest/PerformanceTestLoggerProvider.cs:75-92 | playground/MigrateBench/BenchmarkLoggerProvider.cs:76-93 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (18 lines × 2) libs/cluster/Session/RespClusterBasicCommands.cs:562— libs/cluster/Session/RespClusterBasicCommands.cs:562-579 | libs/cluster/Session/RespClusterBasicCommands.cs:636-653 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Session/RespClusterBasicCommands.cs:562` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18 lines × 2) libs/server/Lua/LuaRunner.cs:1017— libs/server/Lua/LuaRunner.cs:1017-1034 | libs/server/Lua/LuaRunner.cs:1075-1093 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Sync-over-async (deadlock risk) through `Task.WaitAll` benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:714— `Task.WaitAll` blocks this thread until the tasks complete — sync-over-async: it can deadlock under a synchronization context and it parks a thread for as long as the work runs. `await Task.WhenAll(…)` instead.
Sync-over-async (deadlock risk) through `Task.WaitAll` benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:443— `Task.WaitAll` blocks this thread until the tasks complete — sync-over-async: it can deadlock under a synchronization context and it parks a thread for as long as the work runs. `await Task.WhenAll(…)` instead.
Sync-over-async (deadlock risk) through `Task.WaitAll` benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:475— `Task.WaitAll` blocks this thread until the tasks complete — sync-over-async: it can deadlock under a synchronization context and it parks a thread for as long as the work runs. `await Task.WhenAll(…)` instead.
Sync-over-async (deadlock risk) through `Task.WaitAll` benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:852— `Task.WaitAll` blocks this thread until the tasks complete — sync-over-async: it can deadlock under a synchronization context and it parks a thread for as long as the work runs. `await Task.WhenAll(…)` instead.
Sync-over-async (deadlock risk) through `Task.WaitAll` benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:869— `Task.WaitAll` blocks this thread until the tasks complete — sync-over-async: it can deadlock under a synchronization context and it parks a thread for as long as the work runs. `await Task.WhenAll(…)` instead.
Sync-over-async (deadlock risk) through `Task.WaitAll` benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:202— `Task.WaitAll` blocks this thread until the tasks complete — sync-over-async: it can deadlock under a synchronization context and it parks a thread for as long as the work runs. `await Task.WhenAll(…)` instead.
Sync-over-async (deadlock risk) through `Task.WaitAll` benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:216— `Task.WaitAll` blocks this thread until the tasks complete — sync-over-async: it can deadlock under a synchronization context and it parks a thread for as long as the work runs. `await Task.WhenAll(…)` instead.
Sync-over-async (deadlock risk) through `Task.WaitAll` benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:642— `Task.WaitAll` blocks this thread until the tasks complete — sync-over-async: it can deadlock under a synchronization context and it parks a thread for as long as the work runs. `await Task.WhenAll(…)` instead.
Sync-over-async (deadlock risk) through `Task.WaitAll` benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:649— `Task.WaitAll` blocks this thread until the tasks complete — sync-over-async: it can deadlock under a synchronization context and it parks a thread for as long as the work runs. `await Task.WhenAll(…)` instead.
D4 · Code Duplication· Members sharing a duplicated core (5 members, 50+ identical tokens) · ×8
Members sharing a duplicated core (5 members, 50+ identical tokens) libs/client/GarnetClientProcessReplies.cs:20— libs/client/GarnetClientProcessReplies.cs:20-66 | libs/client/GarnetClientProcessReplies.cs:69-96 | libs/client/GarnetClientProcessReplies.cs:99-145 | libs/client/GarnetClientProcessReplies.cs:148-195 | libs/client/GarnetClientProcessReplies.cs:198-213 — 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) libs/cluster/Server/Migration/MigrateSessionCommonUtils.cs:61— libs/cluster/Server/Migration/MigrateSessionCommonUtils.cs:61-70 | libs/server/Resp/Vector/VectorManager.Replication.cs:845-888 | libs/server/Resp/Vector/VectorManager.cs:664-672 | libs/server/Storage/Session/ObjectStore/CompletePending.cs:20-28 | libs/server/Storage/Session/UnifiedStore/CompletePending.cs:20-28 — 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) libs/cluster/Session/RespClusterSlotManagementCommands.cs:21— libs/cluster/Session/RespClusterSlotManagementCommands.cs:21-55 | libs/cluster/Session/RespClusterSlotManagementCommands.cs:63-97 | libs/cluster/Session/RespClusterSlotManagementCommands.cs:188-222 | libs/cluster/Session/RespClusterSlotManagementCommands.cs:230-264 | libs/cluster/Session/RespClusterSlotManagementCommands.cs:304-331 — 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) libs/common/RespWriteUtils.cs:23— libs/common/RespWriteUtils.cs:23-32 | libs/common/RespWriteUtils.cs:38-47 | libs/common/RespWriteUtils.cs:71-80 | libs/common/RespWriteUtils.cs:86-95 | libs/common/RespWriteUtils.cs:330-340 — 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) libs/server/Lua/LuaRunner.cs:2192— libs/server/Lua/LuaRunner.cs:2192-2274 | libs/server/Lua/LuaRunner.cs:2277-2358 | libs/server/Lua/LuaRunner.cs:2361-2433 | libs/server/Lua/LuaRunner.cs:2437-2511 | libs/server/Lua/LuaRunner.cs:2541-2607 — 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) libs/server/Resp/Objects/HashCommands.cs:85— libs/server/Resp/Objects/HashCommands.cs:85-115 | libs/server/Resp/Objects/HashCommands.cs:169-205 | libs/server/Resp/Objects/ListCommands.cs:71-122 | libs/server/Resp/Objects/SortedSetCommands.cs:259-293 | libs/server/Resp/Objects/SortedSetCommands.cs:695-750 — 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) libs/server/Resp/Objects/ListCommands.cs:269— libs/server/Resp/Objects/ListCommands.cs:269-311 | libs/server/Resp/Objects/ListCommands.cs:354-398 | libs/server/Resp/Objects/ListCommands.cs:848-943 | libs/server/Resp/Objects/SortedSetCommands.cs:1565-1615 | libs/server/Resp/Objects/SortedSetCommands.cs:1621-1728 — 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) modules/GarnetJSON/JSONPath/ScanArrayIndexFilter.cs:30— modules/GarnetJSON/JSONPath/ScanArrayIndexFilter.cs:30-107 | modules/GarnetJSON/JSONPath/ScanArrayMultipleIndexFilter.cs:37-106 | modules/GarnetJSON/JSONPath/ScanArraySliceFilter.cs:41-182 | modules/GarnetJSON/JSONPath/ScanFilter.cs:37-99 | modules/GarnetJSON/JSONPath/ScanMultipleFilter.cs:33-89 — 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 (20 lines × 2) libs/client/RespReadResponseUtils.cs:128— libs/client/RespReadResponseUtils.cs:128-147 | libs/common/RespReadUtils.cs:962-981 — before extracting anything, compare `libs/client/RespReadResponseUtils.cs` and `libs/common/RespReadUtils.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/RespReadResponseUtils.cs:128` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) libs/server/Lua/LuaRunner.Functions.Struct.cs:279— libs/server/Lua/LuaRunner.Functions.Struct.cs:279-298 | libs/server/Lua/LuaRunner.Functions.Struct.cs:1001-1020 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.Struct.cs:279` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:174— libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:174-193 | libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:283-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:174` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20 lines × 2) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:957— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:957-976 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1045-1064 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:957` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `entry` to `byte[]` in one and `ReadOnlySpan<byte>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (20 lines × 2) playground/Bitmap/BitCount.cs:241— playground/Bitmap/BitCount.cs:241-260 | playground/Bitmap/BitCount.cs:386-405 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitCount.cs:241` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (20 lines × 2) libs/server/InputHeader.cs:388— libs/server/InputHeader.cs:388-407 | libs/server/InputHeader.cs:509-528 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20 lines × 2) libs/server/Lua/LuaLimitedManagedAllocator.cs:1173— libs/server/Lua/LuaLimitedManagedAllocator.cs:1173-1192 | libs/server/Lua/LuaTrackedAllocator.cs:183-202 — before extracting anything, compare `libs/server/Lua/LuaLimitedManagedAllocator.cs` and `libs/server/Lua/LuaTrackedAllocator.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20 lines × 2) libs/server/Resp/Vector/VectorManager.cs:1134— libs/server/Resp/Vector/VectorManager.cs:1134-1153 | libs/server/Resp/Vector/VectorManager.cs:1328-1347 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/VectorManager.cs:1134` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 2) libs/cluster/Session/RespClusterSlotManagementCommands.cs:201— libs/cluster/Session/RespClusterSlotManagementCommands.cs:201-222 | libs/cluster/Session/RespClusterSlotManagementCommands.cs:243-264 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Session/RespClusterSlotManagementCommands.cs:201` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 2) libs/server/Objects/Hash/HashObjectImpl.cs:464— libs/server/Objects/Hash/HashObjectImpl.cs:464-485 | libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:919-940 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Objects/Hash/HashObjectImpl.cs:464` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 2) libs/server/Storage/Session/MainStore/MainStoreOps.cs:265— libs/server/Storage/Session/MainStore/MainStoreOps.cs:265-286 | libs/server/Storage/Session/MainStore/MainStoreOps.cs:325-346 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/MainStoreOps.cs:265` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Storage/Session/MainStore/MainStoreOps.cs:261` calls `FromPinnedPointer` and `libs/server/Storage/Session/MainStore/MainStoreOps.cs:322` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22 lines × 2) libs/client/Utility.cs:25— libs/client/Utility.cs:25-46 | libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs:42-63 — before extracting anything, compare `libs/client/Utility.cs` and `libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (22 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:103— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:103-124 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:102-123 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:103` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (22 lines × 2) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1528— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1528-1549 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1578-1599 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1528` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1601` calls `TotalSize`, `SerializeTo` and `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1551` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (22 lines × 2) libs/server/Resp/Vector/VectorManager.ElementData.cs:174— libs/server/Resp/Vector/VectorManager.ElementData.cs:174-195 | libs/server/Resp/Vector/VectorManager.ElementData.cs:200-221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/VectorManager.ElementData.cs:174` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (16 lines × 2) libs/server/Lua/LuaRunner.Functions.cs:2527— libs/server/Lua/LuaRunner.Functions.cs:2527-2542 | libs/server/Lua/LuaRunner.Functions.cs:2564-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.cs:2527` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) libs/server/Resp/Objects/ListCommands.cs:618— libs/server/Resp/Objects/ListCommands.cs:618-633 | libs/server/Resp/Objects/ListCommands.cs:672-687 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/ListCommands.cs:618` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) libs/server/Resp/Vector/VectorManager.Locking.cs:213— libs/server/Resp/Vector/VectorManager.Locking.cs:213-228 | libs/server/Resp/Vector/VectorManager.Locking.cs:472-487 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/VectorManager.Locking.cs:213` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 2) libs/server/ByteArrayWrapper.cs:52— libs/server/ByteArrayWrapper.cs:52-67 | libs/server/Resp/ByteArrayComparer.cs:38-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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (16 lines × 2) libs/server/Resp/PubSubCommands.cs:226— libs/server/Resp/PubSubCommands.cs:226-241 | libs/server/Resp/PubSubCommands.cs:267-282 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/PubSubCommands.cs:226` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) libs/server/Lua/LuaRunner.cs:919— libs/server/Lua/LuaRunner.cs:919-935 | libs/server/Lua/LuaRunner.cs:993-1008 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.cs:919` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16 lines × 2) libs/server/Storage/Functions/MainStore/RMWMethods.cs:443— libs/server/Storage/Functions/MainStore/RMWMethods.cs:443-458 | libs/server/Storage/Functions/UnifiedStore/RMWMethods.cs:156-171 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Functions/MainStore/RMWMethods.cs:443` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `input` to `ref StringInput` in one and `ref UnifiedInput` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Storage/Functions/UnifiedStore/RMWMethods.cs:154` calls `InPlaceUpdater` and `libs/server/Storage/Functions/MainStore/RMWMethods.cs:441` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) libs/server/Resp/KeyAdminCommands.cs:373— libs/server/Resp/KeyAdminCommands.cs:373-383 | libs/server/Resp/Objects/HashCommands.cs:590-600 | libs/server/Resp/Objects/SortedSetCommands.cs:1749-1759 — before extracting anything, compare `libs/server/Resp/Objects/HashCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 196 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 3) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1305— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1305-1315 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1339-1349 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1380-1390 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1305` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) libs/server/Lua/LuaRunner.Functions.Struct.cs:285— libs/server/Lua/LuaRunner.Functions.Struct.cs:285-295 | libs/server/Lua/LuaRunner.Functions.Struct.cs:693-703 | libs/server/Lua/LuaRunner.Functions.Struct.cs:1007-1017 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.Struct.cs:285` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11 lines × 3) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1121— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1121-1131 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1226-1236 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1292-1302 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1121` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1304` calls `TotalSize`, `CopyTo` and `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1133` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11 lines × 3) playground/Bitmap/BitOp.cs:1392— playground/Bitmap/BitOp.cs:1392-1402 | playground/Bitmap/BitOp.cs:1426-1436 | playground/Bitmap/BitOp.cs:1460-1470 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitOp.cs:1392` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11 lines × 3) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:385— libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:385-395 | playground/Bitmap/BitCount.cs:296-306 | playground/Bitmap/BitCount.cs:441-451 — before extracting anything, compare `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs` and `playground/Bitmap/BitCount.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:385` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11 lines × 3) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:34— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:34-45 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:190-200 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:238-250 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (8 lines × 3) libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:204— libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:204-211 | libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:257-264 | libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:310-317 — 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) libs/server/Storage/Functions/MainStore/PrivateMethods.cs:237— libs/server/Storage/Functions/MainStore/PrivateMethods.cs:237-244 | libs/server/Storage/Functions/MainStore/RMWMethods.cs:196-203 | libs/server/Storage/Functions/MainStore/RMWMethods.cs:1237-1244 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Functions/MainStore/PrivateMethods.cs:237` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) libs/server/Storage/Session/MainStore/VectorStoreOps.cs:553— libs/server/Storage/Session/MainStore/VectorStoreOps.cs:553-560 | libs/server/Storage/Session/MainStore/VectorStoreOps.cs:627-634 | libs/server/Storage/Session/MainStore/VectorStoreOps.cs:708-715 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/VectorStoreOps.cs:553` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8 lines × 3) libs/server/Storage/Session/ObjectStore/HashOps.cs:45— libs/server/Storage/Session/ObjectStore/HashOps.cs:45-52 | libs/server/Storage/Session/ObjectStore/HashOps.cs:83-90 | libs/server/Storage/Session/ObjectStore/HashOps.cs:128-135 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/HashOps.cs:45` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8 lines × 3) playground/Bitmap/BitOp.cs:1311— playground/Bitmap/BitOp.cs:1311-1318 | playground/Bitmap/BitOp.cs:1337-1344 | playground/Bitmap/BitOp.cs:1363-1370 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitOp.cs:1311` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (8 lines × 3) libs/client/LightEpoch.cs:206— libs/client/LightEpoch.cs:206-213 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:243-250 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:233-240 — before extracting anything, compare `libs/client/LightEpoch.cs` and `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 184 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (8 lines × 3) libs/client/Utility.cs:70— libs/client/Utility.cs:70-77 | libs/server/Servers/ServerOptions.cs:316-323 | libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs:84-91 — before extracting anything, compare `libs/client/Utility.cs` and `libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (5 lines × 3) libs/server/Lua/LuaRunner.Functions.Struct.cs:394— libs/server/Lua/LuaRunner.Functions.Struct.cs:394-398 | libs/server/Lua/LuaRunner.Functions.Struct.cs:534-538 | libs/server/Lua/LuaRunner.Functions.Struct.cs:570-574 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) libs/server/Resp/Vector/VectorManager.Locking.cs:325— libs/server/Resp/Vector/VectorManager.Locking.cs:325-329 | libs/server/Resp/Vector/VectorManager.Locking.cs:561-565 | libs/server/Resp/Vector/VectorManager.Locking.cs:594-598 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/server/Resp/Vector/VectorManager.Locking.cs:599` calls `SetArgument`, `FromPinnedSpan`, `CreateSpan` and `libs/server/Resp/Vector/VectorManager.Locking.cs:331` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 3) libs/server/Storage/Session/ObjectStore/ListOps.cs:336— libs/server/Storage/Session/ObjectStore/ListOps.cs:336-340 | libs/server/Storage/Session/ObjectStore/ListOps.cs:397-401 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:697-701 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:515— libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:515-519 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs:272-276 | libs/storage/Tsavorite/cs/src/core/ClientSession/UnsafeContext.cs:164-168 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs` and `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:524— libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:524-528 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs:281-285 | libs/storage/Tsavorite/cs/src/core/ClientSession/UnsafeContext.cs:173-177 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs` and `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:576— libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:576-580 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs:316-320 | libs/storage/Tsavorite/cs/src/core/ClientSession/UnsafeContext.cs:208-212 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs` and `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 3) libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:585— libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:585-589 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs:325-329 | libs/storage/Tsavorite/cs/src/core/ClientSession/UnsafeContext.cs:217-221 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs` and `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
No assertions: ParallelPasswordHashTest test/standalone/Garnet.test.acl/Resp/ACL/ParallelTests.cs:88— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: Issue1165 test/standalone/Garnet.test.scripting/LuaScriptRunnerTests.cs:827— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: GarnetEndToEnd test/standalone/Garnet.test/FuzzTargetTests.cs:49— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: LuaScriptCompilation test/standalone/Garnet.test/FuzzTargetTests.cs:55— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: RespCommandParsing test/standalone/Garnet.test/FuzzTargetTests.cs:61— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
No assertions: RecoverReadOnlyAsyncBasicTest libs/storage/Tsavorite/cs/test/test.recovery/RecoverReadOnlyTest.cs:71— This method's body runs code, and no assertion call was recognised in it. Recognised by name: Assert*, *Should*/ShouldBe*, Verify, Expect, Throws, Record, Received/DidNotReceive, MustHaveHappened/MustNotHaveHappened, EnsureSuccessStatusCode and *AndEnsure* — so verification routed through a helper of your own naming, through a base-class or callback object whose members hold the assertions, or through a harness that fails by throwing under some other name, is not visible to this check and is not counted here. Read it as 'no assertion this check knows how to see', and if that is right, add one.
Repeated repair: libs/server/Resp/Vector/VectorManager.Cleanup.cs libs/server/Resp/Vector/VectorManager.Cleanup.cs:265— libs/server/Resp/Vector/VectorManager.Cleanup.cs changed 5 times in last 90 days and 4 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 11 (its worst body is VectorManager.RunCleanupTaskAsync at line 265), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Fix Vector Set replay after startup AOF recovery (#2231)”; “Fixes around CU copies and delete deadlocks (#2082)”; “Fixes for Vector Set `RENAME`s in AOF replay (#2080)”; “Add tests (and fix bugs) for commands WRONGTYPE'ing appropriately against Vector Sets (#1935)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Resp/Vector/VectorManager.Cleanup.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/DeviceLogCommitCheckpointManager.cs libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/DeviceLogCommitCheckpointManager.cs:353— libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/DeviceLogCommitCheckpointManager.cs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is DeviceLogCommitCheckpointManager.OnRecovery at line 353), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Fix silent pre-listen hang and silent wrong-recovery on --recover (#2076) (#2093)”; “Harden TsavoriteLog commit-failure handling and fix fast-commit recovery poisoning (#2065)”; “[Tsavorite] Default to NativeStorageDevice on x64 Linux (+ segment-boundary flush and write-error propagation fixes) (#1991)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/DeviceLogCommitCheckpointManager.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: libs/storage/Tsavorite/cs/src/core/Device/IDevice.cs libs/storage/Tsavorite/cs/src/core/Device/IDevice.cs:113— libs/storage/Tsavorite/cs/src/core/Device/IDevice.cs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 1 (its worst body is IDevice.TryCompleteMine at line 113), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[Tsavorite] Fix silent data loss when the hash index checkpoint exceeds the OS single-request limit (#2159)”; “Fix silent pre-listen hang and silent wrong-recovery on --recover (#2076) (#2093)”; “Harden TsavoriteLog commit-failure handling and fix fast-commit recovery poisoning (#2065)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/storage/Tsavorite/cs/src/core/Device/IDevice.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: libs/server/Resp/Vector/VectorManager.ContextMetadata.cs libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:376— libs/server/Resp/Vector/VectorManager.ContextMetadata.cs changed 4 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 8 (its worst body is ContextMetadata.ToString at line 376), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Fix root causes behind recurring Garnet .NET CI flakes (#2110)”; “Fix possible namespace corruption in VectorSets (#2056)”; “Add tests (and fix bugs) for commands WRONGTYPE'ing appropriately against Vector Sets (#1935)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/server/Resp/Vector/VectorManager.ContextMetadata.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: libs/storage/Tsavorite/cs/src/core/Device/ShardedStorageDevice.cs libs/storage/Tsavorite/cs/src/core/Device/ShardedStorageDevice.cs:206— libs/storage/Tsavorite/cs/src/core/Device/ShardedStorageDevice.cs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 9 (its worst body is ShardedStorageDevice.WriteAsync at line 206), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “[Tsavorite] Fix silent data loss when the hash index checkpoint exceeds the OS single-request limit (#2159)”; “Fix silent pre-listen hang and silent wrong-recovery on --recover (#2076) (#2093)”; “Harden TsavoriteLog commit-failure handling and fix fast-commit recovery poisoning (#2065)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/storage/Tsavorite/cs/src/core/Device/ShardedStorageDevice.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
Repeated repair: libs/storage/Tsavorite/cs/src/core/Allocator/ObjectSerialization/CircularDiskWriteBuffer.cs libs/storage/Tsavorite/cs/src/core/Allocator/ObjectSerialization/CircularDiskWriteBuffer.cs:232— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectSerialization/CircularDiskWriteBuffer.cs changed 3 times in last 90 days and 3 of those changes were fix/bug commits, so repair is the majority of this file's churn. Its max cyclomatic complexity is 6 (its worst body is CircularDiskWriteBuffer.FlushToDeviceCallback at line 232), UNDER the 15 threshold, so this is deliberately not filed as a churn × complexity hotspot — the difficulty here is in the behaviour the file has to get right, not in its control flow, and refactoring it for complexity would be the wrong move. The repairs counted were: “Harden TsavoriteLog commit-failure handling and fix fast-commit recovery poisoning (#2065)”; “Fix object-log write buffer leaks in ObjectAllocator read-only and recovery flushes (#2046)”; “[Tsavorite] Default to NativeStorageDevice on x64 Linux (+ segment-boundary flush and write-error propagation fixes) (#1991)”. Each one is a case this code did not handle. Before the next change lands here, check that every one of them is pinned by a test that fails without its fix; where the same area keeps coming back, the durable fix is usually at the interface that keeps being misused rather than at the line that was last corrected. Counted over 2026-07-24..2026-10-22, the 90 days ending at the analysed commit. Reproduce with `git log --since='2026-07-24 21:17:16 -04:00' --until='2026-10-22 21:17:16 -04:00' --full-history --no-merges -- libs/storage/Tsavorite/cs/src/core/Allocator/ObjectSerialization/CircularDiskWriteBuffer.cs`: merges are excluded because a merge re-states changes already counted at their own commits, and history is NOT path-simplified because a change that reached the file through a merged branch is still a change to it. That command counts raw commits and can read HIGHER than this row, which counts a cherry-picked re-land, and a revert together with the commit it undoes, once each — a difference of several commits on a file whose history was re-landed or reverted inside the window.
BarePragmaDisable benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:21— #pragma warning disable IDE0300 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable libs/cluster/Server/ClusterConfig.cs:4— #pragma warning disable IDE0005 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable libs/common/Format.cs:24— #pragma warning disable format — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable libs/common/Format.cs:33— #pragma warning disable format — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable libs/storage/Tsavorite/cs/test/ExpirationTests.cs:81— #pragma warning disable format — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
BarePragmaDisable libs/server/Resp/Vector/VectorManager.Replication.cs:186— #pragma warning disable IDE0302 — the disable is closed again below, so its scope is not the problem; what it records is no reason: there is nothing on the directive line, and no ordinary comment attached to it either side. A suppression is a decision somebody made, and without the reason the next reader cannot tell a considered exception from an unexamined one, so it is never revisited and it outlives the code it was written for. Put the reason on the directive line — what makes this site legitimately different — or fix what the rule is pointing at and delete the pair. A rationale in the member's documentation comment does not clear this row and is not meant to: it explains the member to its callers, and the next person to touch the suppression is not reading it for that.
Duplicated block (21 lines × 2) libs/cluster/Session/RespClusterSlotManagementCommands.cs:35— libs/cluster/Session/RespClusterSlotManagementCommands.cs:35-55 | libs/cluster/Session/RespClusterSlotManagementCommands.cs:77-97 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Session/RespClusterSlotManagementCommands.cs:35` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) libs/server/Resp/Objects/HashCommands.cs:185— libs/server/Resp/Objects/HashCommands.cs:185-205 | libs/server/Resp/Objects/SortedSetCommands.cs:323-343 — before extracting anything, compare `libs/server/Resp/Objects/HashCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 196 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/HashCommands.cs:185` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1085— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1085-1105 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1448-1468 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1085` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21 lines × 2) libs/client/LightEpoch.cs:505— libs/client/LightEpoch.cs:505-525 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:529-549 — before extracting anything, compare `libs/client/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 326 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (21 lines × 2) libs/server/Resp/Vector/RespServerSessionVectors.cs:1656— libs/server/Resp/Vector/RespServerSessionVectors.cs:1656-1676 | libs/server/Resp/Vector/RespServerSessionVectors.cs:1716-1736 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/RespServerSessionVectors.cs:1656` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (21 lines × 2) libs/common/Networking/GarnetTcpNetworkSender.cs:383— libs/common/Networking/GarnetTcpNetworkSender.cs:383-403 | libs/common/Networking/TcpNetworkHandlerBase.cs:97-117 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Change coupling: SetObject.cs ↔ RespCommand.cs libs/server/Objects/Set/SetObject.cs:1— `libs/server/Objects/Set/SetObject.cs` and `libs/server/Resp/Parser/RespCommand.cs` change together 69% of the time (9 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 9 shared commits counted here, the most recent 3 are `e267b620` Stabilize disk-persisted enum values (#1943); `a4b47b4d` [Compatibility] Added SMISMEMBER command (#713); `b1891d1f` API Coverage - Implement SINTER and SINTERSTORE (#180) (#334) (at that commit the file was still `libs/server/Resp/RespCommand.cs`) — run `git show` on any of them.
Change coupling: SetObject.cs ↔ TxnKeyManager.cs libs/server/Objects/Set/SetObject.cs:1— `libs/server/Objects/Set/SetObject.cs` and `libs/server/Transaction/TxnKeyManager.cs` change together 62% of the time (8 of the 13 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `a4b47b4d` [Compatibility] Added SMISMEMBER command (#713); `b1891d1f` API Coverage - Implement SINTER and SINTERSTORE (#180) (#334); `a4dc14f9` Add SUNIONSTORE command. (#291) — run `git show` on any of them.
Change coupling: SortedSetCommands.cs ↔ SortedSetOps.cs libs/server/Resp/Objects/SortedSetCommands.cs:1— `libs/server/Resp/Objects/SortedSetCommands.cs` and `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs` change together 55% of the time (16 of the 29 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 16 shared commits counted here, the most recent 3 are `07b4504d` Fix ZRANGESTORE aborting the RESP session on invalid range parameters…; `668a477d` Fixes for expiry-related commands (#1296); `d5811059` Several tiny SortedSet fixes (#1275) — run `git show` on any of them.
Change coupling: Gossip.cs ↔ RespClusterBasicCommands.cs libs/cluster/Server/Gossip/Gossip.cs:1— `libs/cluster/Server/Gossip/Gossip.cs` and `libs/cluster/Session/RespClusterBasicCommands.cs` change together 50% of the time (8 of the 16 commits that touched whichever of the two files changed less often, counting a file under its earlier names as well — a repo-wide or module-wide sweep is evidence about the sweep rather than about any pair inside it and is left out of BOTH sides of this ratio, while a dependency bump, a formatter/rename sweep, or a commit whose edit to one of the two files was a tool directive such as //go:generate or whitespace only is left out of the shared count ONLY, so the two sides are not taken over identical commit sets). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these holds, the coupling is hidden and worth breaking. You can check this without leaving the row: of the 8 shared commits counted here, the most recent 3 are `456925d8` [Cluster] Add separate peer endpoints and optimistic gossip in 2.2.2 …; `9fc3b963` Exponential backoff for gossip reconnect, TLS read fix, and pub/sub l…; `0d585906` [Cluster] Read version 2 endpoints before enabling writers (breaking)… — run `git show` on any of them.
Change coupling: ClusterManagerWorkerState.cs ↔ ReplicaFailoverSession.cs libs/cluster/Server/ClusterManagerWorkerState.cs:1— `libs/cluster/Server/ClusterManagerWorkerState.cs` and `libs/cluster/Server/Failover/ReplicaFailoverSession.cs` 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). They sit in different directories, but in this ecosystem the namespace is declared in the FILE, not by the folder — so the two may well share one namespace and reference each other with no import for this pass to see. Read the pair before acting: if one derives from or overrides the other, the dependency is explicit in the type declaration and the co-change is definitional; if one registers itself into the other through a hook or an initialiser, the missing dependency is DELIBERATE and the thing to add is a comment saying so; if they simply belong together, co-locate them; if none of these 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 `456925d8` [Cluster] Add separate peer endpoints and optimistic gossip in 2.2.2 …; `218aaca9` Ensure SuspendRecovery is called only once (#1110); `3ba27857` Expose Recovery and Failover Status (#1087) — run `git show` on any of them.
Duplicated block (23 lines × 2) modules/GarnetJSON/JSONPath/ScanFilter.cs:77— modules/GarnetJSON/JSONPath/ScanFilter.cs:77-99 | modules/GarnetJSON/JSONPath/ScanMultipleFilter.cs:67-89 — before extracting anything, compare `modules/GarnetJSON/JSONPath/ScanFilter.cs` and `modules/GarnetJSON/JSONPath/ScanMultipleFilter.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/GarnetJSON/JSONPath/ScanFilter.cs:77` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23 lines × 2) libs/server/Resp/Vector/RespServerSessionVectors.cs:1273— libs/server/Resp/Vector/RespServerSessionVectors.cs:1273-1295 | libs/server/Resp/Vector/RespServerSessionVectors.cs:1413-1435 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (23 lines × 2) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1128— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1128-1150 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1386-1408 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1128` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (23 lines × 2) libs/server/Resp/Objects/ListCommands.cs:715— libs/server/Resp/Objects/ListCommands.cs:715-737 | libs/server/Resp/Objects/ListCommands.cs:754-776 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/ListCommands.cs:715` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (23 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:157— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:157-179 | libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs:156-178 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 236 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
X18 · Disposal-pattern correctness· Owned disposable field is never released · ×5
Owned disposable field is never released libs/cluster/Server/Replication/ReplicationManager.cs:28— `ReplicationManager` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `resetHandler` itself (line 28), which makes that instance its own. But `resetHandler` is named in none of the methods the disposal search covered: `Dispose` (line 489) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`resetHandler?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree.
Owned disposable field is never released libs/cluster/Session/RangeIndexMigrationReceiveSession.cs:25— `RangeIndexMigrationReceiveState` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `currentDeserializer` itself (line 25), which makes that instance its own. But `currentDeserializer` is named in none of the methods the disposal search covered: `Dispose` (line 134), `DisposeInternal` (line 145) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`currentDeserializer?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree.
Owned disposable field is never released libs/common/Networking/GarnetTcpNetworkSender.cs:29— `GarnetTcpNetworkSender` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `responseObject` itself (line 29), which makes that instance its own. But `responseObject` is named in none of the methods the disposal search covered: `Dispose` (line 282), `DisposeNetworkSender` (line 285) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`responseObject?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree.
Owned disposable field is never released libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:242— `NativeStorageDevice` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `shardIndex` itself (line 242), which makes that instance its own. But `shardIndex` is named in none of the methods the disposal search covered: `Dispose` (line 1924), `NativeDevice_Destroy` (line 762), `NativeDevice_WakeCompletionWorker` (line 792), `GetNativeLastError` (line 817), `TotalInFlight` (line 937), `TotalLeases` (line 971) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`shardIndex?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree.
Owned disposable field is never released libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/DeviceLogCommitCheckpointManager.cs:70— `DeviceLogCommitCheckpointManager` implements `IDisposable` — so it has told every caller it holds something worth releasing — and it constructs `deleteQueue` itself (line 70), which makes that instance its own. But `deleteQueue` is named in none of the methods the disposal search covered: `Dispose` (line 149) — that is `Dispose` plus every method `Dispose` calls BY NAME, so a release reached through an interface, a delegate or a base class is not followed and is worth checking before acting. On what was read, the type's disposal releases everything except the one thing it owns. A disposable the owner never disposes is held until finalization if its type has a finalizer, and forever if it does not — which for a synchronisation primitive, a timer, a stream or a handle means the resource accumulates once per instance for the life of the process. Release it in `Dispose` (`deleteQueue?.Dispose();`), or, if it truly does not need releasing, drop `IDisposable` from the type so the claim and the behaviour agree.
X2 · Cancellation propagation· Async local function without CancellationToken · ×5
Async local function without CancellationToken: ZADD benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:621— Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
Async local function without CancellationToken: ZREM benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:631— Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
Async local function without CancellationToken: ZCARD benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:641— Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
Async local function without CancellationToken: ZADD benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:960— Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
Async local function without CancellationToken: ZREM benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:970— Neither takes a CancellationToken nor reads the one of the function it sits in, while it calls something that takes one — this work can't be stopped early once started. Take the token, or pass on the enclosing one.
LuaRunner.WriteResponse::TryWriteSingleItem (cognitive 247) libs/server/Lua/LuaRunner.cs:1669— LuaRunner.WriteResponse::TryWriteSingleItem has cognitive complexity 247 (threshold 15). Drivers by points: if/else 46 (239 pts), ternaries 1 (6 pts), boolean chains 2 (nesting depth added 198). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function. This shape REPEATS in the file: 3 other methods here (LuaRunner.WriteResponse::TryWriteString, LuaRunner.WriteResponse::TryWriteMap, LuaRunner.WriteResponse::TryWriteMapToArray) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
LuaRunner.WriteResponse::TryWriteString (cognitive 17) libs/server/Lua/LuaRunner.cs:2042— LuaRunner.WriteResponse::TryWriteString has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (12 pts), loops 3, ternaries 1 (2 pts) (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (LuaRunner.WriteResponse::TryWriteSingleItem, LuaRunner.WriteResponse::TryWriteMap, LuaRunner.WriteResponse::TryWriteMapToArray) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
LuaRunner.WriteResponse::TryWriteMap (cognitive 17) libs/server/Lua/LuaRunner.cs:2192— LuaRunner.WriteResponse::TryWriteMap has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (LuaRunner.WriteResponse::TryWriteSingleItem, LuaRunner.WriteResponse::TryWriteString, LuaRunner.WriteResponse::TryWriteMapToArray) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
LuaRunner.WriteResponse::TryWriteMapToArray (cognitive 17) libs/server/Lua/LuaRunner.cs:2277— LuaRunner.WriteResponse::TryWriteMapToArray has cognitive complexity 17 (threshold 15). Drivers by points: if/else 7 (14 pts), loops 3 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 3 other methods here (LuaRunner.WriteResponse::TryWriteSingleItem, LuaRunner.WriteResponse::TryWriteString, LuaRunner.WriteResponse::TryWriteMap) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 4 times rather than 4 independent problems. Splitting this body alone leaves the other 3 exactly as they are. Where these are variations on one operation, the change that clears all 4 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
D4 · Code Duplication· Members sharing a duplicated core (6 members, 50+ identical tokens) · ×4
Members sharing a duplicated core (6 members, 50+ identical tokens) libs/client/LightEpoch.cs:363— libs/client/LightEpoch.cs:363-409 | libs/client/LightEpoch.cs:473-497 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:406-452 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:506-530 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:397-443 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:497-521 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) libs/server/Lua/LuaRunner.Functions.cs:2514— libs/server/Lua/LuaRunner.Functions.cs:2514-2547 | libs/server/Lua/LuaRunner.Functions.cs:2550-2584 | libs/server/Lua/LuaRunner.Functions.cs:2587-2629 | libs/server/Lua/LuaRunner.Functions.cs:2632-2676 | libs/server/Lua/LuaRunner.Functions.cs:2679-2723 | libs/server/Lua/LuaRunner.Functions.cs:2726-2778 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) libs/server/Resp/Objects/HashCommands.cs:584— libs/server/Resp/Objects/HashCommands.cs:584-671 | libs/server/Resp/Objects/HashCommands.cs:683-758 | libs/server/Resp/Objects/HashCommands.cs:762-817 | libs/server/Resp/Objects/SortedSetCommands.cs:1743-1829 | libs/server/Resp/Objects/SortedSetCommands.cs:1845-1919 | libs/server/Resp/Objects/SortedSetCommands.cs:1931-1985 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Members sharing a duplicated core (6 members, 50+ identical tokens) libs/server/Storage/Session/MainStore/RangeIndexOps.cs:275— libs/server/Storage/Session/MainStore/RangeIndexOps.cs:275-397 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:414-450 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:468-502 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:520-554 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:603-639 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:655-687 — These 6 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 6 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 6 times.
Duplicated block (19 lines × 3) libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:148— libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:148-166 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:215-233 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:304-322 — 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 (19 lines × 3) libs/client/LightEpoch.cs:168— libs/client/LightEpoch.cs:168-186 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:205-223 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:195-213 — before extracting anything, compare `libs/client/LightEpoch.cs` and `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 184 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (19 lines × 3) libs/cluster/Session/RespClusterSlotManagementCommands.cs:64— libs/cluster/Session/RespClusterSlotManagementCommands.cs:64-82 | libs/cluster/Session/RespClusterSlotManagementCommands.cs:231-249 | libs/cluster/Session/RespClusterSlotManagementCommands.cs:305-323 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 3) libs/client/ClientSession/GarnetClientSession.cs:268— libs/client/ClientSession/GarnetClientSession.cs:268-286 | libs/client/GarnetClient.cs:341-359 | libs/common/LightClient.cs:134-152 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/ClientSession/GarnetClientSession.cs:268` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16–17 lines × 2) libs/cluster/Session/ClusterSession.cs:139— libs/cluster/Session/ClusterSession.cs:139-154 | libs/server/Resp/RespServerSession.cs:1433-1449 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice.
Duplicated block (16–17 lines × 2) libs/server/Resp/ACLCommands.cs:324— libs/server/Resp/ACLCommands.cs:324-340 | libs/server/Resp/ACLCommands.cs:364-379 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/ACLCommands.cs:324` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16–17 lines × 2) libs/server/Storage/Session/ObjectStore/SetOps.cs:63— libs/server/Storage/Session/ObjectStore/SetOps.cs:63-79 | libs/server/Storage/Session/ObjectStore/SetOps.cs:127-142 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SetOps.cs:63` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (16–17 lines × 2) modules/GarnetJSON/JSONPath/ScanArrayMultipleIndexFilter.cs:40— modules/GarnetJSON/JSONPath/ScanArrayMultipleIndexFilter.cs:40-55 | modules/GarnetJSON/JSONPath/ScanArrayMultipleIndexFilter.cs:78-94 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) libs/cluster/Session/MigrateCommand.cs:361— libs/cluster/Session/MigrateCommand.cs:361-374 | libs/cluster/Session/RespClusterReplicationCommands.cs:278-292 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (14–15 lines × 2) libs/server/Custom/CustomRespCommands.cs:130— libs/server/Custom/CustomRespCommands.cs:130-143 | libs/server/Custom/CustomRespCommands.cs:207-221 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (14–15 lines × 2) libs/server/Lua/LuaRunner.Functions.cs:70— libs/server/Lua/LuaRunner.Functions.cs:70-83 | libs/server/Lua/LuaRunner.Functions.cs:189-203 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (14–15 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:56— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:56-70 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:54-67 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:56` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7 lines × 3) libs/common/Synchronization/ReadOptimizedLock.cs:373— libs/common/Synchronization/ReadOptimizedLock.cs:373-379 | libs/common/Synchronization/ReadOptimizedLock.cs:427-433 | libs/common/Synchronization/ReadOptimizedLock.cs:610-616 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/common/Synchronization/ReadOptimizedLock.cs:373` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/common/Synchronization/ReadOptimizedLock.cs:435` calls `SkipInit` and `libs/common/Synchronization/ReadOptimizedLock.cs:619` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (7 lines × 3) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Tsavorite.cs:586— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Tsavorite.cs:586-592 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Tsavorite.cs:652-658 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Tsavorite.cs:678-684 — 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/server/Resp/Bitmap/BitmapManagerBitCount.cs:374— libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:374-380 | playground/Bitmap/BitCount.cs:285-291 | playground/Bitmap/BitCount.cs:430-436 — before extracting anything, compare `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs` and `playground/Bitmap/BitCount.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (7 lines × 3) libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:559— libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:559-565 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:620-626 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:674-681 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:559` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `desiredValue` to `ReadOnlySpan<byte>` in one and `IHeapObject` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Low cohesion: DiskANNService (LCOM4 18) libs/server/Resp/Vector/DiskANNService.cs:12— DiskANNService's methods fall into 18 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 18 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: GarnetServerOptions (LCOM4 7) libs/server/Servers/GarnetServerOptions.cs:19— GarnetServerOptions'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: RangeIndexManager (LCOM4 4) libs/server/Resp/RangeIndex/RangeIndexManager.cs:47— RangeIndexManager's methods fall into 4 groups that share no field and call none of each other, against a bar of more than 3 for this run (LCOM4, configurable — your repository's bar is the one quoted here). Each group is a set of methods reachable from one another through shared fields or direct calls, so 4 groups means the type has that many internally-connected clusters with nothing tying them together. Types whose shape makes a high count expected — and which would otherwise dominate this list — are excluded before this row is raised, so this is a genuine split candidate rather than a metric reading. It is still a shape, not a defect: confirm the groups match responsibilities you can name before splitting.
Low cohesion: StorageSession (LCOM4 4) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:15— StorageSession'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.
Skeleton type — most members are unfinished benchmark/BDN.benchmark/Embedded/EmbeddedNetworkHandler.cs:13— `EmbeddedNetworkHandler` has 3 unfinished members out of 6 declared members (methods, properties, indexers and events, whether or not each carries a body) — a scaffolded type that was never implemented.
Skeleton type — most members are unfinished libs/host/Configuration/ConfigProviders.cs:227— `RedisConfigProvider` has 4 unfinished members out of 7 declared members (methods, properties, indexers and events, whether or not each carries a body) — a scaffolded type that was never implemented.
Skeleton type — most members are unfinished libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:543— `SimpleAsyncResult` has 4 unfinished members out of 4 declared members (methods, properties, indexers and events, whether or not each carries a body) — a scaffolded type that was never implemented.
Skeleton type — most members are unfinished modules/NoOpModule/NoOpCommandRead.cs:13— `NoOpCommandRead` has 5 unfinished members out of 6 declared members (methods, properties, indexers and events, whether or not each carries a body) — a scaffolded type that was never implemented.
D4 · Code Duplication· Members sharing a duplicated core (8 members, 50+ identical tokens) · ×3
Members sharing a duplicated core (8 members, 50+ identical tokens) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:132— libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:132-177 | libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:187-319 | libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:329-471 | playground/Bitmap/BitCount.cs:25-52 | playground/Bitmap/BitCount.cs:55-102 | playground/Bitmap/BitCount.cs:105-237 | playground/Bitmap/BitCount.cs:240-382 | playground/Bitmap/BitCount.cs:385-527 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) libs/server/Storage/Session/ObjectStore/SetOps.cs:341— libs/server/Storage/Session/ObjectStore/SetOps.cs:341-371 | libs/server/Storage/Session/ObjectStore/SetOps.cs:514-544 | libs/server/Storage/Session/ObjectStore/SetOps.cs:782-812 | libs/server/Storage/Session/ObjectStore/SetOps.cs:939-976 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:534-573 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1084-1124 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1314-1363 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1447-1489 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Members sharing a duplicated core (8 members, 50+ identical tokens) libs/server/Storage/Session/ObjectStore/SetOps.cs:382— libs/server/Storage/Session/ObjectStore/SetOps.cs:382-439 | libs/server/Storage/Session/ObjectStore/SetOps.cs:555-610 | libs/server/Storage/Session/ObjectStore/SetOps.cs:823-877 | libs/server/Storage/Session/ObjectStore/SortedSetGeoOps.cs:120-232 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:583-638 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:715-847 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1127-1183 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1385-1441 — These 8 members share a duplicated core: a run of at least 50 identical tokens appears in every one of them. That run is NOT broken out as duplicated-block rows below — it is what admitted this row, and the blocks below cover only the part of it that clears the block floor, so they understate the correspondence. Read the members as one construct written 8 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 8 times.
Duplicated block (46 lines × 2) libs/client/LightEpoch.cs:558— libs/client/LightEpoch.cs:558-603 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:582-627 — before extracting anything, compare `libs/client/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 326 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (46 lines × 2) libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:407— libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:407-452 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:398-443 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 364 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (46 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/StoreFunctions/IRecordTriggers.cs:199— libs/storage/Tsavorite/cs/src/core/Index/StoreFunctions/IRecordTriggers.cs:199-244 | libs/storage/Tsavorite/cs/src/core/Index/StoreFunctions/IRecordTriggers.cs:271-316 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (36 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:95— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:95-130 | libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs:94-129 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 236 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (36 lines × 2) playground/Bitmap/BitCount.cs:285— playground/Bitmap/BitCount.cs:285-320 | playground/Bitmap/BitCount.cs:430-465 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitCount.cs:285` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (36 lines × 2) libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:903— libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:903-938 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:856-891 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 19 separate duplicated blocks between them, totalling at least 364 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:903` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (29 lines × 2) libs/client/ClientSession/GarnetClientSession.cs:268— libs/client/ClientSession/GarnetClientSession.cs:268-296 | libs/client/GarnetClient.cs:341-369 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (29 lines × 2) libs/client/ClientSession/GarnetClientSession.cs:301— libs/client/ClientSession/GarnetClientSession.cs:301-329 | libs/client/GarnetClient.cs:374-402 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (29 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:311— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:311-339 | libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs:308-336 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 236 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (26–27 lines × 2) libs/server/Lua/LuaRunner.Functions.cs:2042— libs/server/Lua/LuaRunner.Functions.cs:2042-2067 | libs/server/Lua/LuaRunner.Functions.cs:2102-2128 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (26–27 lines × 2) libs/server/Resp/Objects/HashCommands.cs:272— libs/server/Resp/Objects/HashCommands.cs:272-298 | libs/server/Resp/Objects/SortedSetCommands.cs:874-899 — before extracting anything, compare `libs/server/Resp/Objects/HashCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 196 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/HashCommands.cs:272` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (26–27 lines × 2) libs/server/Resp/Objects/ListCommands.cs:906— libs/server/Resp/Objects/ListCommands.cs:906-931 | libs/server/Resp/Objects/SortedSetCommands.cs:1688-1714 — before extracting anything, compare `libs/server/Resp/Objects/ListCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (23–24 lines × 2) libs/common/RespReadUtils.cs:782— libs/common/RespReadUtils.cs:782-804 | libs/common/RespReadUtils.cs:889-912 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/common/RespReadUtils.cs:889` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `ptr` to `scoped ref byte*` in one and `ref byte*` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (23–24 lines × 2) libs/server/Resp/Bitmap/BitmapCommands.cs:445— libs/server/Resp/Bitmap/BitmapCommands.cs:445-467 | libs/server/Resp/Bitmap/BitmapCommands.cs:535-558 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Bitmap/BitmapCommands.cs:445` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/server/Resp/Bitmap/BitmapCommands.cs:470` calls `EqualsUpperCaseSpanIgnoringCase` and `libs/server/Resp/Bitmap/BitmapCommands.cs:560` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (23–24 lines × 2) libs/server/Resp/Objects/SortedSetCommands.cs:1078— libs/server/Resp/Objects/SortedSetCommands.cs:1078-1101 | libs/server/Resp/Objects/SortedSetCommands.cs:1369-1391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/SortedSetCommands.cs:1078` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Resp/Objects/SortedSetCommands.cs:1078` calls `Slice` and `libs/server/Resp/Objects/SortedSetCommands.cs:1369` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20 lines × 3) libs/client/Utility.cs:87— libs/client/Utility.cs:87-106 | libs/server/Servers/ServerOptions.cs:283-302 | libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs:127-146 — before extracting anything, compare `libs/client/Utility.cs` and `libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 90 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (20 lines × 3) libs/server/Storage/Session/ObjectStore/SetOps.cs:344— libs/server/Storage/Session/ObjectStore/SetOps.cs:344-363 | libs/server/Storage/Session/ObjectStore/SetOps.cs:517-536 | libs/server/Storage/Session/ObjectStore/SetOps.cs:785-804 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SetOps.cs:344` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20 lines × 3) libs/client/LightEpoch.cs:231— libs/client/LightEpoch.cs:231-250 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:268-287 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:258-277 — before extracting anything, compare `libs/client/LightEpoch.cs` and `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 184 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:293` calls `MethodImpl` and `libs/client/LightEpoch.cs:256` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20 lines × 4) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1690— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1690-1709 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1768-1787 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1809-1828 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1850-1869 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (20 lines × 4) libs/server/Lua/LuaRunner.cs:2221— libs/server/Lua/LuaRunner.cs:2221-2240 | libs/server/Lua/LuaRunner.cs:2308-2327 | libs/server/Lua/LuaRunner.cs:2390-2409 | libs/server/Lua/LuaRunner.cs:2468-2487 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.cs:2221` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/server/Lua/LuaRunner.cs:2409` calls `Pop` and `libs/server/Lua/LuaRunner.cs:2240` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20 lines × 4) libs/server/Resp/Objects/SortedSetCommands.cs:1090— libs/server/Resp/Objects/SortedSetCommands.cs:1090-1109 | libs/server/Resp/Objects/SortedSetCommands.cs:1281-1300 | libs/server/Resp/Objects/SortedSetCommands.cs:1380-1399 | libs/server/Resp/Objects/SortedSetCommands.cs:1503-1522 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/SortedSetCommands.cs:1090` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (14 lines × 4) libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:98— libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:98-111 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:328-341 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:428-441 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:477-490 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:98` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (14 lines × 4) libs/server/Resp/Objects/SortedSetCommands.cs:1027— libs/server/Resp/Objects/SortedSetCommands.cs:1027-1040 | libs/server/Resp/Objects/SortedSetCommands.cs:1221-1234 | libs/server/Resp/Objects/SortedSetCommands.cs:1321-1334 | libs/server/Resp/Objects/SortedSetCommands.cs:1546-1559 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/SortedSetCommands.cs:1027` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 4) libs/server/Resp/Objects/SetCommands.cs:137— libs/server/Resp/Objects/SetCommands.cs:137-150 | libs/server/Resp/Objects/SetCommands.cs:208-221 | libs/server/Resp/Objects/SetCommands.cs:292-305 | libs/server/Resp/Objects/SetCommands.cs:761-774 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/SetCommands.cs:137` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15–16 lines × 2) libs/server/Storage/Session/MainStore/HyperLogLogOps.cs:104— libs/server/Storage/Session/MainStore/HyperLogLogOps.cs:104-119 | libs/server/Storage/Session/MainStore/HyperLogLogOps.cs:205-219 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/HyperLogLogOps.cs:104` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (15–16 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ScanIteratorBase.cs:173— libs/storage/Tsavorite/cs/src/core/Allocator/ScanIteratorBase.cs:173-187 | libs/storage/Tsavorite/cs/src/core/Allocator/ScanIteratorBase.cs:287-302 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Allocator/ScanIteratorBase.cs:173` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15–16 lines × 2) modules/GarnetJSON/JSONPath/ArrayIndexFilter.cs:71— modules/GarnetJSON/JSONPath/ArrayIndexFilter.cs:71-85 | modules/GarnetJSON/JSONPath/FieldFilter.cs:84-99 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (13–15 lines × 2) libs/server/Storage/Session/ObjectStore/SortedSetGeoOps.cs:121— libs/server/Storage/Session/ObjectStore/SortedSetGeoOps.cs:121-133 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:727-741 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/server/Storage/Session/ObjectStore/SortedSetGeoOps.cs:135` calls `RespMemoryWriter` and `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:743` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–15 lines × 2) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:659— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:659-671 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:951-965 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:659` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–15 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ScanIteratorBase.cs:140— libs/storage/Tsavorite/cs/src/core/Allocator/ScanIteratorBase.cs:140-152 | libs/storage/Tsavorite/cs/src/core/Allocator/ScanIteratorBase.cs:575-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Allocator/ScanIteratorBase.cs:575` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12 lines × 3) libs/server/Lua/LuaRunner.Functions.cs:2529— libs/server/Lua/LuaRunner.Functions.cs:2529-2540 | libs/server/Lua/LuaRunner.Functions.cs:2566-2577 | libs/server/Lua/LuaRunner.Functions.cs:2611-2622 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.cs:2529` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (12 lines × 3) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1156— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1156-1167 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1326-1337 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1365-1376 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1156` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1378` calls `SerializeTo`, `TotalSize` and `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1339` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12 lines × 3) libs/server/Storage/Session/MainStore/MainStoreOps.cs:263— libs/server/Storage/Session/MainStore/MainStoreOps.cs:263-275 | libs/server/Storage/Session/MainStore/MainStoreOps.cs:323-335 | libs/server/Storage/Session/MainStore/MainStoreOps.cs:461-472 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Storage/Session/MainStore/MainStoreOps.cs:261` calls `FromPinnedPointer` and `libs/server/Storage/Session/MainStore/MainStoreOps.cs:322` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–14 lines × 2) libs/common/ClientBase.cs:89— libs/common/ClientBase.cs:89-101 | libs/common/LightClient.cs:280-293 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–14 lines × 2) libs/server/Storage/Session/MainStore/MainStoreOps.cs:322— libs/server/Storage/Session/MainStore/MainStoreOps.cs:322-335 | libs/server/Storage/Session/MainStore/MainStoreOps.cs:460-472 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/MainStoreOps.cs:322` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–14 lines × 2) libs/server/Storage/Session/ObjectStore/HashOps.cs:218— libs/server/Storage/Session/ObjectStore/HashOps.cs:218-231 | libs/server/Storage/Session/ObjectStore/HashOps.cs:250-262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 3) libs/client/ClientSession/GarnetClientSession.cs:303— libs/client/ClientSession/GarnetClientSession.cs:303-311 | libs/client/GarnetClient.cs:376-384 | libs/common/LightClient.cs:169-177 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 3 call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made 3 times. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/ClientSession/GarnetClientSession.cs:303` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 3) playground/Bitmap/BitCount.cs:168— playground/Bitmap/BitCount.cs:168-176 | playground/Bitmap/BitCount.cs:309-317 | playground/Bitmap/BitCount.cs:454-462 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitCount.cs:168` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (9 lines × 3) libs/client/LightEpoch.cs:367— libs/client/LightEpoch.cs:367-375 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:410-418 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:401-409 — before extracting anything, compare `libs/client/LightEpoch.cs` and `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 184 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/LightEpoch.cs:367` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (12–13 lines × 2) libs/cluster/Server/ClusterManagerSlotState.cs:107— libs/cluster/Server/ClusterManagerSlotState.cs:107-118 | libs/cluster/Server/ClusterManagerSlotState.cs:178-190 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/cluster/Server/ClusterManagerSlotState.cs:175` calls `foreach` and `libs/cluster/Server/ClusterManagerSlotState.cs:105` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (12–13 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:665— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:665-676 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:363-375 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:665` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (12–13 lines × 2) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1410— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1410-1421 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1644-1656 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1410` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 3) libs/client/LightEpoch.cs:478— libs/client/LightEpoch.cs:478-487 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:511-520 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:502-511 — before extracting anything, compare `libs/client/LightEpoch.cs` and `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 184 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/LightEpoch.cs:478` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10 lines × 3) libs/server/Resp/KeyAdminCommands.cs:427— libs/server/Resp/KeyAdminCommands.cs:427-436 | libs/server/Resp/Objects/HashCommands.cs:631-640 | libs/server/Resp/Objects/SortedSetCommands.cs:1790-1799 — before extracting anything, compare `libs/server/Resp/Objects/HashCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 196 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/KeyAdminCommands.cs:427` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (10 lines × 3) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:411— libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:411-420 | playground/Bitmap/BitCount.cs:322-331 | playground/Bitmap/BitCount.cs:467-476 — before extracting anything, compare `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs` and `playground/Bitmap/BitCount.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:411` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (11–12 lines × 2) libs/common/RespWriteUtils.cs:176— libs/common/RespWriteUtils.cs:176-187 | libs/common/RespWriteUtils.cs:229-239 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–12 lines × 2) libs/server/Resp/AdminCommands.cs:906— libs/server/Resp/AdminCommands.cs:906-916 | libs/server/Resp/AdminCommands.cs:940-951 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/AdminCommands.cs:906` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 2) libs/server/Storage/Session/MainStore/VectorStoreOps.cs:446— libs/server/Storage/Session/MainStore/VectorStoreOps.cs:446-457 | libs/server/Storage/Session/MainStore/VectorStoreOps.cs:473-483 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/VectorStoreOps.cs:446` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (5 lines × 6) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1128— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1128-1132 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1163-1167 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1233-1237 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1299-1303 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1333-1337 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1372-1376 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1168` calls `TotalSize`, `SerializeTo` and `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1133` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 6) libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:126— libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:126-130 | libs/storage/Tsavorite/cs/src/core/ClientSession/ConsistentReadContext.cs:77-81 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalConsistentReadContext.cs:148-152 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:433-437 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs:221-225 | libs/storage/Tsavorite/cs/src/core/ClientSession/UnsafeContext.cs:113-117 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs` and `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 6) libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:135— libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:135-139 | libs/storage/Tsavorite/cs/src/core/ClientSession/ConsistentReadContext.cs:86-90 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalConsistentReadContext.cs:157-161 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:442-446 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs:230-234 | libs/storage/Tsavorite/cs/src/core/ClientSession/UnsafeContext.cs:122-126 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs` and `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (5 lines × 4) libs/server/Resp/HyperLogLog/HyperLogLog.cs:879— libs/server/Resp/HyperLogLog/HyperLogLog.cs:879-883 | libs/server/Resp/HyperLogLog/HyperLogLog.cs:884-888 | libs/server/Resp/HyperLogLog/HyperLogLog.cs:889-893 | libs/server/Resp/HyperLogLog/HyperLogLog.cs:894-898 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (5 lines × 4) libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:316— libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:316-320 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:646-650 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs:369-373 | libs/storage/Tsavorite/cs/src/core/ClientSession/UnsafeContext.cs:261-265 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs` and `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (5 lines × 4) libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:327— libs/storage/Tsavorite/cs/src/core/ClientSession/BasicContext.cs:327-331 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:657-661 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs:380-384 | libs/storage/Tsavorite/cs/src/core/ClientSession/UnsafeContext.cs:272-276 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs` and `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalUnsafeContext.cs` as WHOLE FILES: this scan already matched 9 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (4–5 lines × 4) libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:180— libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:180-183 | libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:185-189 | libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:193-197 | libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:200-204 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–5 lines × 4) libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:233— libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:233-236 | libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:238-242 | libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:246-250 | libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:253-257 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (4–5 lines × 4) libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:286— libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:286-289 | libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:291-295 | libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:299-303 | libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:306-310 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
IC1 · Incompleteness & stubs· Bound check compiled out of the shipping build · ×3
Bound check compiled out of the shipping build libs/server/AOF/GarnetLog.cs:461— The only thing establishing that `beginAddress` is long enough before it is indexed is a `Debug.Assert`, which is `[Conditional("DEBUG")]` — the compiler deletes the call from Release, so the build your users install indexes `beginAddress` with no length check at all and throws at the indexer instead of failing diagnosably. `beginAddress` comes from outside this method, so its length is a contract, not something this code can see. Bound it with a check that ships (`if (beginAddress.Count < n) throw …`, or `ArgumentOutOfRangeException.ThrowIfLessThan`), and keep the assert for the invariant you believe holds.
Bound check compiled out of the shipping build libs/server/Metrics/Info/GarnetInfoMetrics.cs:493— The only thing establishing that `info` is long enough before it is indexed is a `Debug.Assert`, which is `[Conditional("DEBUG")]` — the compiler deletes the call from Release, so the build your users install indexes `info` with no length check at all and throws at the indexer instead of failing diagnosably. `info` comes from outside this method, so its length is a contract, not something this code can see. Bound it with a check that ships (`if (info.Count < n) throw …`, or `ArgumentOutOfRangeException.ThrowIfLessThan`), and keep the assert for the invariant you believe holds.
Bound check compiled out of the shipping build libs/server/Resp/AdminCommands.cs:607— The only thing establishing that `assembliesList` is long enough before it is indexed is a `Debug.Assert`, which is `[Conditional("DEBUG")]` — the compiler deletes the call from Release, so the build your users install indexes `assembliesList` with no length check at all and throws at the indexer instead of failing diagnosably. `assembliesList` comes from outside this method, so its length is a contract, not something this code can see. Bound it with a check that ships (`if (assembliesList.Count < n) throw …`, or `ArgumentOutOfRangeException.ThrowIfLessThan`), and keep the assert for the invariant you believe holds.
async void method: OpRunnerGarnetClientSession benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:557— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
async void method: OpRunnerGarnetClientSessionParallel benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:660— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
async void method: OpRunnerGarnetClient benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:858— `async void` can't be awaited and its exceptions crash the process instead of propagating. Return `Task` — or, where the delegate contract requires void (timer/event/callback registrations), make this a thin void shim that awaits a Task-returning inner method inside try/catch so exceptions are contained.
X15 · Unvalidated length from an untrusted reader· Length read from the parsed input is spent without ever being bounded · ×3
Length read from the parsed input is spent without ever being bounded libs/cluster/Server/ClusterConfigSerializer.cs:185— `numWorkers` is read from the stream being parsed at line 184 (`ReadInt32`), then used to size an array at line 185 — and nowhere in this method is `numWorkers` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). A file the caller did not write therefore chooses the size directly: a value near `int.MaxValue` allocates until the process dies, and a value that overflows the cast to `int` goes negative and throws out of a parser whose failure path was written for malformed input, not for hostile input. Bound `numWorkers` against the bytes actually remaining in the stream before spending it.
Length read from the parsed input is spent without ever being bounded libs/server/Objects/Hash/HashObject.cs:112— `keyLength` is read from the stream being parsed at line 109 (`ReadInt32`), then read in bulk from that same stream at line 112 — and nowhere in this method is `keyLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). A file the caller did not write therefore chooses the size directly: a value near `int.MaxValue` allocates until the process dies, and a value that overflows the cast to `int` goes negative and throws out of a parser whose failure path was written for malformed input, not for hostile input. Bound `keyLength` against the bytes actually remaining in the stream before spending it.
Length read from the parsed input is spent without ever being bounded libs/server/Objects/SortedSet/SortedSetObject.cs:191— `keyLength` is read from the stream being parsed at line 188 (`ReadInt32`), then read in bulk from that same stream at line 191 — and nowhere in this method is `keyLength` bounded from above — compared to a limit, clamped, or checked against the input that remains (a zero or sign test, or the loop that counts up to it, bounds nothing). A file the caller did not write therefore chooses the size directly: a value near `int.MaxValue` allocates until the process dies, and a value that overflows the cast to `int` goes negative and throws out of a parser whose failure path was written for malformed input, not for hostile input. Bound `keyLength` against the bytes actually remaining in the stream before spending it.
Swallowed exception (caught, then discarded) libs/server/Databases/MultiDatabaseManager.cs:370— `catch (Exception)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
Swallowed exception (caught, then discarded) libs/server/Databases/MultiDatabaseManager.cs:546— `catch (Exception)` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
Swallowed exception (caught, then discarded) libs/server/Lua/LuaRunner.cs:361— `catch` does nothing with the exception it caught — the body neither logs it, rethrows it, nor even names it, so the failure is discarded as completely as by an empty catch. Log it through whatever this codebase already uses to report problems, or let it propagate; if one specific failure genuinely cannot matter, catch exactly that exception type and say why in a comment on the catch.
RespServerSession.NetworkVSIM::WriteRESP2Result (cyclomatic 24) libs/server/Resp/Vector/RespServerSessionVectors.cs:1411— RespServerSession.NetworkVSIM::WriteRESP2Result 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. This shape REPEATS in the file: 2 other methods here (RespServerSession.NetworkVSIM, RespServerSession.NetworkVSIM::WriteRESP3Result) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespServerSession.NetworkVSIM::WriteRESP3Result (cyclomatic 23) libs/server/Resp/Vector/RespServerSessionVectors.cs:1271— RespServerSession.NetworkVSIM::WriteRESP3Result has cyclomatic complexity 23 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (RespServerSession.NetworkVSIM, RespServerSession.NetworkVSIM::WriteRESP2Result) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
NumUtils.CountDigits (cyclomatic 21) libs/common/NumUtils.cs:333— NumUtils.CountDigits 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.
NumUtils.CountDigits (cyclomatic 21) libs/common/NumUtils.cs:425— NumUtils.CountDigits has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RespServerSession.NetworkVSIM::WriteRESP2Result (cognitive 46) libs/server/Resp/Vector/RespServerSessionVectors.cs:1411— RespServerSession.NetworkVSIM::WriteRESP2Result has cognitive complexity 46 (threshold 15). Drivers by points: if/else 18 (35 pts), loops 4 (7 pts), boolean chains 2, ternaries 2 (nesting depth added 20). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (RespServerSession.NetworkVSIM, RespServerSession.NetworkVSIM::WriteRESP3Result) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespServerSession.NetworkVSIM::WriteRESP3Result (cognitive 45) libs/server/Resp/Vector/RespServerSessionVectors.cs:1271— RespServerSession.NetworkVSIM::WriteRESP3Result has cognitive complexity 45 (threshold 15). Drivers by points: if/else 18 (36 pts), boolean chains 4, loops 2 (3 pts), ternaries 2 (nesting depth added 19). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (RespServerSession.NetworkVSIM, RespServerSession.NetworkVSIM::WriteRESP2Result) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
VectorManager.StartQuantizationAndImportTasks::QuantizationTaskAsync (cognitive 19) libs/server/Resp/Vector/VectorManager.Quantization.cs:106— VectorManager.StartQuantizationAndImportTasks::QuantizationTaskAsync has cognitive complexity 19 (threshold 15). Drivers by points: if/else 4 (12 pts), loops 3 (6 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. This shape REPEATS in the file: one other method here (VectorManager.StartQuantizationAndImportTasks::TryProcessQuantizationOrImportRequest) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
VectorManager.StartQuantizationAndImportTasks::TryProcessQuantizationOrImportRequest (cognitive 17) libs/server/Resp/Vector/VectorManager.Quantization.cs:156— VectorManager.StartQuantizationAndImportTasks::TryProcessQuantizationOrImportRequest has cognitive complexity 17 (threshold 15). Drivers by points: if/else 6 (9 pts), error handling 2 (3 pts), loops 1 (3 pts), boolean chains 1, match/switch 1 (nesting depth added 6). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (VectorManager.StartQuantizationAndImportTasks::QuantizationTaskAsync) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
LightEpoch.ToString (cognitive 17) libs/client/LightEpoch.cs:675— LightEpoch.ToString has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LightEpoch.ToString (cognitive 17) libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:746— LightEpoch.ToString has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LightEpoch.BumpCurrentEpoch (cognitive 16) libs/client/LightEpoch.cs:362— LightEpoch.BumpCurrentEpoch has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LightEpoch.BumpCurrentEpoch (cognitive 16) libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:405— LightEpoch.BumpCurrentEpoch has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Duplicated block (32 lines × 3) modules/GarnetJSON/JSONPath/ArraySliceFilter.cs:50— modules/GarnetJSON/JSONPath/ArraySliceFilter.cs:50-81 | modules/GarnetJSON/JSONPath/ScanArraySliceFilter.cs:52-83 | modules/GarnetJSON/JSONPath/ScanArraySliceFilter.cs:117-148 — before extracting anything, compare `modules/GarnetJSON/JSONPath/ArraySliceFilter.cs` and `modules/GarnetJSON/JSONPath/ScanArraySliceFilter.cs` as WHOLE FILES: 85% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (32 lines × 3) libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:182— libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:182-213 | libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:99-130 | libs/storage/Tsavorite/cs/src/core/Device/RandomAccessLocalStorageDevice.cs:177-208 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from all 3 call sites, so a change lands once. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/storage/Tsavorite/cs/src/core/Device/ManagedLocalStorageDevice.cs:95` calls `Throttle` and `libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:178` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (25 lines × 2) libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:368— libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:368-392 | libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:433-457 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:368` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25 lines × 2) libs/server/Storage/Functions/MainStore/RMWMethods.cs:1265— libs/server/Storage/Functions/MainStore/RMWMethods.cs:1265-1289 | libs/server/Storage/Functions/MainStore/RMWMethods.cs:1306-1330 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Functions/MainStore/RMWMethods.cs:1265` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24–25 lines × 2) libs/server/Storage/Session/MainStore/RangeIndexOps.cs:320— libs/server/Storage/Session/MainStore/RangeIndexOps.cs:320-343 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:367-391 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/RangeIndexOps.cs:320` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (24–25 lines × 2) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:252— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:252-275 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:348-372 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:252` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `entry` to `out byte[]` in one and `out IMemoryOwner<byte>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (22 lines × 3) libs/server/Storage/Session/MainStore/MainStoreOps.cs:21— libs/server/Storage/Session/MainStore/MainStoreOps.cs:21-42 | libs/server/Storage/Session/MainStore/MainStoreOps.cs:160-181 | libs/server/Storage/Session/MainStore/MainStoreOps.cs:219-240 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/MainStoreOps.cs:21` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (22 lines × 3) libs/client/LightEpoch.cs:377— libs/client/LightEpoch.cs:377-398 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:420-441 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:411-432 — before extracting anything, compare `libs/client/LightEpoch.cs` and `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 184 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/LightEpoch.cs:377` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (20–21 lines × 2) libs/client/ClientSession/GarnetClientSessionMigrationExtensions.cs:180— libs/client/ClientSession/GarnetClientSessionMigrationExtensions.cs:180-200 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:505-524 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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–21 lines × 2) playground/CommandInfoUpdater/CommandDocsUpdater.cs:211— playground/CommandInfoUpdater/CommandDocsUpdater.cs:211-230 | playground/CommandInfoUpdater/CommandInfoUpdater.cs:245-265 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `playground/CommandInfoUpdater/CommandDocsUpdater.cs:211` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 4) libs/server/Storage/Session/MainStore/MainStoreOps.cs:25— libs/server/Storage/Session/MainStore/MainStoreOps.cs:25-42 | libs/server/Storage/Session/MainStore/MainStoreOps.cs:136-153 | libs/server/Storage/Session/MainStore/MainStoreOps.cs:164-181 | libs/server/Storage/Session/MainStore/MainStoreOps.cs:223-240 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/MainStoreOps.cs:25` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (18 lines × 4) libs/server/Lua/LuaRunner.Functions.cs:388— libs/server/Lua/LuaRunner.Functions.cs:388-405 | libs/server/Lua/LuaRunner.Functions.cs:3184-3201 | libs/server/Lua/LuaRunner.Functions.cs:3202-3219 | libs/server/Lua/LuaRunner.Functions.cs:3236-3253 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.cs:388` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (14 lines × 3) libs/client/RespReadResponseUtils.cs:138— libs/client/RespReadResponseUtils.cs:138-151 | libs/common/RespReadUtils.cs:972-985 | libs/common/RespReadUtils.cs:1187-1200 — before extracting anything, compare `libs/client/RespReadResponseUtils.cs` and `libs/common/RespReadUtils.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 47 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/RespReadResponseUtils.cs:138` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (14 lines × 3) samples/GarnetClientSample/GarnetClientSamples.cs:84— samples/GarnetClientSample/GarnetClientSamples.cs:84-97 | samples/GarnetClientSample/GarnetClientSamples.cs:108-122 | samples/GarnetClientSample/GarnetClientSamples.cs:133-147 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `samples/GarnetClientSample/GarnetClientSamples.cs:84` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (17–18 lines × 5) libs/server/Resp/Objects/ListCommands.cs:282— libs/server/Resp/Objects/ListCommands.cs:282-298 | libs/server/Resp/Objects/ListCommands.cs:371-388 | libs/server/Resp/Objects/ListCommands.cs:906-922 | libs/server/Resp/Objects/SortedSetCommands.cs:1582-1598 | libs/server/Resp/Objects/SortedSetCommands.cs:1688-1704 — before extracting anything, compare `libs/server/Resp/Objects/ListCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/ListCommands.cs:371` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Resp/Objects/ListCommands.cs:278` calls `TryGetTimeout`, `AbortWithErrorMessage` and `libs/server/Resp/Objects/SortedSetCommands.cs:1579` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (17–18 lines × 5) modules/GarnetJSON/JSONPath/ScanArrayIndexFilter.cs:41— modules/GarnetJSON/JSONPath/ScanArrayIndexFilter.cs:41-58 | modules/GarnetJSON/JSONPath/ScanArrayMultipleIndexFilter.cs:51-67 | modules/GarnetJSON/JSONPath/ScanArraySliceFilter.cs:86-102 | modules/GarnetJSON/JSONPath/ScanFilter.cs:43-59 | modules/GarnetJSON/JSONPath/ScanMultipleFilter.cs:38-54 — before extracting anything, compare `modules/GarnetJSON/JSONPath/ScanFilter.cs` and `modules/GarnetJSON/JSONPath/ScanMultipleFilter.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/GarnetJSON/JSONPath/ScanArrayIndexFilter.cs:41` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `modules/GarnetJSON/JSONPath/ScanArrayMultipleIndexFilter.cs:50` calls `GetEnumerator` and `modules/GarnetJSON/JSONPath/ScanArrayIndexFilter.cs:40` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16–18 lines × 2) libs/cluster/Server/ClusterManagerSlotState.cs:232— libs/cluster/Server/ClusterManagerSlotState.cs:232-247 | libs/cluster/Server/ClusterManagerSlotState.cs:292-309 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Server/ClusterManagerSlotState.cs:232` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/cluster/Server/ClusterManagerSlotState.cs:289` calls `foreach` and `libs/cluster/Server/ClusterManagerSlotState.cs:230` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (16–18 lines × 2) libs/server/Storage/Functions/MainStore/PrivateMethods.cs:406— libs/server/Storage/Functions/MainStore/PrivateMethods.cs:406-423 | libs/server/Storage/Functions/MainStore/PrivateMethods.cs:445-460 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (16 lines × 3) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:540— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:540-555 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1090-1105 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1453-1468 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:540` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (16 lines × 3) libs/server/Storage/Session/MainStore/RangeIndexOps.cs:417— libs/server/Storage/Session/MainStore/RangeIndexOps.cs:417-432 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:473-488 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:525-540 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/RangeIndexOps.cs:417` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (15–17 lines × 2) libs/cluster/Server/ClusterManagerSlotState.cs:214— libs/cluster/Server/ClusterManagerSlotState.cs:214-228 | libs/cluster/Server/ClusterManagerSlotState.cs:268-284 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Server/ClusterManagerSlotState.cs:214` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (15–17 lines × 2) libs/server/Resp/Objects/ListCommands.cs:881— libs/server/Resp/Objects/ListCommands.cs:881-897 | libs/server/Resp/Objects/SortedSetCommands.cs:1666-1680 — before extracting anything, compare `libs/server/Resp/Objects/ListCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/ListCommands.cs:881` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) libs/server/Lua/LuaRunner.Functions.cs:1268— libs/server/Lua/LuaRunner.Functions.cs:1268-1281 | libs/server/Lua/LuaRunner.Functions.cs:1325-1338 | libs/server/Lua/LuaRunner.Functions.cs:1369-1381 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.cs:1268` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (13 lines × 3) playground/Bitmap/BitOp.cs:280— playground/Bitmap/BitOp.cs:280-292 | playground/Bitmap/BitOp.cs:448-462 | playground/Bitmap/BitOp.cs:649-661 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitOp.cs:280` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (6 lines × 4) libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:210— libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:210-215 | libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:246-251 | libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:267-272 | libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:283-288 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (6 lines × 4) playground/Bitmap/BitOp.cs:205— playground/Bitmap/BitOp.cs:205-210 | playground/Bitmap/BitOp.cs:404-409 | playground/Bitmap/BitOp.cs:574-579 | playground/Bitmap/BitOp.cs:773-778 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitOp.cs:205` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (6 lines × 3) libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:193— libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:193-198 | libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:226-231 | libs/server/Resp/Vector/VectorManager.ContextMetadata.cs:302-307 — 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/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:227— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:227-232 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:464-469 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:312-317 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:233` calls `SetTombstone` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:470` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Off the main sequence: HdrHistogram metrics/HdrHistogram/HdrHistogram.csproj:1— HdrHistogram: abstractness 0.12, instability 0.00, distance 0.88 — zone of pain — concrete and depended on by 3 project(s), so it's rigid to change.
Off the main sequence: Tsavorite.core libs/storage/Tsavorite/cs/src/core/Tsavorite.core.csproj:1— Tsavorite.core: abstractness 0.28, instability 0.00, distance 0.72 — zone of pain — concrete and depended on by 6 project(s), so it's rigid to change.
IC1 · Incompleteness & stubs· Guard cannot change the result · ×2
Guard cannot change the result — returns what the code already falls through to libs/server/Resp/Vector/AttributeExtractor.cs:88— 1 guard above `return found;` also returns `found`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
Guard cannot change the result — returns what the code already falls through to libs/server/Resp/Vector/AttributeExtractor.cs:137— 1 guard above `return default;` also returns `default`, so no input can make it matter. Implement the distinction that was intended, or delete the guard.
Sync-over-async (deadlock risk) through `.Result` benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:207— Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
Sync-over-async (deadlock risk) through `.Result` benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:221— Reading `.Result` of a task that has not completed blocks this thread until it does — the same block as `.Wait()`: under a synchronization context (Blazor, a UI thread, classic ASP.NET) it deadlocks, and on the thread pool it parks a thread for as long as the work runs. `await` the task instead (make the caller `async`); where a synchronous entry point must stay, keep the block in ONE documented bridge with a timeout.
Blocking `ManualResetEventSlim.Wait` inside an `async` method benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:580— `ManualResetEventSlim.Wait` parks the thread until another thread signals it — inside a method that is already `async`, the wait should be awaitable (a `TaskCompletionSource`, `SemaphoreSlim.WaitAsync`, or `WaitHandle` bridged with `Task.Factory.FromAsync`).
Blocking `ManualResetEventSlim.Wait` inside an `async` method benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:684— `ManualResetEventSlim.Wait` parks the thread until another thread signals it — inside a method that is already `async`, the wait should be awaitable (a `TaskCompletionSource`, `SemaphoreSlim.WaitAsync`, or `WaitHandle` bridged with `Task.Factory.FromAsync`).
X28 · Index access outside its own emptiness guard· Index access outside its own emptiness guard · ×2
Index access outside its own emptiness guard libs/server/Resp/Vector/ExprCompiler.cs:59— This condition tests `remaining` for emptiness and then indexes it on a branch that test does not reach. `remaining[0]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `remaining` being empty — so an empty `remaining` indexes position 0 of nothing and throws. This same condition already shows the intended bracketing: `remaining[1]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `remaining` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `remaining`.
Index access outside its own emptiness guard libs/server/Resp/Vector/ExprCompiler.cs:94— This condition tests `remaining` for emptiness and then indexes it on a branch that test does not reach. `remaining[0]` is evaluated whenever the guarded half is false — which includes the case the guard exists to anticipate, `remaining` being empty — so an empty `remaining` indexes position 0 of nothing and throws. This same condition already shows the intended bracketing: `remaining[1]` sits INSIDE the guard. Either the guard is load-bearing, in which case this access escapes it and crashes, or `remaining` cannot be empty here, in which case the guard beside it is dead code — the condition is wrong under both readings. Move the parenthesis so the emptiness test brackets every access to `remaining`.
C1 · Data Protection· No data-protection/encryption · ×1
No data-protection/encryption — No data-protection or encryption usage (ASP.NET Data Protection, AES, column encryption, PBKDF2) was found — sensitive data at rest may be unprotected. If TDE/KMS/vault is delegated to infrastructure, ignore.
ReqGen.WriteOp (cyclomatic 143) benchmark/Resp.benchmark/OfflineBench/ReqGenUtils.cs:22— ReqGen.WriteOp has cyclomatic complexity 143 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MainSessionFunctions.InPlaceUpdaterWorker (cyclomatic 107) libs/server/Storage/Functions/MainStore/RMWMethods.cs:460— MainSessionFunctions.InPlaceUpdaterWorker has cyclomatic complexity 107 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MainSessionFunctions.CopyUpdater (cyclomatic 88) libs/server/Storage/Functions/MainStore/RMWMethods.cs:1068— MainSessionFunctions.CopyUpdater has cyclomatic complexity 88 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RespServerSession.NetworkVADD (cyclomatic 87) libs/server/Resp/Vector/RespServerSessionVectors.cs:293— RespServerSession.NetworkVADD has cyclomatic complexity 87 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LuaRunner.ProcessSingleRespTerm (cyclomatic 86) libs/server/Lua/LuaRunner.cs:579— LuaRunner.ProcessSingleRespTerm has cyclomatic complexity 86 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RespServerSession.NetworkVSIM (cyclomatic 77) libs/server/Resp/Vector/RespServerSessionVectors.cs:804— RespServerSession.NetworkVSIM has cyclomatic complexity 77 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: 2 other methods here (RespServerSession.NetworkVSIM::WriteRESP3Result, RespServerSession.NetworkVSIM::WriteRESP2Result) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SessionParseStateExtensions.TryGetGeoSearchOptions (cyclomatic 69) libs/server/SessionParseStateExtensions.cs:264— SessionParseStateExtensions.TryGetGeoSearchOptions has cyclomatic complexity 69 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReqGen.OnResponse (cyclomatic 65) benchmark/Resp.benchmark/OfflineBench/ReqGen.cs:187— ReqGen.OnResponse has cyclomatic complexity 65 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
ClusterSession.NetworkTryMIGRATE (cyclomatic 63) libs/cluster/Session/MigrateCommand.cs:63— ClusterSession.NetworkTryMIGRATE has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TsavoriteKV.CreateNewRecordRMW (cyclomatic 63) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:379— TsavoriteKV.CreateNewRecordRMW has cyclomatic complexity 63 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MainSessionFunctions.CopyRespToWithInput (cyclomatic 61) libs/server/Storage/Functions/MainStore/PrivateMethods.cs:88— MainSessionFunctions.CopyRespToWithInput has cyclomatic complexity 61 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
MainSessionFunctions.InitialUpdater (cyclomatic 57) libs/server/Storage/Functions/MainStore/RMWMethods.cs:78— MainSessionFunctions.InitialUpdater has cyclomatic complexity 57 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LuaRunner.StructUnpack (cyclomatic 53) libs/server/Lua/LuaRunner.Functions.Struct.cs:649— LuaRunner.StructUnpack has cyclomatic complexity 53 (threshold 15). Of this number, 35 points are the body's own statements and 18 belong to 5 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.
Options.GetServerOptions (cyclomatic 51) libs/host/Configuration/Options.cs:804— Options.GetServerOptions has cyclomatic complexity 51 (threshold 15). Of this number, 50 points are the body's own statements and 1 belongs to one function literal 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.
MainSessionFunctions.GetRMWModifiedFieldInfo (cyclomatic 51) libs/server/Storage/Functions/MainStore/VarLenInputMethods.cs:210— MainSessionFunctions.GetRMWModifiedFieldInfo has cyclomatic complexity 51 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RespServerSession.NetworkXVCREATE (cyclomatic 50) libs/server/Resp/Vector/RespServerSessionVectors.cs:14— RespServerSession.NetworkXVCREATE has cyclomatic complexity 50 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LuaRunner.CMsgPackPack (cyclomatic 49) libs/server/Lua/LuaRunner.Functions.cs:1652— LuaRunner.CMsgPackPack has cyclomatic complexity 49 (threshold 15). Most of this is not in the body itself: 5 of the 49 points are its own statements and the rest belongs to 8 function items inside it that branch (TryEncode, TryEncodeInteger, TryEncodeTable, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
RespServerSession.NetworkCLIENTKILL (cyclomatic 48) libs/server/Resp/ClientCommands.cs:205— RespServerSession.NetworkCLIENTKILL has cyclomatic complexity 48 (threshold 15). Of this number, 36 points are the body's own statements and 12 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.
ExprCompiler.TryCompile (cyclomatic 45) libs/server/Resp/Vector/ExprCompiler.cs:24— ExprCompiler.TryCompile has cyclomatic complexity 45 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Options.Resolve (cyclomatic 45) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/Options.cs:269— Options.Resolve has cyclomatic complexity 45 (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.
RespServerSession.FastParseCommand (cyclomatic 44) libs/server/Resp/Parser/RespCommand.cs:821— RespServerSession.FastParseCommand has cyclomatic complexity 44 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
AllocatorBase.AllocatorBase.ctor (cyclomatic 44) libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorBase.cs:650— AllocatorBase.AllocatorBase.ctor has cyclomatic complexity 44 (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.
LuaRunner.WriteResponse::TryWriteSingleItem (cyclomatic 43) libs/server/Lua/LuaRunner.cs:1669— LuaRunner.WriteResponse::TryWriteSingleItem has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
GarnetServerOptions.GetSettings (cyclomatic 43) libs/server/Servers/GarnetServerOptions.cs:1016— GarnetServerOptions.GetSettings has cyclomatic complexity 43 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ACLParser.ApplyACLOpToUser (cyclomatic 41) libs/server/ACL/ACLParser.cs:133— ACLParser.ApplyACLOpToUser has cyclomatic complexity 41 (threshold 15). Of this number, 26 points are the body's own statements and 15 belong to 3 function items inside it that branch. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClusterSession.SingleKeySlotVerify (cyclomatic 40) libs/cluster/Session/SlotVerification/ClusterSlotVerify.cs:19— ClusterSession.SingleKeySlotVerify has cyclomatic complexity 40 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
RespCommandArgumentParser.TryReadFromResp (cyclomatic 39) playground/CommandInfoUpdater/RespCommandDocsParser.cs:124— RespCommandArgumentParser.TryReadFromResp has cyclomatic complexity 39 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LuaRunner.CJsonEncode (cyclomatic 38) libs/server/Lua/LuaRunner.Functions.cs:1107— LuaRunner.CJsonEncode has cyclomatic complexity 38 (threshold 15). Most of this is not in the body itself: 4 of the 38 points are its own statements and the rest belongs to 7 function items inside it that branch (Encode, EncodeObject, EncodeTable, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
ObjectAllocatorImpl.WriteAsync (cyclomatic 38) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:699— ObjectAllocatorImpl.WriteAsync has cyclomatic complexity 38 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TsavoriteKV.ContinuePendingRead (cyclomatic 37) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/ContinuePending.cs:31— TsavoriteKV.ContinuePendingRead 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.
LuaRunner.AclCheckCommand (cyclomatic 36) libs/server/Lua/LuaRunner.Functions.cs:2808— LuaRunner.AclCheckCommand has cyclomatic complexity 36 (threshold 15). Of this number, 31 points are the body's own statements and 5 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ExprRunner.ExecuteInstruction (cyclomatic 36) libs/server/Resp/Vector/ExprRunner.cs:96— ExprRunner.ExecuteInstruction has cyclomatic complexity 36 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClusterSession.NetworkClusterMigrate (cyclomatic 35) libs/cluster/Session/RespClusterMigrateCommands.cs:74— ClusterSession.NetworkClusterMigrate has cyclomatic complexity 35 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RespServerSession.NetworkRICREATE (cyclomatic 35) libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:31— RespServerSession.NetworkRICREATE has cyclomatic complexity 35 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
GarnetClient.ProcessReplies (cyclomatic 34) libs/client/GarnetClientProcessReplies.cs:215— GarnetClient.ProcessReplies has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
SortedSetObject.SortedSetRange (cyclomatic 34) libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:383— SortedSetObject.SortedSetRange has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
TsavoriteKV.InternalRMW (cyclomatic 34) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:51— TsavoriteKV.InternalRMW has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
JsonPath.ParsePath (cyclomatic 34) modules/GarnetJSON/JSONPath/JsonPath.cs:182— JsonPath.ParsePath has cyclomatic complexity 34 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RespOnlineBench.OpRunnerGarnetClientSession (cyclomatic 33) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:557— RespOnlineBench.OpRunnerGarnetClientSession has cyclomatic complexity 33 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LuaRunner.Bitop (cyclomatic 33) libs/server/Lua/LuaRunner.Functions.cs:985— LuaRunner.Bitop has cyclomatic complexity 33 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
GarnetServer.InitializeServer (cyclomatic 32) libs/host/GarnetServer.cs:170— GarnetServer.InitializeServer has cyclomatic complexity 32 (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.
AofProcessor.ProcessAofRecordInternal (cyclomatic 32) libs/server/AOF/AofProcessor.cs:240— AofProcessor.ProcessAofRecordInternal has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
RespServerSession.NetworkRegisterCs (cyclomatic 32) libs/server/Resp/AdminCommands.cs:402— RespServerSession.NetworkRegisterCs has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: RespServerSession.ProcessAdminCommands (cyclomatic 39) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RespServerSession.NetworkROLE (cyclomatic 32) libs/server/Resp/AdminCommands.cs:860— RespServerSession.NetworkROLE has cyclomatic complexity 32 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This is NOT this file's highest cyclomatic complexity: RespServerSession.ProcessAdminCommands (cyclomatic 39) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RespServerSession.ProcessMessages (cyclomatic 32) libs/server/Resp/RespServerSession.cs:703— RespServerSession.ProcessMessages has cyclomatic complexity 32 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: RespServerSession.ProcessArrayCommands (cyclomatic 161) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
VectorManager.PrepareVectorData (cyclomatic 32) libs/server/Resp/Vector/VectorManager.ElementData.cs:89— VectorManager.PrepareVectorData has cyclomatic complexity 32 (threshold 15). Of this number, 21 points are the body's own statements and 11 belong to 7 function items inside it that branch. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own 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.
NativeStorageDevice.EnsureNativeDeviceCreated (cyclomatic 32) libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:1402— NativeStorageDevice.EnsureNativeDeviceCreated has cyclomatic complexity 32 (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.
SortedSetObject.GeoSearch (cyclomatic 31) libs/server/Objects/SortedSetGeo/SortedSetGeoObjectImpl.cs:170— SortedSetObject.GeoSearch 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.
RespServerSession.NetworkSETEXNX (cyclomatic 31) libs/server/Resp/BasicCommands.cs:605— RespServerSession.NetworkSETEXNX 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.
ScanArraySliceFilter.ExecuteFilter (cyclomatic 31) modules/GarnetJSON/JSONPath/ScanArraySliceFilter.cs:39— ScanArraySliceFilter.ExecuteFilter 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.
RespCommandInfoParser.TryReadFromResp (cyclomatic 31) playground/CommandInfoUpdater/RespCommandInfoParser.cs:24— RespCommandInfoParser.TryReadFromResp has cyclomatic complexity 31 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClientRequestProvider.RunOfflineGarnetClientSession (cyclomatic 30) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:474— ClientRequestProvider.RunOfflineGarnetClientSession 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.
RespServerSession.NetworkVEMB (cyclomatic 30) libs/server/Resp/Vector/RespServerSessionVectors.cs:1543— RespServerSession.NetworkVEMB 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.
VectorManager.ReadVectorIndexCore (cyclomatic 30) libs/server/Resp/Vector/VectorManager.Locking.cs:152— VectorManager.ReadVectorIndexCore 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.
RespServerSession.NetworkCONFIG_SET (cyclomatic 30) libs/server/ServerConfig.cs:112— RespServerSession.NetworkCONFIG_SET 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.
TsavoriteKV.RecoveryLoadObjectsPass2 (cyclomatic 30) libs/storage/Tsavorite/cs/src/core/Index/Recovery/Recovery.cs:1066— TsavoriteKV.RecoveryLoadObjectsPass2 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.
ClientRequestProvider.RunOfflineGarnetClient (cyclomatic 29) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:614— ClientRequestProvider.RunOfflineGarnetClient 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.
RespCommandArgumentConverter.Read (cyclomatic 29) libs/server/Resp/RespCommandArgument.cs:289— RespCommandArgumentConverter.Read has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
KeySpecConverter.Read (cyclomatic 29) libs/server/Resp/RespCommandKeySpecification.cs:537— KeySpecConverter.Read has cyclomatic complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
VectorManager.ReconcileRecoveredState (cyclomatic 29) libs/server/Resp/Vector/VectorManager.cs:320— VectorManager.ReconcileRecoveredState 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.
RespServerSession.NetworkSKIP (cyclomatic 29) libs/server/Transaction/TxnRespCommands.cs:103— RespServerSession.NetworkSKIP has cyclomatic complexity 29 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
JsonPath.ParseArrayIndexer (cyclomatic 29) modules/GarnetJSON/JSONPath/JsonPath.cs:354— JsonPath.ParseArrayIndexer 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.
BenchmarkDotNetTestsApp.Main (cyclomatic 29) libs/storage/Tsavorite/cs/benchmark/BDN-Tsavorite.Benchmark/BenchmarkDotNetTestsApp.cs:59— BenchmarkDotNetTestsApp.Main 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.
Program.DisabledFeatures (cyclomatic 28) benchmark/Resp.benchmark/Program.cs:109— Program.DisabledFeatures 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.
ClusterSession.TryFAILOVER (cyclomatic 28) libs/cluster/Session/FailoverCommand.cs:13— ClusterSession.TryFAILOVER has cyclomatic complexity 28 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
LuaRunner.CJsonDecode (cyclomatic 28) libs/server/Lua/LuaRunner.Functions.cs:1457— LuaRunner.CJsonDecode has cyclomatic complexity 28 (threshold 15). Most of this is not in the body itself: 6 of the 28 points are its own statements and the rest belongs to 4 function items inside it that branch (DecodeValue, Decode, DecodeArray, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest. This is NOT this file's highest cyclomatic complexity: LuaRunner.CMsgPackUnpack::TryDecode (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RespCommandDocsParser.TryReadFromResp (cyclomatic 28) playground/CommandInfoUpdater/RespCommandDocsParser.cs:22— RespCommandDocsParser.TryReadFromResp 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.
ClientRequestProvider.RunOfflineSERedis (cyclomatic 27) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:747— ClientRequestProvider.RunOfflineSERedis 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.
ClusterManager.GossipMainAsync (cyclomatic 27) libs/cluster/Server/Gossip/Gossip.cs:320— ClusterManager.GossipMainAsync 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.
LuaRunner.ProcessCommandFromScripting (cyclomatic 27) libs/server/Lua/LuaRunner.Functions.cs:3150— LuaRunner.ProcessCommandFromScripting 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. This is NOT this file's highest cyclomatic complexity: LuaRunner.CMsgPackUnpack::TryDecode (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
LuaRunner.StructPack (cyclomatic 27) libs/server/Lua/LuaRunner.Functions.Struct.cs:267— LuaRunner.StructPack 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. This shape REPEATS in the file: one other method here (LuaRunner.StructPack::TryEncodeInteger) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SortedSetObject.GetElementsInRangeByLex (cyclomatic 27) libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:983— SortedSetObject.GetElementsInRangeByLex 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.
TsavoriteLogScanIterator.GetNextInternal (cyclomatic 27) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:740— TsavoriteLogScanIterator.GetNextInternal 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.
ListObject.ListPosition (cyclomatic 26) libs/server/Objects/List/ListObjectImpl.cs:340— ListObject.ListPosition 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.
RespServerSession.SortedSetIntersect (cyclomatic 26) libs/server/Resp/Objects/SortedSetCommands.cs:1048— RespServerSession.SortedSetIntersect 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.
RespServerSession.SortedSetUnion (cyclomatic 26) libs/server/Resp/Objects/SortedSetCommands.cs:1342— RespServerSession.SortedSetUnion 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.
VectorManager.ReadOrCreateVectorIndex (cyclomatic 26) libs/server/Resp/Vector/VectorManager.Locking.cs:432— VectorManager.ReadOrCreateVectorIndex 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.
StorageSession.ProcessResp3ArrayOutput (cyclomatic 26) libs/server/Storage/Session/ObjectStore/Common.cs:269— StorageSession.ProcessResp3ArrayOutput 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.
CommandInfoUpdater.TryUpdateCommandInfo (cyclomatic 26) playground/CommandInfoUpdater/CommandInfoUpdater.cs:33— CommandInfoUpdater.TryUpdateCommandInfo has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 belong to one function literal inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
Program.TryParse (cyclomatic 26) playground/LightEpochLitmus/Program.cs:164— Program.TryParse 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.
TestLoader.TestLoader.ctor (cyclomatic 26) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/TestLoader.cs:44— TestLoader.TestLoader.ctor has cyclomatic complexity 26 (threshold 15). Of this number, 24 points are the body's own statements and 2 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.
ClientRequestProvider.InitializeConnections (cyclomatic 25) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:42— ClientRequestProvider.InitializeConnections 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.
RespOnlineBench.OpRunnerGarnetClientSync (cyclomatic 25) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:749— RespOnlineBench.OpRunnerGarnetClientSync 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.
ReplicationSyncManager.MainStreamingSnapshotDriverAsync (cyclomatic 25) libs/cluster/Server/Replication/PrimaryOps/DisklessReplication/ReplicationSyncManager.cs:173— ReplicationSyncManager.MainStreamingSnapshotDriverAsync 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.
GarnetInfoMetrics.PopulateStatsInfo (cyclomatic 25) libs/server/Metrics/Info/GarnetInfoMetrics.cs:181— GarnetInfoMetrics.PopulateStatsInfo 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.
BitOp.__bitop_simdX128_and (cyclomatic 25) playground/Bitmap/BitOp.cs:212— BitOp.__bitop_simdX128_and 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 2 other methods here (BitOp.__bitop_simdX128_and_long, BitOp.__bitop_simdX256_and) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BitOp.__bitop_simdX128_and_long (cyclomatic 25) playground/Bitmap/BitOp.cs:411— BitOp.__bitop_simdX128_and_long 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 2 other methods here (BitOp.__bitop_simdX128_and, BitOp.__bitop_simdX256_and) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BitOp.__bitop_simdX256_and (cyclomatic 25) playground/Bitmap/BitOp.cs:581— BitOp.__bitop_simdX256_and 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 2 other methods here (BitOp.__bitop_simdX128_and, BitOp.__bitop_simdX128_and_long) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
EntryPoint.Run (cyclomatic 25) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/EntryPoint.cs:20— EntryPoint.Run has cyclomatic complexity 25 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
CollectionItemBroker.TryGetNextListResult (cyclomatic 24) libs/server/Objects/ItemBroker/CollectionItemBroker.cs:394— CollectionItemBroker.TryGetNextListResult 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.
RespServerSession.NetworkCLIENTLIST (cyclomatic 24) libs/server/Resp/ClientCommands.cs:22— RespServerSession.NetworkCLIENTLIST has cyclomatic complexity 24 (threshold 15). Of this number, 20 points are the body's own statements and 4 belong to one function literal 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.
RespServerSession.TryConsumeMessages (cyclomatic 24) libs/server/Resp/RespServerSession.cs:545— RespServerSession.TryConsumeMessages 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. This is NOT this file's highest cyclomatic complexity: RespServerSession.ProcessArrayCommands (cyclomatic 161) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RespServerSession.NetworkXVIMPORT (cyclomatic 24) libs/server/Resp/Vector/RespServerSessionVectors.cs:213— RespServerSession.NetworkXVIMPORT 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.
RespServerSession.NetworkVINFO (cyclomatic 24) libs/server/Resp/Vector/RespServerSessionVectors.cs:1875— RespServerSession.NetworkVINFO has cyclomatic complexity 24 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
LogRecord.TrySetContentLengthsAndPrepareOptionals (cyclomatic 24) libs/storage/Tsavorite/cs/src/core/Allocator/LogRecord.cs:680— LogRecord.TrySetContentLengthsAndPrepareOptionals 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.
TsavoriteKV.InternalUpsert (cyclomatic 24) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:46— TsavoriteKV.InternalUpsert 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
TsavoriteKV.DumpDistributionInternal (cyclomatic 24) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Tsavorite.cs:916— TsavoriteKV.DumpDistributionInternal 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.
TsavoriteLogScanIterator.ExpandGetNextInternal (cyclomatic 24) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:881— TsavoriteLogScanIterator.ExpandGetNextInternal 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.
JsonPath.TryParseValue (cyclomatic 24) modules/GarnetJSON/JSONPath/JsonPath.cs:814— JsonPath.TryParseValue 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.
CommandDocsUpdater.TryUpdateCommandDocs (cyclomatic 24) playground/CommandInfoUpdater/CommandDocsUpdater.cs:29— CommandDocsUpdater.TryUpdateCommandDocs has cyclomatic complexity 24 (threshold 15). Of this number, 22 points are the body's own statements and 2 belong to one function literal 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.
TestLoader.LoadDataFromFile (cyclomatic 24) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/TestLoader.cs:186— TestLoader.LoadDataFromFile 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.
ClusterConfig.GetNodeInfo (cyclomatic 23) libs/cluster/Server/ClusterConfig.cs:584— ClusterConfig.GetNodeInfo 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.
ClusterSession.NetworkClusterSetSlot (cyclomatic 23) libs/cluster/Session/RespClusterSlotManagementCommands.cs:421— ClusterSession.NetworkClusterSetSlot has cyclomatic complexity 23 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
GlobUtils.MatchByte (cyclomatic 23) libs/server/GlobUtils.cs:93— GlobUtils.MatchByte 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.
RespServerSession.NetworkGETEX (cyclomatic 23) libs/server/Resp/BasicCommands.cs:99— RespServerSession.NetworkGETEX 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.
RespServerSession.NetworkEXPIRE (cyclomatic 23) libs/server/Resp/KeyAdminCommands.cs:364— RespServerSession.NetworkEXPIRE 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.
RespServerSession.SortedSetMPop (cyclomatic 23) libs/server/Resp/Objects/SortedSetCommands.cs:413— RespServerSession.SortedSetMPop 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.
RespServerSession.SortedSetBlockingMPop (cyclomatic 23) libs/server/Resp/Objects/SortedSetCommands.cs:1620— RespServerSession.SortedSetBlockingMPop 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.
RespServerSession.SimdFastParse (cyclomatic 23) libs/server/Resp/Parser/RespCommand.cs:948— RespServerSession.SimdFastParse 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RespOnlineBench.OpRunnerSERedisParallel (cyclomatic 22) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:1099— RespOnlineBench.OpRunnerSERedisParallel has cyclomatic complexity 22 (threshold 15). Of this number, 20 points are the body's own statements and 2 belong to 2 function literals 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.
ClusterSession.NetworkClusterGossip (cyclomatic 22) libs/cluster/Session/RespClusterBasicCommands.cs:362— ClusterSession.NetworkClusterGossip 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.
ServerSettingsManager.TryParseCommandLineArguments (cyclomatic 22) libs/host/ServerSettingsManager.cs:39— ServerSettingsManager.TryParseCommandLineArguments 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.
AofReplayCoordinator.AddOrReplayTransactionOperation (cyclomatic 22) libs/server/AOF/ReplayCoordinator/AofReplayCoordinator.cs:147— AofReplayCoordinator.AddOrReplayTransactionOperation has cyclomatic complexity 22 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Where every arm is uniform — the same kind of value, with no behaviour of its own — a table keyed by the case is the shorter form; wherever the arms carry different data or different behaviour, keep them as cases, because collapsing those trades an explicit, reviewable set of cases for nothing.
LuaRunner.LuaRunner.ctor (cyclomatic 22) libs/server/Lua/LuaRunner.cs:206— LuaRunner.LuaRunner.ctor has cyclomatic complexity 22 (threshold 15). Of this number, 21 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RespServerSession.NetworkUNSUBSCRIBE (cyclomatic 22) libs/server/Resp/PubSubCommands.cs:284— RespServerSession.NetworkUNSUBSCRIBE has cyclomatic complexity 22 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (RespServerSession.NetworkPUNSUBSCRIBE) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespServerSession.NetworkPUNSUBSCRIBE (cyclomatic 22) libs/server/Resp/PubSubCommands.cs:362— RespServerSession.NetworkPUNSUBSCRIBE has cyclomatic complexity 22 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (RespServerSession.NetworkUNSUBSCRIBE) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RangeIndexChunkedDeserializer.ProcessChunk (cyclomatic 22) libs/server/Resp/RangeIndex/RangeIndexChunkedDeserializer.cs:84— RangeIndexChunkedDeserializer.ProcessChunk 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.
VectorManager.StartQuantizationAndImportTasks (cyclomatic 22) libs/server/Resp/Vector/VectorManager.Quantization.cs:99— VectorManager.StartQuantizationAndImportTasks has cyclomatic complexity 22 (threshold 15). Most of this is not in the body itself: 2 of the 22 points are its own statements and the rest belongs to 2 function items inside it that branch (TryProcessQuantizationOrImportRequest, QuantizationTaskAsync). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
StorageSession.ListMove (cyclomatic 22) libs/server/Storage/Session/ObjectStore/ListOps.cs:212— StorageSession.ListMove 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.
NumUtils.NumDigitsInLong (cyclomatic 21) benchmark/Resp.benchmark/Common/NumUtils.cs:112— NumUtils.NumDigitsInLong 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.
RespOnlineBench.OpRunnerGarnetClientSessionParallel (cyclomatic 21) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:660— RespOnlineBench.OpRunnerGarnetClientSessionParallel 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.
RespOnlineBench.OpRunnerGarnetClientParallel (cyclomatic 21) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:937— RespOnlineBench.OpRunnerGarnetClientParallel 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.
RespOnlineBench.OpRunnerSERedis (cyclomatic 21) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:1013— RespOnlineBench.OpRunnerSERedis 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.
TxnPerfBench.Run (cyclomatic 21) benchmark/Resp.benchmark/TxnPerfBench.cs:98— TxnPerfBench.Run has cyclomatic complexity 21 (threshold 15). Of this number, 19 points are the body's own statements and 2 belong to one function literal 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.
TxnPerfBench.OpRunnerSERedis (cyclomatic 21) benchmark/Resp.benchmark/TxnPerfBench.cs:235— TxnPerfBench.OpRunnerSERedis 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.
RuntimeServerConfig.TrySet (cyclomatic 21) libs/server/Config/RuntimeServerConfig.cs:381— RuntimeServerConfig.TrySet has cyclomatic complexity 21 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
CollectionItemBroker.TryGetResult (cyclomatic 21) libs/server/Objects/ItemBroker/CollectionItemBroker.cs:566— CollectionItemBroker.TryGetResult 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.
RespServerSession.NetworkSCAN (cyclomatic 21) libs/server/Resp/ArrayCommands.cs:257— RespServerSession.NetworkSCAN 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.
RespServerSession.StringBitFieldAction (cyclomatic 21) libs/server/Resp/Bitmap/BitmapCommands.cs:566— RespServerSession.StringBitFieldAction has cyclomatic complexity 21 (threshold 15). Of this number, 12 points are the body's own statements and 9 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.
BitmapManager.CheckBitfieldOverflow::CheckSignedBitfieldOverflow (cyclomatic 21) libs/server/Resp/Bitmap/BitmapManagerBitfield.cs:150— BitmapManager.CheckBitfieldOverflow::CheckSignedBitfieldOverflow 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.
BitmapManager.InvokeNaryBitwiseOperation (cyclomatic 21) libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:66— BitmapManager.InvokeNaryBitwiseOperation has cyclomatic complexity 21 (threshold 15). Of this number, 15 points are the body's own statements and 6 belong to 3 function items inside it that branch. 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RespServerSession.ListBlockingPopMultiple (cyclomatic 21) libs/server/Resp/Objects/ListCommands.cs:847— RespServerSession.ListBlockingPopMultiple has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RespServerSession.ObjectScan (cyclomatic 21) libs/server/Resp/Objects/SharedObjectCommands.cs:18— RespServerSession.ObjectScan 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.
RespServerSession.SortedSetDifference (cyclomatic 21) libs/server/Resp/Objects/SortedSetCommands.cs:909— RespServerSession.SortedSetDifference 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.
RespServerSession.NetworkRICONFIG (cyclomatic 21) libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:516— RespServerSession.NetworkRICONFIG has cyclomatic complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
VectorManager.QueueVectorReplay (cyclomatic 21) libs/server/Resp/Vector/VectorManager.Replication.cs:519— VectorManager.QueueVectorReplay has cyclomatic complexity 21 (threshold 15). Most of this is not in the body itself: 7 of the 21 points are its own statements and the rest belongs to 3 function items inside it that branch (StartReplicaTaskAsync, ApplyVectorSetReplay, StartReplicationReplayTasks). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
MainSessionFunctions.NeedCopyUpdate (cyclomatic 21) libs/server/Storage/Functions/MainStore/RMWMethods.cs:990— MainSessionFunctions.NeedCopyUpdate 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.
StorageSession.SortedSetIntersection (cyclomatic 21) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1501— StorageSession.SortedSetIntersection 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.
TsavoriteKV.InternalRead (cyclomatic 21) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRead.cs:54— TsavoriteKV.InternalRead 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
TsavoriteLog.CommitInternal (cyclomatic 21) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:3359— TsavoriteLog.CommitInternal has cyclomatic complexity 21 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
JsonGET.Reader (cyclomatic 21) modules/GarnetJSON/JsonCommands.cs:107— JsonGET.Reader 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.
JsonPath.ParseExpression (cyclomatic 21) modules/GarnetJSON/JSONPath/JsonPath.cs:701— JsonPath.ParseExpression 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.
BooleanQueryExpression.CompareTo (cyclomatic 21) modules/GarnetJSON/JSONPath/QueryExpression.cs:273— BooleanQueryExpression.CompareTo 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.
ReqGen.Generate (cyclomatic 20) benchmark/Resp.benchmark/OfflineBench/ReqGenLoadBuffers.cs:15— ReqGen.Generate has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: ReqGen.GenerateBatch (cyclomatic 73) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
Program.RunBasicCommandsBenchmark (cyclomatic 20) benchmark/Resp.benchmark/Program.cs:284— Program.RunBasicCommandsBenchmark 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.
GarnetClientSession.ProcessReplies (cyclomatic 20) libs/client/ClientSession/GarnetClientSession.cs:656— GarnetClientSession.ProcessReplies 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.
GarnetClient.AwaitPreviousTaskAsync (cyclomatic 20) libs/client/GarnetClient.cs:627— GarnetClient.AwaitPreviousTaskAsync 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.
ClusterProvider.GetReplicationInfo (cyclomatic 20) libs/cluster/Server/ClusterProvider.cs:218— ClusterProvider.GetReplicationInfo has cyclomatic complexity 20 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MigrateSession.MigrateKeysFromStoreAsync (cyclomatic 20) libs/cluster/Server/Migration/MigrateSessionKeys.cs:26— MigrateSession.MigrateKeysFromStoreAsync 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.
FileUtils.TryGetFiles (cyclomatic 20) libs/common/FileUtils.cs:33— FileUtils.TryGetFiles 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.
GarnetKeyComparer.StaticEquals (cyclomatic 20) libs/common/GarnetKeyComparer.cs:32— GarnetKeyComparer.StaticEquals 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ServerSettingsManager.ConsolidateFlagArguments (cyclomatic 20) libs/host/ServerSettingsManager.cs:366— ServerSettingsManager.ConsolidateFlagArguments has cyclomatic complexity 20 (threshold 15). Of this number, 15 points are the body's own statements and 5 belong to one function literal inside it that branches. To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
LuaRunner.Log (cyclomatic 20) libs/server/Lua/LuaRunner.Functions.cs:425— LuaRunner.Log has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: LuaRunner.CMsgPackUnpack::TryDecode (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RespServerSession.NetworkSlowLogGet (cyclomatic 20) libs/server/Metrics/Slowlog/RespSlowlogCommands.cs:42— RespServerSession.NetworkSlowLogGet has cyclomatic complexity 20 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
SortedSetObject.SortedSetAdd (cyclomatic 20) libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:90— SortedSetObject.SortedSetAdd 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.
SortedSetObject.GetElementsInRangeByScore (cyclomatic 20) libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:1094— SortedSetObject.GetElementsInRangeByScore 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.
RespServerSession.NetworkAclSetUser (cyclomatic 20) libs/server/Resp/ACLCommands.cs:137— RespServerSession.NetworkAclSetUser has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
RespServerSession.NetworkDebug (cyclomatic 20) libs/server/Resp/AdminCommands.cs:728— RespServerSession.NetworkDebug has cyclomatic complexity 20 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: RespServerSession.ProcessAdminCommands (cyclomatic 39) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RespServerSession.ProcessHelloCommand (cyclomatic 20) libs/server/Resp/BasicCommands.cs:1783— RespServerSession.ProcessHelloCommand 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.
BitmapManager.BitCountDriver (cyclomatic 20) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:64— BitmapManager.BitCountDriver 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RespServerSession.ListPopMultiple (cyclomatic 20) libs/server/Resp/Objects/ListCommands.cs:189— RespServerSession.ListPopMultiple has cyclomatic complexity 20 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
AttributeExtractor.ExtractFields (cyclomatic 20) libs/server/Resp/Vector/AttributeExtractor.cs:24— AttributeExtractor.ExtractFields 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.
SessionFunctionsUtils.EvaluateExpire (cyclomatic 20) libs/server/Storage/Functions/SessionFunctionsUtils.cs:32— SessionFunctionsUtils.EvaluateExpire 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.
LogSizeTracker.DetermineEvictionRange (cyclomatic 20) libs/storage/Tsavorite/cs/src/core/Index/Common/LogSizeTracker.cs:472— LogSizeTracker.DetermineEvictionRange 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.
BitOp.__bitop_scalar_and (cyclomatic 20) playground/Bitmap/BitOp.cs:105— BitOp.__bitop_scalar_and 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.
CommonUtils.GetCommandsToAddAndRemove (cyclomatic 20) playground/CommandInfoUpdater/CommonUtils.cs:70— CommonUtils.GetCommandsToAddAndRemove has cyclomatic complexity 20 (threshold 15). Of this number, 16 points are the body's own statements and 4 belong to 3 function literals 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.
ClientRequestProvider.OnResponse (cyclomatic 19) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.cs:376— ClientRequestProvider.OnResponse 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ClientRequestProvider.RunOnlineGarnetClientParallel (cyclomatic 19) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:381— ClientRequestProvider.RunOnlineGarnetClientParallel 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.
RespPerfBench.LightOperate (cyclomatic 19) benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:327— RespPerfBench.LightOperate 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.
RespOnlineBench.OpRunnerGarnetClient (cyclomatic 19) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:858— RespOnlineBench.OpRunnerGarnetClient 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.
MigrateSession.WriteOrSendAccumulatedRecordAsync (cyclomatic 19) libs/cluster/Server/Migration/MigrateSessionCommonUtils.cs:122— MigrateSession.WriteOrSendAccumulatedRecordAsync 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.
MigrateSession.MigrateSlotsDriverInlineAsync (cyclomatic 19) libs/cluster/Server/Migration/MigrateSessionSlots.cs:75— MigrateSession.MigrateSlotsDriverInlineAsync 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.
AofSyncDriverStore.TryAddReplicationDrivers (cyclomatic 19) libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncDriverStore.cs:427— AofSyncDriverStore.TryAddReplicationDrivers 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.
ClusterSession.ProcessPrimaryStream (cyclomatic 19) libs/cluster/Server/Replication/ReplicaOps/AOFReplay/ReplicaReplaySession.cs:26— ClusterSession.ProcessPrimaryStream has cyclomatic complexity 19 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClusterSession.NetworkClusterFailover (cyclomatic 19) libs/cluster/Session/RespClusterFailoverCommands.cs:17— ClusterSession.NetworkClusterFailover 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.
LuaRunner.StructPack::TryEncodeInteger (cyclomatic 19) libs/server/Lua/LuaRunner.Functions.Struct.cs:392— LuaRunner.StructPack::TryEncodeInteger 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. This shape REPEATS in the file: one other method here (LuaRunner.StructPack) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespServerSession.TryRegisterCustomCommands (cyclomatic 19) libs/server/Resp/AdminCommands.cs:276— RespServerSession.TryRegisterCustomCommands 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. This is NOT this file's highest cyclomatic complexity: RespServerSession.ProcessAdminCommands (cyclomatic 39) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RespServerSession.NetworkStringBitPosition (cyclomatic 19) libs/server/Resp/Bitmap/BitmapCommands.cs:267— RespServerSession.NetworkStringBitPosition 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.
RespServerSession.HashExpire (cyclomatic 19) libs/server/Resp/Objects/HashCommands.cs:582— RespServerSession.HashExpire has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
RespServerSession.SortedSetExpire (cyclomatic 19) libs/server/Resp/Objects/SortedSetCommands.cs:1741— RespServerSession.SortedSetExpire has cyclomatic complexity 19 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
RespServerSession.NetworkRIMETRICS (cyclomatic 19) libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:600— RespServerSession.NetworkRIMETRICS has cyclomatic complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MainSessionFunctions.Reader (cyclomatic 19) libs/server/Storage/Functions/MainStore/ReadMethods.cs:16— MainSessionFunctions.Reader 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.
TsavoriteKV.InternalDelete (cyclomatic 19) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:42— TsavoriteKV.InternalDelete 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
KvBenchmark.RunWorkload (cyclomatic 19) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvBenchmark.Worker.cs:170— KvBenchmark.RunWorkload 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.
FixedLenYcsbBenchmark.Run (cyclomatic 19) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/FixedLenYcsbBenchmark.cs:295— FixedLenYcsbBenchmark.Run 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.
ObjectYcsbBenchmark.Run (cyclomatic 19) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ObjectYcsbBenchmark.cs:310— ObjectYcsbBenchmark.Run 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.
SpanByteYcsbBenchmark.Run (cyclomatic 19) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/SpanByteYcsbBenchmark.cs:312— SpanByteYcsbBenchmark.Run 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.
ClientRequestProvider.RunOnlineGarnetClientSessionParallel (cyclomatic 18) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:215— ClientRequestProvider.RunOnlineGarnetClientSessionParallel 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.
ClientRequestProvider.RunOnlineGarnetClient (cyclomatic 18) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:310— ClientRequestProvider.RunOnlineGarnetClient 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.
RespOnlineBench.InitializeThreadWorkers (cyclomatic 18) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:204— RespOnlineBench.InitializeThreadWorkers 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.
ReplicationManager.TryReplicateDisklessSyncAsync (cyclomatic 18) libs/cluster/Server/Replication/ReplicaOps/ReplicaDisklessSync.cs:25— ReplicationManager.TryReplicateDisklessSyncAsync 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.
FilePathValidationAttribute.IsValid (cyclomatic 18) libs/host/Configuration/OptionsValidators.cs:258— FilePathValidationAttribute.IsValid has cyclomatic complexity 18 (threshold 15). To reduce it, name the conditions: bind each compound test to a well-named local or a small predicate function, so the body reads as a sequence of named decisions rather than a chain of operators.
RespServerSession.NetworkINFO (cyclomatic 18) libs/server/Metrics/Info/InfoCommand.cs:12— RespServerSession.NetworkINFO 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.
RespServerSession.NetworkGET_SG (cyclomatic 18) libs/server/Resp/BasicCommands.cs:244— RespServerSession.NetworkGET_SG 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.
RespServerSession.NetworkSUBSCRIBE (cyclomatic 18) libs/server/Resp/PubSubCommands.cs:182— RespServerSession.NetworkSUBSCRIBE has cyclomatic complexity 18 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
RespServerSession.NetworkRISCAN (cyclomatic 18) libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:342— RespServerSession.NetworkRISCAN 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.
StorageSession.SortedSetUnion (cyclomatic 18) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1185— StorageSession.SortedSetUnion 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.
AllocatorBase.ScanLookup (cyclomatic 18) libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorScan.cs:216— AllocatorBase.ScanLookup 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.
ObjectScanIterator.GetNext (cyclomatic 18) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:203— ObjectScanIterator.GetNext 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.
SpanByteScanIterator.GetNext (cyclomatic 18) libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs:202— SpanByteScanIterator.GetNext 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.
TsavoriteBase.BeginMainIndexCheckpoint (cyclomatic 18) libs/storage/Tsavorite/cs/src/core/Index/Recovery/IndexCheckpoint.cs:139— TsavoriteBase.BeginMainIndexCheckpoint 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.
TsavoriteKV.TryAllocateRecord (cyclomatic 18) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/BlockAllocate.cs:48— TsavoriteKV.TryAllocateRecord 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
Program.Main (cyclomatic 18) playground/LightEpochLitmus/Program.cs:21— Program.Main 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.
ClientRequestProvider.RunOnlineGarnetClientSession (cyclomatic 17) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:131— ClientRequestProvider.RunOnlineGarnetClientSession 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.
HashUtils.MurmurHash3x128 (cyclomatic 17) libs/common/HashUtils.cs:109— HashUtils.MurmurHash3x128 has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
LightClientRequest.LightReceive (cyclomatic 17) libs/common/LightClientRequest.cs:118— LightClientRequest.LightReceive 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.
RespReadUtils.TryReadSignedLengthHeader (cyclomatic 17) libs/common/RespReadUtils.cs:364— RespReadUtils.TryReadSignedLengthHeader has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
AofReplayCoordinator.ProcessTransactionGroup (cyclomatic 17) libs/server/AOF/ReplayCoordinator/AofReplayCoordinator.cs:394— AofReplayCoordinator.ProcessTransactionGroup has cyclomatic complexity 17 (threshold 15). Most of this is not in the body itself: 8 of the 17 points are its own statements and the rest belongs to 4 function items inside it that branch (RequiresOrderedReplay, IsVectorRename, SaveTransactionGroupKeysToLock, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
LuaLimitedManagedAllocator.ResizeAllocation (cyclomatic 17) libs/server/Lua/LuaLimitedManagedAllocator.cs:450— LuaLimitedManagedAllocator.ResizeAllocation 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.
LuaRunner.RunForRunner (cyclomatic 17) libs/server/Lua/LuaRunner.cs:1193— LuaRunner.RunForRunner has cyclomatic complexity 17 (threshold 15). Of this number, 9 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
LuaRunner.UnsafeRunPreambleForRunner (cyclomatic 17) libs/server/Lua/LuaRunner.Functions.cs:58— LuaRunner.UnsafeRunPreambleForRunner has cyclomatic complexity 17 (threshold 15). Of this number, 16 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. This is NOT this file's highest cyclomatic complexity: LuaRunner.CMsgPackUnpack::TryDecode (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
LuaRunner.UnsafeRunPreambleForSession (cyclomatic 17) libs/server/Lua/LuaRunner.Functions.cs:180— LuaRunner.UnsafeRunPreambleForSession has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: LuaRunner.CMsgPackUnpack::TryDecode (cyclomatic 29) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
GarnetInfoMetrics.PopulateCommandStatsInfo (cyclomatic 17) libs/server/Metrics/Info/GarnetInfoMetrics.cs:223— GarnetInfoMetrics.PopulateCommandStatsInfo has cyclomatic complexity 17 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This is NOT this file's highest cyclomatic complexity: GarnetInfoMetrics.GetSectionHeader (cyclomatic 18) is higher and carries no row of its own — it was excluded as a flat dispatcher (a long switch/match over independent cases: many branches, almost no nesting), which this dimension does not treat as a refactor obligation. It is named here so the ranking you see in this file is not mistaken for the whole of it; the excluded method is counted neither in this dimension's figures nor in its score.
RespServerSession.NetworkRESTORE (cyclomatic 17) libs/server/Resp/KeyAdminCommands.cs:25— RespServerSession.NetworkRESTORE has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.SortedSetRandomMember (cyclomatic 17) libs/server/Resp/Objects/SortedSetCommands.cs:812— RespServerSession.SortedSetRandomMember 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.
RespServerSession.GeoCommands (cyclomatic 17) libs/server/Resp/Objects/SortedSetGeoCommands.cs:115— RespServerSession.GeoCommands 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.
RespServerSession.GeoSearchCommands (cyclomatic 17) libs/server/Resp/Objects/SortedSetGeoCommands.cs:216— RespServerSession.GeoSearchCommands 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.
RespCommandsInfo.ToRespFormat (cyclomatic 17) libs/server/Resp/RespCommandsInfo.cs:416— RespCommandsInfo.ToRespFormat has cyclomatic complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ExprCompiler.ProcessOperator (cyclomatic 17) libs/server/Resp/Vector/ExprCompiler.cs:177— ExprCompiler.ProcessOperator 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.
SessionParseStateExtensions.TryGetInfoMetricsType (cyclomatic 17) libs/server/SessionParseStateExtensions.cs:25— SessionParseStateExtensions.TryGetInfoMetricsType has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
SessionParseStateExtensions.TryGetKeySearchArgsFromSimpleKeySpec (cyclomatic 17) libs/server/SessionParseStateExtensions.cs:930— SessionParseStateExtensions.TryGetKeySearchArgsFromSimpleKeySpec 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.
MainSessionFunctions.NormalizeRange (cyclomatic 17) libs/server/Storage/Functions/MainStore/PrivateMethods.cs:369— MainSessionFunctions.NormalizeRange 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.
StorageSession.DbScan (cyclomatic 17) libs/server/Storage/Session/Common/ArrayKeyIterationFunctions.cs:50— StorageSession.DbScan has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StorageSession.RENAME (cyclomatic 17) libs/server/Storage/Session/UnifiedStore/UnifiedStoreOps.cs:255— StorageSession.RENAME has cyclomatic complexity 17 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
StoreWrapper.StoreWrapper.ctor (cyclomatic 17) libs/server/StoreWrapper.cs:200— StoreWrapper.StoreWrapper.ctor 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.
NativeStorageDevice.CompletionWorker (cyclomatic 17) libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:2266— NativeStorageDevice.CompletionWorker 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.
TsavoriteLog.WriteOneRecord (cyclomatic 17) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.Chunked.cs:388— TsavoriteLog.WriteOneRecord 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.
TsavoriteLog.RestoreSpecificCommitAsync (cyclomatic 17) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:3050— TsavoriteLog.RestoreSpecificCommitAsync 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.
GarnetJsonObject.TryGet (cyclomatic 17) modules/GarnetJSON/GarnetJsonObject.cs:283— GarnetJsonObject.TryGet 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.
ScanArrayIndexFilter.ExecuteFilter (cyclomatic 17) modules/GarnetJSON/JSONPath/ScanArrayIndexFilter.cs:28— ScanArrayIndexFilter.ExecuteFilter 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.
KvOutput.EmitFinalSummary (cyclomatic 17) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvOutput.cs:102— KvOutput.EmitFinalSummary has cyclomatic complexity 17 (threshold 15). Of this number, 14 points are the body's own statements and 3 belong to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ClientRequestProvider.RunOfflineLightClient (cyclomatic 16) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:365— ClientRequestProvider.RunOfflineLightClient 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.
RespOnlineBench.Run (cyclomatic 16) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:265— RespOnlineBench.Run has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
ReplicaSyncSession.SendCheckpointAsync (cyclomatic 16) libs/cluster/Server/Replication/PrimaryOps/DiskbasedReplication/ReplicaSyncSession.cs:86— ReplicaSyncSession.SendCheckpointAsync 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.
ReplicaReplayTask.FullPageBasedBackgroundReplayAsync (cyclomatic 16) libs/cluster/Server/Replication/ReplicaOps/AOFReplay/ReplicaReplayTask.cs:34— ReplicaReplayTask.FullPageBasedBackgroundReplayAsync 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.
ClusterSession.NetworkTryREPLICAOF (cyclomatic 16) libs/cluster/Session/ReplicaOfCommand.cs:14— ClusterSession.NetworkTryREPLICAOF 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.
ClusterSession.NetworkClusterSetSlotsRange (cyclomatic 16) libs/cluster/Session/RespClusterSlotManagementCommands.cs:516— ClusterSession.NetworkClusterSetSlotsRange has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
AofProcessor.StoreRMW (cyclomatic 16) libs/server/AOF/AofProcessor.cs:573— AofProcessor.StoreRMW has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RespServerSession.FlushDb (cyclomatic 16) libs/server/Resp/BasicCommands.cs:1864— RespServerSession.FlushDb 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.
RespServerSession.StringBitField (cyclomatic 16) libs/server/Resp/Bitmap/BitmapCommands.cs:408— RespServerSession.StringBitField 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.
BitmapManager.__simd_popcX128 (cyclomatic 16) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:186— BitmapManager.__simd_popcX128 has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: one other method here (BitmapManager.__simd_popcX256) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BitmapManager.__simd_popcX256 (cyclomatic 16) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:328— BitmapManager.__simd_popcX256 has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: one other method here (BitmapManager.__simd_popcX128) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespServerSession.NetworkCLIENTUNBLOCK (cyclomatic 16) libs/server/Resp/ClientCommands.cs:583— RespServerSession.NetworkCLIENTUNBLOCK 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.
RespServerSession.HashSet (cyclomatic 16) libs/server/Resp/Objects/HashCommands.cs:24— RespServerSession.HashSet has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
RespServerSession.HashRandomField (cyclomatic 16) libs/server/Resp/Objects/HashCommands.cs:214— RespServerSession.HashRandomField 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.
RespServerSession.SortedSetIntersectStore (cyclomatic 16) libs/server/Resp/Objects/SortedSetCommands.cs:1243— RespServerSession.SortedSetIntersectStore has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (RespServerSession.SortedSetUnionStore) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespServerSession.SortedSetUnionStore (cyclomatic 16) libs/server/Resp/Objects/SortedSetCommands.cs:1471— RespServerSession.SortedSetUnionStore has cyclomatic complexity 16 (threshold 15). To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top. This shape REPEATS in the file: one other method here (RespServerSession.SortedSetIntersectStore) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespServerSession.SortedSetTimeToLive (cyclomatic 16) libs/server/Resp/Objects/SortedSetCommands.cs:1843— RespServerSession.SortedSetTimeToLive has cyclomatic complexity 16 (threshold 15). To reduce it, separate the branches: extract each independent case into its own named function, or replace a long branch ladder over a single value with a data-driven lookup or dispatch table.
RespServerSession.ParseCommand (cyclomatic 16) libs/server/Resp/Parser/RespCommand.cs:1158— RespServerSession.ParseCommand 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in explicit hardware vector and instruction-set types. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RespCommandDocs.ToRespFormat (cyclomatic 16) libs/server/Resp/RespCommandDocs.cs:212— RespCommandDocs.ToRespFormat has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RespCommandsInfo.TryInitializeRespCommandsInfo (cyclomatic 16) libs/server/Resp/RespCommandsInfo.cs:137— RespCommandsInfo.TryInitializeRespCommandsInfo has cyclomatic complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, separate the cases: extract each independent branch into its own named function, and where the body has guards that only reject input, fold those into early returns at the top.
AttributeExtractor.ExtractField (cyclomatic 16) libs/server/Resp/Vector/AttributeExtractor.cs:98— AttributeExtractor.ExtractField 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.
VectorManager.RandomMembers (cyclomatic 16) libs/server/Resp/Vector/VectorManager.cs:1696— VectorManager.RandomMembers has cyclomatic complexity 16 (threshold 15). Of this number, 10 points are the body's own statements and 6 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.
ScanIteratorBase.BufferAndLoad (cyclomatic 16) libs/storage/Tsavorite/cs/src/core/Allocator/ScanIteratorBase.cs:172— ScanIteratorBase.BufferAndLoad 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.
TsavoriteKV.CreateNewRecordDelete (cyclomatic 16) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:208— TsavoriteKV.CreateNewRecordDelete 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.
ArraySliceFilter.ExecuteFilter (cyclomatic 16) modules/GarnetJSON/JSONPath/ArraySliceFilter.cs:111— ArraySliceFilter.ExecuteFilter 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.
JsonPath.TryParseArrayLiteral (cyclomatic 16) modules/GarnetJSON/JSONPath/JsonPath.cs:900— JsonPath.TryParseArrayLiteral 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.
JsonPath.ReadQuotedString (cyclomatic 16) modules/GarnetJSON/JSONPath/JsonPath.cs:975— JsonPath.ReadQuotedString 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.
BitCount.__simd_popcX128 (cyclomatic 16) playground/Bitmap/BitCount.cs:104— BitCount.__simd_popcX128 has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 2 other methods here (BitCount.__simd_popcX256, BitCount.__simd_popcX256_aligned) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BitCount.__simd_popcX256 (cyclomatic 16) playground/Bitmap/BitCount.cs:239— BitCount.__simd_popcX256 has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 2 other methods here (BitCount.__simd_popcX128, BitCount.__simd_popcX256_aligned) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BitCount.__simd_popcX256_aligned (cyclomatic 16) playground/Bitmap/BitCount.cs:384— BitCount.__simd_popcX256_aligned has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 2 other methods here (BitCount.__simd_popcX128, BitCount.__simd_popcX256) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BitOp.__bitop_multikey_simdX256_and (cyclomatic 16) playground/Bitmap/BitOp.cs:1083— BitOp.__bitop_multikey_simdX256_and has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
Program.SetupDeviceBenchmark (cyclomatic 16) libs/storage/Tsavorite/cs/benchmark/Device.benchmark/Program.cs:78— Program.SetupDeviceBenchmark has cyclomatic complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
KvBenchmark.RunWorkers (cyclomatic 16) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvBenchmark.cs:152— KvBenchmark.RunWorkers has cyclomatic complexity 16 (threshold 15). To reduce it, split the body: these branches sit side by side rather than nested inside one another, so extracting each one on its own would leave a function per branch. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
XxxComment libs/server/Resp/BasicCommands.cs:1575— // XXX: There should be high-level AuthenticatorException — source code is not a task system: move the work to your tracker and leave a reference instead (e.g. `// REF: #123`), so the task is planned where tasks live and the ticket links back to the code.
MainSessionFunctions.InPlaceUpdaterWorker (cognitive 204) libs/server/Storage/Functions/MainStore/RMWMethods.cs:460— MainSessionFunctions.InPlaceUpdaterWorker has cognitive complexity 204 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LuaRunner.ProcessSingleRespTerm (cognitive 184) libs/server/Lua/LuaRunner.cs:579— LuaRunner.ProcessSingleRespTerm has cognitive complexity 184 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RespServerSession.NetworkVADD (cognitive 175) libs/server/Resp/Vector/RespServerSessionVectors.cs:293— RespServerSession.NetworkVADD has cognitive complexity 175 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkVSIM (cognitive 166) libs/server/Resp/Vector/RespServerSessionVectors.cs:804— RespServerSession.NetworkVSIM has cognitive complexity 166 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: 2 other methods here (RespServerSession.NetworkVSIM::WriteRESP3Result, RespServerSession.NetworkVSIM::WriteRESP2Result) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
SessionParseStateExtensions.TryGetGeoSearchOptions (cognitive 161) libs/server/SessionParseStateExtensions.cs:264— SessionParseStateExtensions.TryGetGeoSearchOptions has cognitive complexity 161 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TsavoriteKV.CreateNewRecordRMW (cognitive 158) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:379— TsavoriteKV.CreateNewRecordRMW has cognitive complexity 158 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ClusterSession.NetworkTryMIGRATE (cognitive 156) libs/cluster/Session/MigrateCommand.cs:63— ClusterSession.NetworkTryMIGRATE has cognitive complexity 156 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
MainSessionFunctions.CopyUpdater (cognitive 150) libs/server/Storage/Functions/MainStore/RMWMethods.cs:1068— MainSessionFunctions.CopyUpdater has cognitive complexity 150 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkCLIENTKILL (cognitive 127) libs/server/Resp/ClientCommands.cs:205— RespServerSession.NetworkCLIENTKILL has cognitive complexity 127 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function. This shape REPEATS in the file: one other method here (RespServerSession.NetworkCLIENTKILL::IsMatch) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespServerSession.NetworkXVCREATE (cognitive 123) libs/server/Resp/Vector/RespServerSessionVectors.cs:14— RespServerSession.NetworkXVCREATE has cognitive complexity 123 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ReqGen.WriteOp (cognitive 120) benchmark/Resp.benchmark/OfflineBench/ReqGenUtils.cs:22— ReqGen.WriteOp has cognitive complexity 120 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ObjectAllocatorImpl.WriteAsync (cognitive 101) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:699— ObjectAllocatorImpl.WriteAsync has cognitive complexity 101 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.NetworkROLE (cognitive 99) libs/server/Resp/AdminCommands.cs:860— RespServerSession.NetworkROLE has cognitive complexity 99 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ClusterSession.NetworkClusterMigrate (cognitive 94) libs/cluster/Session/RespClusterMigrateCommands.cs:74— ClusterSession.NetworkClusterMigrate has cognitive complexity 94 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
VectorManager.ReadVectorIndexCore (cognitive 86) libs/server/Resp/Vector/VectorManager.Locking.cs:152— VectorManager.ReadVectorIndexCore has cognitive complexity 86 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ScanArraySliceFilter.ExecuteFilter (cognitive 86) modules/GarnetJSON/JSONPath/ScanArraySliceFilter.cs:39— ScanArraySliceFilter.ExecuteFilter has cognitive complexity 86 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
NumUtils.NumDigitsInLong (cognitive 84) benchmark/Resp.benchmark/Common/NumUtils.cs:112— NumUtils.NumDigitsInLong has cognitive complexity 84 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
NumUtils.CountDigits (cognitive 84) libs/common/NumUtils.cs:333— NumUtils.CountDigits has cognitive complexity 84 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
JsonPath.ParseArrayIndexer (cognitive 84) modules/GarnetJSON/JSONPath/JsonPath.cs:354— JsonPath.ParseArrayIndexer has cognitive complexity 84 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.ProcessMessages (cognitive 83) libs/server/Resp/RespServerSession.cs:703— RespServerSession.ProcessMessages has cognitive complexity 83 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.NetworkVEMB (cognitive 82) libs/server/Resp/Vector/RespServerSessionVectors.cs:1543— RespServerSession.NetworkVEMB has cognitive complexity 82 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ExprCompiler.TryCompile (cognitive 79) libs/server/Resp/Vector/ExprCompiler.cs:24— ExprCompiler.TryCompile has cognitive complexity 79 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkRICREATE (cognitive 77) libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:31— RespServerSession.NetworkRICREATE has cognitive complexity 77 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
TsavoriteKV.ContinuePendingRead (cognitive 77) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/ContinuePending.cs:31— TsavoriteKV.ContinuePendingRead has cognitive complexity 77 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.NetworkCLIENTLIST (cognitive 76) libs/server/Resp/ClientCommands.cs:22— RespServerSession.NetworkCLIENTLIST has cognitive complexity 76 (threshold 15). Of this number, 59 points are the body's own statements and 17 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
GarnetClient.ProcessReplies (cognitive 75) libs/client/GarnetClientProcessReplies.cs:215— GarnetClient.ProcessReplies has cognitive complexity 75 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuaRunner.StructUnpack (cognitive 74) libs/server/Lua/LuaRunner.Functions.Struct.cs:649— LuaRunner.StructUnpack has cognitive complexity 74 (threshold 15). Of this number, 39 points are the body's own statements and 35 belong to 5 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.
SortedSetObject.SortedSetRange (cognitive 68) libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:383— SortedSetObject.SortedSetRange has cognitive complexity 68 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespCommandArgumentParser.TryReadFromResp (cognitive 68) playground/CommandInfoUpdater/RespCommandDocsParser.cs:124— RespCommandArgumentParser.TryReadFromResp has cognitive complexity 68 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuaRunner.AclCheckCommand (cognitive 67) libs/server/Lua/LuaRunner.Functions.cs:2808— LuaRunner.AclCheckCommand has cognitive complexity 67 (threshold 15). Of this number, 57 points are the body's own statements and 10 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorManager.ReadOrCreateVectorIndex (cognitive 67) libs/server/Resp/Vector/VectorManager.Locking.cs:432— VectorManager.ReadOrCreateVectorIndex has cognitive complexity 67 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainSessionFunctions.InitialUpdater (cognitive 67) libs/server/Storage/Functions/MainStore/RMWMethods.cs:78— MainSessionFunctions.InitialUpdater has cognitive complexity 67 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
GarnetServerOptions.GetSettings (cognitive 65) libs/server/Servers/GarnetServerOptions.cs:1016— GarnetServerOptions.GetSettings has cognitive complexity 65 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Options.GetServerOptions (cognitive 64) libs/host/Configuration/Options.cs:804— Options.GetServerOptions has cognitive complexity 64 (threshold 15). Of this number, 63 points are the body's own statements and 1 belongs to one function literal 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.
TsavoriteLogScanIterator.GetNextInternal (cognitive 64) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:740— TsavoriteLogScanIterator.GetNextInternal has cognitive complexity 64 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainSessionFunctions.CopyRespToWithInput (cognitive 62) libs/server/Storage/Functions/MainStore/PrivateMethods.cs:88— MainSessionFunctions.CopyRespToWithInput has cognitive complexity 62 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
LuaRunner.CMsgPackUnpack (cognitive 61) libs/server/Lua/LuaRunner.Functions.cs:2159— LuaRunner.CMsgPackUnpack has cognitive complexity 61 (threshold 15). Most of this is not in the body itself: 11 of the 61 points are its own statements and the rest belongs to 11 function items inside it that branch (TryDecodeLargeMap, TryDecode, TryDecodeSmallMap, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
TsavoriteKV.RecoveryLoadObjectsPass2 (cognitive 59) libs/storage/Tsavorite/cs/src/core/Index/Recovery/Recovery.cs:1066— TsavoriteKV.RecoveryLoadObjectsPass2 has cognitive complexity 59 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteKV.InternalRMW (cognitive 58) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:51— TsavoriteKV.InternalRMW has cognitive complexity 58 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
TsavoriteKV.DumpDistributionInternal (cognitive 58) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Tsavorite.cs:916— TsavoriteKV.DumpDistributionInternal has cognitive complexity 58 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespCommandDocsParser.TryReadFromResp (cognitive 58) playground/CommandInfoUpdater/RespCommandDocsParser.cs:22— RespCommandDocsParser.TryReadFromResp has cognitive complexity 58 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TestLoader.LoadDataFromFile (cognitive 58) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/TestLoader.cs:186— TestLoader.LoadDataFromFile has cognitive complexity 58 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ClientRequestProvider.RunOfflineGarnetClientSession (cognitive 57) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:474— ClientRequestProvider.RunOfflineGarnetClientSession has cognitive complexity 57 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkCONFIG_SET (cognitive 57) libs/server/ServerConfig.cs:112— RespServerSession.NetworkCONFIG_SET has cognitive complexity 57 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ReqGen.OnResponse (cognitive 56) benchmark/Resp.benchmark/OfflineBench/ReqGen.cs:187— ReqGen.OnResponse has cognitive complexity 56 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
ACLParser.ApplyACLOpToUser (cognitive 56) libs/server/ACL/ACLParser.cs:133— ACLParser.ApplyACLOpToUser has cognitive complexity 56 (threshold 15). Of this number, 40 points are the body's own statements and 16 belong to 3 function items inside it that branch. To reduce it, split the body: most of this score is breadth rather than depth — checks laid out side by side rather than stacked — so group the statements between the checks into named steps and move each step into its own function. Some of it IS depth: where a check sits inside another whose only job is to reach it, merge the two into one condition, and where an else follows a branch that already returns, drop the trailing else and let the rest of the body continue at one level.
Options.Resolve (cognitive 56) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/Options.cs:269— Options.Resolve has cognitive complexity 56 (threshold 15). 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.
ClientRequestProvider.RunOfflineGarnetClient (cognitive 55) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:614— ClientRequestProvider.RunOfflineGarnetClient has cognitive complexity 55 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortedSetObject.GeoSearch (cognitive 55) libs/server/Objects/SortedSetGeo/SortedSetGeoObjectImpl.cs:170— SortedSetObject.GeoSearch has cognitive complexity 55 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AllocatorBase.AllocatorBase.ctor (cognitive 55) libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorBase.cs:650— AllocatorBase.AllocatorBase.ctor has cognitive complexity 55 (threshold 15). 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.
AofProcessor.ProcessAofRecordInternal (cognitive 53) libs/server/AOF/AofProcessor.cs:240— AofProcessor.ProcessAofRecordInternal has cognitive complexity 53 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.NetworkRegisterCs (cognitive 53) libs/server/Resp/AdminCommands.cs:402— RespServerSession.NetworkRegisterCs has cognitive complexity 53 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.SortedSetUnion (cognitive 53) libs/server/Resp/Objects/SortedSetCommands.cs:1342— RespServerSession.SortedSetUnion has cognitive complexity 53 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorManager.ReconcileRecoveredState (cognitive 53) libs/server/Resp/Vector/VectorManager.cs:320— VectorManager.ReconcileRecoveredState has cognitive complexity 53 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandInfoUpdater.TryUpdateCommandInfo (cognitive 53) playground/CommandInfoUpdater/CommandInfoUpdater.cs:33— CommandInfoUpdater.TryUpdateCommandInfo has cognitive complexity 53 (threshold 15). Of this number, 51 points are the body's own statements and 2 belong to one function literal 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.
ClientRequestProvider.RunOfflineSERedis (cognitive 52) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:747— ClientRequestProvider.RunOfflineSERedis has cognitive complexity 52 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuaRunner.CMsgPackPack (cognitive 52) libs/server/Lua/LuaRunner.Functions.cs:1652— LuaRunner.CMsgPackPack has cognitive complexity 52 (threshold 15). Most of this is not in the body itself: 5 of the 52 points are its own statements and the rest belongs to 8 function items inside it that branch (TryEncodeTable, TryEncodeInteger, TryEncodeMap, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
RespServerSession.SortedSetDifference (cognitive 52) libs/server/Resp/Objects/SortedSetCommands.cs:909— RespServerSession.SortedSetDifference has cognitive complexity 52 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteLogScanIterator.ExpandGetNextInternal (cognitive 52) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:881— TsavoriteLogScanIterator.ExpandGetNextInternal has cognitive complexity 52 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.SortedSetIntersect (cognitive 51) libs/server/Resp/Objects/SortedSetCommands.cs:1048— RespServerSession.SortedSetIntersect has cognitive complexity 51 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageSession.ProcessResp3ArrayOutput (cognitive 51) libs/server/Storage/Session/ObjectStore/Common.cs:269— StorageSession.ProcessResp3ArrayOutput has cognitive complexity 51 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterSession.TryFAILOVER (cognitive 50) libs/cluster/Session/FailoverCommand.cs:13— ClusterSession.TryFAILOVER has cognitive complexity 50 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ListObject.ListPosition (cognitive 50) libs/server/Objects/List/ListObjectImpl.cs:340— ListObject.ListPosition has cognitive complexity 50 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.NetworkSETEXNX (cognitive 50) libs/server/Resp/BasicCommands.cs:605— RespServerSession.NetworkSETEXNX has cognitive complexity 50 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonPath.ParsePath (cognitive 50) modules/GarnetJSON/JSONPath/JsonPath.cs:182— JsonPath.ParsePath has cognitive complexity 50 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortedSetObject.SortedSetAdd (cognitive 49) libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:90— SortedSetObject.SortedSetAdd has cognitive complexity 49 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkUNSUBSCRIBE (cognitive 49) libs/server/Resp/PubSubCommands.cs:284— RespServerSession.NetworkUNSUBSCRIBE has cognitive complexity 49 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (RespServerSession.NetworkPUNSUBSCRIBE) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespServerSession.NetworkPUNSUBSCRIBE (cognitive 49) libs/server/Resp/PubSubCommands.cs:362— RespServerSession.NetworkPUNSUBSCRIBE has cognitive complexity 49 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. This shape REPEATS in the file: one other method here (RespServerSession.NetworkUNSUBSCRIBE) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TxnPerfBench.Run (cognitive 48) benchmark/Resp.benchmark/TxnPerfBench.cs:98— TxnPerfBench.Run has cognitive complexity 48 (threshold 15). Of this number, 44 points are the body's own statements and 4 belong to one function literal 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.
LuaRunner.ProcessCommandFromScripting (cognitive 48) libs/server/Lua/LuaRunner.Functions.cs:3150— LuaRunner.ProcessCommandFromScripting has cognitive complexity 48 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteKV.SplitChunk (cognitive 48) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/SplitIndex.cs:129— TsavoriteKV.SplitChunk has cognitive complexity 48 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandDocsUpdater.TryUpdateCommandDocs (cognitive 48) playground/CommandInfoUpdater/CommandDocsUpdater.cs:29— CommandDocsUpdater.TryUpdateCommandDocs has cognitive complexity 48 (threshold 15). Of this number, 46 points are the body's own statements and 2 belong to one function literal 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.
BenchmarkDotNetTestsApp.Main (cognitive 48) libs/storage/Tsavorite/cs/benchmark/BDN-Tsavorite.Benchmark/BenchmarkDotNetTestsApp.cs:59— BenchmarkDotNetTestsApp.Main has cognitive complexity 48 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespOnlineBench.InitializeThreadWorkers (cognitive 47) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:204— RespOnlineBench.InitializeThreadWorkers has cognitive complexity 47 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReqGen.Generate (cognitive 46) benchmark/Resp.benchmark/OfflineBench/ReqGenLoadBuffers.cs:15— ReqGen.Generate has cognitive complexity 46 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkGET_SG (cognitive 46) libs/server/Resp/BasicCommands.cs:244— RespServerSession.NetworkGET_SG has cognitive complexity 46 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespCommandArgumentConverter.Read (cognitive 46) libs/server/Resp/RespCommandArgument.cs:289— RespCommandArgumentConverter.Read has cognitive complexity 46 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RespServerSession.NetworkXVIMPORT (cognitive 46) libs/server/Resp/Vector/RespServerSessionVectors.cs:213— RespServerSession.NetworkXVIMPORT has cognitive complexity 46 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ClientRequestProvider.InitializeConnections (cognitive 45) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:42— ClientRequestProvider.InitializeConnections has cognitive complexity 45 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanIteratorBase.BufferAndLoad (cognitive 45) libs/storage/Tsavorite/cs/src/core/Allocator/ScanIteratorBase.cs:172— ScanIteratorBase.BufferAndLoad has cognitive complexity 45 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Program.DisabledFeatures (cognitive 44) benchmark/Resp.benchmark/Program.cs:109— Program.DisabledFeatures has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GarnetClientSession.ProcessReplies (cognitive 44) libs/client/ClientSession/GarnetClientSession.cs:656— GarnetClientSession.ProcessReplies has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterManager.GossipMainAsync (cognitive 44) libs/cluster/Server/Gossip/Gossip.cs:320— ClusterManager.GossipMainAsync has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuaRunner.CJsonEncode (cognitive 44) libs/server/Lua/LuaRunner.Functions.cs:1107— LuaRunner.CJsonEncode has cognitive complexity 44 (threshold 15). Most of this is not in the body itself: 4 of the 44 points are its own statements and the rest belongs to 7 function items inside it that branch (EncodeObject, EncodeTable, EncodeArray, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
MainSessionFunctions.GetRMWModifiedFieldInfo (cognitive 44) libs/server/Storage/Functions/MainStore/VarLenInputMethods.cs:210— MainSessionFunctions.GetRMWModifiedFieldInfo has cognitive complexity 44 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanArrayIndexFilter.ExecuteFilter (cognitive 44) modules/GarnetJSON/JSONPath/ScanArrayIndexFilter.cs:28— ScanArrayIndexFilter.ExecuteFilter has cognitive complexity 44 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TxnPerfBench.OpRunnerSERedis (cognitive 43) benchmark/Resp.benchmark/TxnPerfBench.cs:235— TxnPerfBench.OpRunnerSERedis has cognitive complexity 43 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterSession.NetworkClusterFailover (cognitive 43) libs/cluster/Session/RespClusterFailoverCommands.cs:17— ClusterSession.NetworkClusterFailover has cognitive complexity 43 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.SortedSetMPop (cognitive 43) libs/server/Resp/Objects/SortedSetCommands.cs:413— RespServerSession.SortedSetMPop has cognitive complexity 43 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespOnlineBench.OpRunnerGarnetClientSync (cognitive 42) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:749— RespOnlineBench.OpRunnerGarnetClientSync has cognitive complexity 42 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplicaReplayTask.FullPageBasedBackgroundReplayAsync (cognitive 42) libs/cluster/Server/Replication/ReplicaOps/AOFReplay/ReplicaReplayTask.cs:34— ReplicaReplayTask.FullPageBasedBackgroundReplayAsync has cognitive complexity 42 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ClusterSession.NetworkClusterGossip (cognitive 42) libs/cluster/Session/RespClusterBasicCommands.cs:362— ClusterSession.NetworkClusterGossip has cognitive complexity 42 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ArraySliceFilter.ExecuteFilter (cognitive 42) modules/GarnetJSON/JSONPath/ArraySliceFilter.cs:111— ArraySliceFilter.ExecuteFilter has cognitive complexity 42 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
KvOutput.EmitFinalSummary (cognitive 42) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvOutput.cs:102— KvOutput.EmitFinalSummary has cognitive complexity 42 (threshold 15). Of this number, 36 points are the body's own statements and 6 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.
RespServerSession.NetworkGETEX (cognitive 41) libs/server/Resp/BasicCommands.cs:99— RespServerSession.NetworkGETEX has cognitive complexity 41 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TsavoriteKV.ContextReadWithPrefetch (cognitive 41) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Tsavorite.cs:564— TsavoriteKV.ContextReadWithPrefetch has cognitive complexity 41 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
GarnetServer.InitializeServer (cognitive 40) libs/host/GarnetServer.cs:170— GarnetServer.InitializeServer has cognitive complexity 40 (threshold 15). 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.
RespServerSession.NetworkSKIP (cognitive 40) libs/server/Transaction/TxnRespCommands.cs:103— RespServerSession.NetworkSKIP has cognitive complexity 40 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
NativeStorageDevice.EnsureNativeDeviceCreated (cognitive 40) libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:1402— NativeStorageDevice.EnsureNativeDeviceCreated has cognitive complexity 40 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.TryConsumeMessages (cognitive 39) libs/server/Resp/RespServerSession.cs:545— RespServerSession.TryConsumeMessages has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LogSizeTracker.DetermineEvictionRange (cognitive 39) libs/storage/Tsavorite/cs/src/core/Index/Common/LogSizeTracker.cs:472— LogSizeTracker.DetermineEvictionRange has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteBase.BeginMainIndexCheckpoint (cognitive 39) libs/storage/Tsavorite/cs/src/core/Index/Recovery/IndexCheckpoint.cs:139— TsavoriteBase.BeginMainIndexCheckpoint has cognitive complexity 39 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Program.SetupDeviceBenchmark (cognitive 39) libs/storage/Tsavorite/cs/benchmark/Device.benchmark/Program.cs:78— Program.SetupDeviceBenchmark has cognitive complexity 39 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
MigrateSession.MigrateKeysFromStoreAsync (cognitive 38) libs/cluster/Server/Migration/MigrateSessionKeys.cs:26— MigrateSession.MigrateKeysFromStoreAsync has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkSlowLogGet (cognitive 38) libs/server/Metrics/Slowlog/RespSlowlogCommands.cs:42— RespServerSession.NetworkSlowLogGet has cognitive complexity 38 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.NetworkSCAN (cognitive 38) libs/server/Resp/ArrayCommands.cs:257— RespServerSession.NetworkSCAN has cognitive complexity 38 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.StringBitFieldAction (cognitive 38) libs/server/Resp/Bitmap/BitmapCommands.cs:566— RespServerSession.StringBitFieldAction has cognitive complexity 38 (threshold 15). Of this number, 24 points are the body's own statements and 14 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageSession.StringBitField (cognitive 38) libs/server/Storage/Session/MainStore/BitmapOps.cs:316— StorageSession.StringBitField has cognitive complexity 38 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TsavoriteKV.InternalUpsert (cognitive 38) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:46— TsavoriteKV.InternalUpsert has cognitive complexity 38 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
Program.RunBasicCommandsBenchmark (cognitive 37) benchmark/Resp.benchmark/Program.cs:284— Program.RunBasicCommandsBenchmark has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortedSetObject.GetElementsInRangeByLex (cognitive 37) libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:983— SortedSetObject.GetElementsInRangeByLex has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AttributeExtractor.ExtractFields (cognitive 37) libs/server/Resp/Vector/AttributeExtractor.cs:24— AttributeExtractor.ExtractFields has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonPath.TryParseValue (cognitive 37) modules/GarnetJSON/JSONPath/JsonPath.cs:814— JsonPath.TryParseValue has cognitive complexity 37 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterConfig.GetNodeInfo (cognitive 36) libs/cluster/Server/ClusterConfig.cs:584— ClusterConfig.GetNodeInfo has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GlobUtils.MatchByte (cognitive 36) libs/server/GlobUtils.cs:93— GlobUtils.MatchByte has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkCLIENTUNBLOCK (cognitive 36) libs/server/Resp/ClientCommands.cs:583— RespServerSession.NetworkCLIENTUNBLOCK has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ObjectScanIterator.GetNext (cognitive 36) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:203— ObjectScanIterator.GetNext has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpanByteScanIterator.GetNext (cognitive 36) libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs:202— SpanByteScanIterator.GetNext has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteBase.FindTagOrFreeInternal (cognitive 36) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/TsavoriteBase.cs:379— TsavoriteBase.FindTagOrFreeInternal has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
JsonPath.ParseExpression (cognitive 36) modules/GarnetJSON/JSONPath/JsonPath.cs:701— JsonPath.ParseExpression has cognitive complexity 36 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanArrayMultipleIndexFilter.ExecuteFilter (cognitive 36) modules/GarnetJSON/JSONPath/ScanArrayMultipleIndexFilter.cs:35— ScanArrayMultipleIndexFilter.ExecuteFilter has cognitive complexity 36 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespCommandInfoParser.TryReadFromResp (cognitive 36) playground/CommandInfoUpdater/RespCommandInfoParser.cs:24— RespCommandInfoParser.TryReadFromResp has cognitive complexity 36 (threshold 15). 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.
KvBenchmark.RunWorkload (cognitive 35) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvBenchmark.Worker.cs:170— KvBenchmark.RunWorkload has cognitive complexity 35 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MigrateSession.MigrateSlotsDriverInlineAsync (cognitive 34) libs/cluster/Server/Migration/MigrateSessionSlots.cs:75— MigrateSession.MigrateSlotsDriverInlineAsync has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplicationSyncManager.MainStreamingSnapshotDriverAsync (cognitive 34) libs/cluster/Server/Replication/PrimaryOps/DisklessReplication/ReplicationSyncManager.cs:173— ReplicationSyncManager.MainStreamingSnapshotDriverAsync has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReadOptimizedLock.TryPromoteSharedLock (cognitive 34) libs/common/Synchronization/ReadOptimizedLock.cs:586— ReadOptimizedLock.TryPromoteSharedLock has cognitive complexity 34 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
LuaRunner.RunCommon (cognitive 34) libs/server/Lua/LuaRunner.cs:1482— LuaRunner.RunCommon has cognitive complexity 34 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RoaringBitmap.BitPos (cognitive 34) modules/RoaringBitmap/RoaringBitmap.cs:139— RoaringBitmap.BitPos has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KvBenchmark.Validate (cognitive 34) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvBenchmark.Validate.cs:24— KvBenchmark.Validate has cognitive complexity 34 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterSession.NetworkTryREPLICAOF (cognitive 33) libs/cluster/Session/ReplicaOfCommand.cs:14— ClusterSession.NetworkTryREPLICAOF has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AofReplayCoordinator.ProcessTransactionGroup (cognitive 33) libs/server/AOF/ReplayCoordinator/AofReplayCoordinator.cs:394— AofReplayCoordinator.ProcessTransactionGroup has cognitive complexity 33 (threshold 15). Of this number, 19 points are the body's own statements and 14 belong to 4 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.
ListObject.ListTrim (cognitive 33) libs/server/Objects/List/ListObjectImpl.cs:174— ListObject.ListTrim has cognitive complexity 33 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
LogRecord.TrySetContentLengthsAndPrepareOptionals (cognitive 33) libs/storage/Tsavorite/cs/src/core/Allocator/LogRecord.cs:680— LogRecord.TrySetContentLengthsAndPrepareOptionals has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonGET.Reader (cognitive 33) modules/GarnetJSON/JsonCommands.cs:107— JsonGET.Reader has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BitOp.__bitop_simdX128_and (cognitive 33) playground/Bitmap/BitOp.cs:212— BitOp.__bitop_simdX128_and has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 2 other methods here (BitOp.__bitop_simdX128_and_long, BitOp.__bitop_simdX256_and) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BitOp.__bitop_simdX128_and_long (cognitive 33) playground/Bitmap/BitOp.cs:411— BitOp.__bitop_simdX128_and_long has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 2 other methods here (BitOp.__bitop_simdX128_and, BitOp.__bitop_simdX256_and) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BitOp.__bitop_simdX256_and (cognitive 33) playground/Bitmap/BitOp.cs:581— BitOp.__bitop_simdX256_and has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 2 other methods here (BitOp.__bitop_simdX128_and, BitOp.__bitop_simdX128_and_long) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 3 times rather than 3 independent problems. Splitting this body alone leaves the other 2 exactly as they are. Where these are variations on one operation, the change that clears all 3 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FixedLenYcsbBenchmark.Run (cognitive 33) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/FixedLenYcsbBenchmark.cs:295— FixedLenYcsbBenchmark.Run has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ObjectYcsbBenchmark.Run (cognitive 33) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ObjectYcsbBenchmark.cs:310— ObjectYcsbBenchmark.Run has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpanByteYcsbBenchmark.Run (cognitive 33) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/SpanByteYcsbBenchmark.cs:312— SpanByteYcsbBenchmark.Run has cognitive complexity 33 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterManager.ParseClusterConfig (cognitive 32) benchmark/Resp.benchmark/ClusterBench/ClusterManager.cs:43— ClusterManager.ParseClusterConfig has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FileUtils.TryGetFiles (cognitive 32) libs/common/FileUtils.cs:33— FileUtils.TryGetFiles has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.TryCustomObjectCommand (cognitive 32) libs/server/Custom/CustomRespCommands.cs:158— RespServerSession.TryCustomObjectCommand has cognitive complexity 32 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
CollectionItemBroker.TryGetNextListResult (cognitive 32) libs/server/Objects/ItemBroker/CollectionItemBroker.cs:394— CollectionItemBroker.TryGetNextListResult has cognitive complexity 32 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
BitmapManager.BitCountDriver (cognitive 32) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:64— BitmapManager.BitCountDriver has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RespCommandsInfo.ToRespFormat (cognitive 32) libs/server/Resp/RespCommandsInfo.cs:416— RespCommandsInfo.ToRespFormat has cognitive complexity 32 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
GarnetServerTcp.HandleNewConnection (cognitive 32) libs/server/Servers/GarnetServerTcp.cs:309— GarnetServerTcp.HandleNewConnection has cognitive complexity 32 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ObjectYcsbBenchmark.RunYcsbSafeContext (cognitive 32) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ObjectYcsbBenchmark.cs:221— ObjectYcsbBenchmark.RunYcsbSafeContext has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpanByteYcsbBenchmark.RunYcsbSafeContext (cognitive 32) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/SpanByteYcsbBenchmark.cs:223— SpanByteYcsbBenchmark.RunYcsbSafeContext has cognitive complexity 32 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientRequestProvider.OnResponse (cognitive 31) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.cs:376— ClientRequestProvider.OnResponse has cognitive complexity 31 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RespOnlineBench.Run (cognitive 31) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:265— RespOnlineBench.Run has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MigrateSession.WriteOrSendAccumulatedRecordAsync (cognitive 31) libs/cluster/Server/Migration/MigrateSessionCommonUtils.cs:122— MigrateSession.WriteOrSendAccumulatedRecordAsync has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkAclSetUser (cognitive 31) libs/server/Resp/ACLCommands.cs:137— RespServerSession.NetworkAclSetUser has cognitive complexity 31 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ExprCompiler.ProcessOperator (cognitive 31) libs/server/Resp/Vector/ExprCompiler.cs:177— ExprCompiler.ProcessOperator has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExprRunner.ExecuteInstruction (cognitive 31) libs/server/Resp/Vector/ExprRunner.cs:96— ExprRunner.ExecuteInstruction has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NativeStorageDevice.CompletionWorker (cognitive 31) libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:2266— NativeStorageDevice.CompletionWorker has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteLog.WriteOneRecord (cognitive 31) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.Chunked.cs:388— TsavoriteLog.WriteOneRecord has cognitive complexity 31 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanFilter.ExecuteFilter (cognitive 31) modules/GarnetJSON/JSONPath/ScanFilter.cs:35— ScanFilter.ExecuteFilter has cognitive complexity 31 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
EntryPoint.Run (cognitive 31) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/EntryPoint.cs:20— EntryPoint.Run has cognitive complexity 31 (threshold 15). 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.
SlotKeyGenerator.FindTagForShard (cognitive 30) benchmark/Resp.benchmark/ClusterBench/SlotKeyGenerator.cs:86— SlotKeyGenerator.FindTagForShard has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespOnlineBench.OpRunnerGarnetClientSession (cognitive 30) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:557— RespOnlineBench.OpRunnerGarnetClientSession has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AofSyncDriverStore.TryAddReplicationDrivers (cognitive 30) libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncDriverStore.cs:427— AofSyncDriverStore.TryAddReplicationDrivers has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterSession.NetworkClusterSetSlot (cognitive 30) libs/cluster/Session/RespClusterSlotManagementCommands.cs:421— ClusterSession.NetworkClusterSetSlot has cognitive complexity 30 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.NetworkINFO (cognitive 30) libs/server/Metrics/Info/InfoCommand.cs:12— RespServerSession.NetworkINFO has cognitive complexity 30 (threshold 15). 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.
RespServerSession.NetworkStringBitPosition (cognitive 30) libs/server/Resp/Bitmap/BitmapCommands.cs:267— RespServerSession.NetworkStringBitPosition has cognitive complexity 30 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.SortedSetIntersectStore (cognitive 30) libs/server/Resp/Objects/SortedSetCommands.cs:1243— RespServerSession.SortedSetIntersectStore has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RespServerSession.SortedSetUnionStore) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespServerSession.SortedSetUnionStore (cognitive 30) libs/server/Resp/Objects/SortedSetCommands.cs:1471— RespServerSession.SortedSetUnionStore has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RespServerSession.SortedSetIntersectStore) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
StorageSession.SortedSetUnion (cognitive 30) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1185— StorageSession.SortedSetUnion has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageSession.SortedSetIntersection (cognitive 30) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1501— StorageSession.SortedSetIntersection has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteKV.InternalRead (cognitive 30) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRead.cs:54— TsavoriteKV.InternalRead has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ArraySliceFilter.ExecuteFilter (cognitive 30) modules/GarnetJSON/JSONPath/ArraySliceFilter.cs:38— ArraySliceFilter.ExecuteFilter has cognitive complexity 30 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
CommonUtils.GetCommandsToAddAndRemove (cognitive 30) playground/CommandInfoUpdater/CommonUtils.cs:70— CommonUtils.GetCommandsToAddAndRemove has cognitive complexity 30 (threshold 15). Of this number, 26 points are the body's own statements and 4 belong to 3 function literals 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.
RespKeySpecificationParser.TryReadFromResp (cognitive 30) playground/CommandInfoUpdater/RespCommandInfoParser.cs:146— RespKeySpecificationParser.TryReadFromResp has cognitive complexity 30 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KvBenchmark.WorkerProc (cognitive 30) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvBenchmark.Worker.cs:27— KvBenchmark.WorkerProc has cognitive complexity 30 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespOnlineBench.OpRunnerSERedisParallel (cognitive 29) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:1099— RespOnlineBench.OpRunnerSERedisParallel has cognitive complexity 29 (threshold 15). Of this number, 23 points are the body's own statements and 6 belong to 2 function literals 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.
GarnetClient.AwaitPreviousTaskAsync (cognitive 29) libs/client/GarnetClient.cs:627— GarnetClient.AwaitPreviousTaskAsync has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerSettingsManager.TryParseCommandLineArguments (cognitive 29) libs/host/ServerSettingsManager.cs:39— ServerSettingsManager.TryParseCommandLineArguments has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ServerSettingsManager.TryParseArguments (cognitive 29) libs/host/ServerSettingsManager.cs:226— ServerSettingsManager.TryParseArguments has cognitive complexity 29 (threshold 15). None of this is in the body itself: all 29 points belong to one function literal inside it that branches (line 232). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest.
LuaRunner.Log (cognitive 29) libs/server/Lua/LuaRunner.Functions.cs:425— LuaRunner.Log has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GarnetInfoMetrics.PopulateCommandStatsInfo (cognitive 29) libs/server/Metrics/Info/GarnetInfoMetrics.cs:223— GarnetInfoMetrics.PopulateCommandStatsInfo has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.ProcessHelloCommand (cognitive 29) libs/server/Resp/BasicCommands.cs:1783— RespServerSession.ProcessHelloCommand has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BitmapManager.BitPosByteSearch (cognitive 29) libs/server/Resp/Bitmap/BitmapManagerBitPos.cs:113— BitmapManager.BitPosByteSearch has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KeySpecConverter.Read (cognitive 29) libs/server/Resp/RespCommandKeySpecification.cs:537— KeySpecConverter.Read has cognitive complexity 29 (threshold 15). To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
SessionParseStateExtensions.TryGetKeySearchArgsFromSimpleKeySpec (cognitive 29) libs/server/SessionParseStateExtensions.cs:930— SessionParseStateExtensions.TryGetKeySearchArgsFromSimpleKeySpec has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AllocatorBase.OnPagesClosedWorkerCore (cognitive 29) libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorBase.cs:1894— AllocatorBase.OnPagesClosedWorkerCore has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AllocatorBase.AsyncFlushPagesForSnapshot (cognitive 29) libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorBase.cs:2374— AllocatorBase.AsyncFlushPagesForSnapshot has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AllocatorBase.VerifyRecordFromDiskCallback (cognitive 29) libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorBase.cs:2655— AllocatorBase.VerifyRecordFromDiskCallback has cognitive complexity 29 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TsavoriteKV.TryAllocateRecord (cognitive 29) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/BlockAllocate.cs:48— TsavoriteKV.TryAllocateRecord has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
FieldFilter.ExecuteFilterMultiple (cognitive 29) modules/GarnetJSON/JSONPath/FieldFilter.cs:108— FieldFilter.ExecuteFilterMultiple has cognitive complexity 29 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GarnetKeyComparer.StaticEquals (cognitive 28) libs/common/GarnetKeyComparer.cs:32— GarnetKeyComparer.StaticEquals has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RespServerSession.TryCustomRawStringCommand (cognitive 28) libs/server/Custom/CustomRespCommands.cs:92— RespServerSession.TryCustomRawStringCommand has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkHELLO (cognitive 28) libs/server/Resp/BasicCommands.cs:1447— RespServerSession.NetworkHELLO has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.StringBitField (cognitive 28) libs/server/Resp/Bitmap/BitmapCommands.cs:408— RespServerSession.StringBitField has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BitmapManager.InvokeNaryBitwiseOperation (cognitive 28) libs/server/Resp/Bitmap/BitmapManagerBitOp.cs:66— BitmapManager.InvokeNaryBitwiseOperation has cognitive complexity 28 (threshold 15). Of this number, 19 points are the body's own statements and 9 belong to 3 function items inside it that branch. 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RespServerSession.SortedSetBlockingMPop (cognitive 28) libs/server/Resp/Objects/SortedSetCommands.cs:1620— RespServerSession.SortedSetBlockingMPop has cognitive complexity 28 (threshold 15). 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.
VectorManager.ValueSimilarity (cognitive 28) libs/server/Resp/Vector/VectorManager.cs:944— VectorManager.ValueSimilarity has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainSessionFunctions.NormalizeRange (cognitive 28) libs/server/Storage/Functions/MainStore/PrivateMethods.cs:369— MainSessionFunctions.NormalizeRange has cognitive complexity 28 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TsavoriteKV.InternalDelete (cognitive 28) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:42— TsavoriteKV.InternalDelete has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
BitOp.__bitop_scalar_and (cognitive 28) playground/Bitmap/BitOp.cs:105— BitOp.__bitop_scalar_and has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandDocsUpdater.GetUpdatedCommandsDocs (cognitive 28) playground/CommandInfoUpdater/CommandDocsUpdater.cs:205— CommandDocsUpdater.GetUpdatedCommandsDocs has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Program.TryParse (cognitive 28) playground/LightEpochLitmus/Program.cs:164— Program.TryParse has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FixedLenYcsbBenchmark.RunYcsbUnsafeContext (cognitive 28) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/FixedLenYcsbBenchmark.cs:126— FixedLenYcsbBenchmark.RunYcsbUnsafeContext has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (FixedLenYcsbBenchmark.RunYcsbSafeContext) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
FixedLenYcsbBenchmark.RunYcsbSafeContext (cognitive 28) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/FixedLenYcsbBenchmark.cs:216— FixedLenYcsbBenchmark.RunYcsbSafeContext has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (FixedLenYcsbBenchmark.RunYcsbUnsafeContext) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ObjectYcsbBenchmark.RunYcsbUnsafeContext (cognitive 28) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ObjectYcsbBenchmark.cs:125— ObjectYcsbBenchmark.RunYcsbUnsafeContext has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SpanByteYcsbBenchmark.RunYcsbUnsafeContext (cognitive 28) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/SpanByteYcsbBenchmark.cs:127— SpanByteYcsbBenchmark.RunYcsbUnsafeContext has cognitive complexity 28 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespOnlineBench.OpRunnerGarnetClient (cognitive 27) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:858— RespOnlineBench.OpRunnerGarnetClient has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespOnlineBench.OpRunnerSERedis (cognitive 27) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:1013— RespOnlineBench.OpRunnerSERedis has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterProvider.GetReplicationInfo (cognitive 27) libs/cluster/Server/ClusterProvider.cs:218— ClusterProvider.GetReplicationInfo has cognitive complexity 27 (threshold 15). 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.
ClusterSession.SingleKeySlotVerify (cognitive 27) libs/cluster/Session/SlotVerification/ClusterSlotVerify.cs:19— ClusterSession.SingleKeySlotVerify has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuaLimitedManagedAllocator.ResizeAllocation (cognitive 27) libs/server/Lua/LuaLimitedManagedAllocator.cs:450— LuaLimitedManagedAllocator.ResizeAllocation has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuaRunner.CJsonDecode (cognitive 27) libs/server/Lua/LuaRunner.Functions.cs:1457— LuaRunner.CJsonDecode has cognitive complexity 27 (threshold 15). Most of this is not in the body itself: 6 of the 27 points are its own statements and the rest belongs to 4 function items inside it that branch (DecodeObject, Decode, DecodeArray, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
SortedSetObject.GetElementsInRangeByScore (cognitive 27) libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:1094— SortedSetObject.GetElementsInRangeByScore has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.TryRegisterCustomCommands (cognitive 27) libs/server/Resp/AdminCommands.cs:276— RespServerSession.TryRegisterCustomCommands has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkSET_Conditional (cognitive 27) libs/server/Resp/BasicCommands.cs:772— RespServerSession.NetworkSET_Conditional has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkEXPIRE (cognitive 27) libs/server/Resp/KeyAdminCommands.cs:364— RespServerSession.NetworkEXPIRE has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MGetReadArgBatch_SG.CompletePending (cognitive 27) libs/server/Resp/MGetReadArgBatch.cs:160— MGetReadArgBatch_SG.CompletePending has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.SetIsMember (cognitive 27) libs/server/Resp/Objects/SetCommands.cs:441— RespServerSession.SetIsMember has cognitive complexity 27 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RangeIndexChunkedDeserializer.ProcessChunk (cognitive 27) libs/server/Resp/RangeIndex/RangeIndexChunkedDeserializer.cs:84— RangeIndexChunkedDeserializer.ProcessChunk has cognitive complexity 27 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
StorageSession.ProcessResp2ArrayOutput (cognitive 27) libs/server/Storage/Session/ObjectStore/Common.cs:189— StorageSession.ProcessResp2ArrayOutput has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AllocatorBase.ScanLookup (cognitive 27) libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorScan.cs:216— AllocatorBase.ScanLookup has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteKVIterator.PushNext (cognitive 27) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/TsavoriteIterator.cs:155— TsavoriteKVIterator.PushNext has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteLog.RestoreSpecificCommitAsync (cognitive 27) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:3050— TsavoriteLog.RestoreSpecificCommitAsync has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BooleanQueryExpression.CompareTo (cognitive 27) modules/GarnetJSON/JSONPath/QueryExpression.cs:273— BooleanQueryExpression.CompareTo has cognitive complexity 27 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientRequestProvider.RunOnlineGarnetClientSessionParallel (cognitive 26) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:215— ClientRequestProvider.RunOnlineGarnetClientSessionParallel has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespPerfBench.PerformAsyncGET (cognitive 26) benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:176— RespPerfBench.PerformAsyncGET has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespOnlineBench.InitializeClients (cognitive 26) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:147— RespOnlineBench.InitializeClients has cognitive complexity 26 (threshold 15). Of this number, 16 points are the body's own statements and 10 belong to 2 function literals 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.
LuaRunner.LuaRunner.ctor (cognitive 26) libs/server/Lua/LuaRunner.cs:206— LuaRunner.LuaRunner.ctor has cognitive complexity 26 (threshold 15). Of this number, 25 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: 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.
LuaRunner.UnsafeRunPreambleForSession (cognitive 26) libs/server/Lua/LuaRunner.Functions.cs:180— LuaRunner.UnsafeRunPreambleForSession has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuaRunner.StructPack (cognitive 26) libs/server/Lua/LuaRunner.Functions.Struct.cs:267— LuaRunner.StructPack has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (LuaRunner.StructPack::TryEncodeInteger) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespServerSession.NetworkAclGetUser (cognitive 26) libs/server/Resp/ACLCommands.cs:435— RespServerSession.NetworkAclGetUser has cognitive complexity 26 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.AsyncGetProcessorAsync (cognitive 26) libs/server/Resp/AsyncProcessor.cs:79— RespServerSession.AsyncGetProcessorAsync has cognitive complexity 26 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
AttributeExtractor.ExtractField (cognitive 26) libs/server/Resp/Vector/AttributeExtractor.cs:98— AttributeExtractor.ExtractField has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExprRunner.Run (cognitive 26) libs/server/Resp/Vector/ExprRunner.cs:44— ExprRunner.Run has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorManager.CheckpointCompleted::QueueCleanups (cognitive 26) libs/server/Resp/Vector/VectorManager.Cleanup.cs:468— VectorManager.CheckpointCompleted::QueueCleanups has cognitive complexity 26 (threshold 15). Drivers by points: if/else 6 (21 pts), loops 2 (3 pts), boolean chains 2 (nesting depth added 16). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorManager.ElementSimilarity (cognitive 26) libs/server/Resp/Vector/VectorManager.cs:1162— VectorManager.ElementSimilarity has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MallocFixedPageSize.BeginCheckpoint (cognitive 26) libs/storage/Tsavorite/cs/src/core/Allocator/MallocFixedPageSize.cs:493— MallocFixedPageSize.BeginCheckpoint has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KvBenchmark.CreateDevice (cognitive 26) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvBenchmark.Setup.cs:79— KvBenchmark.CreateDevice has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ConcurrentDictionary_YcsbBenchmark.RunYcsb (cognitive 26) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ConcurrentDictionaryBenchmark.cs:80— ConcurrentDictionary_YcsbBenchmark.RunYcsb has cognitive complexity 26 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespPerfBench.MGetThreadRunner (cognitive 25) benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:551— RespPerfBench.MGetThreadRunner has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterConfig.MergeSlotMap (cognitive 25) libs/cluster/Server/ClusterConfig.cs:1217— ClusterConfig.MergeSlotMap has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RedisConfigSerializer.Deserialize (cognitive 25) libs/host/Configuration/Redis/RedisConfigSerializer.cs:60— RedisConfigSerializer.Deserialize has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiDatabaseManager.TakeCheckpointAsync (cognitive 25) libs/server/Databases/MultiDatabaseManager.cs:164— MultiDatabaseManager.TakeCheckpointAsync has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ListObject.ListRange (cognitive 25) libs/server/Objects/List/ListObjectImpl.cs:129— ListObject.ListRange has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkDebug (cognitive 25) libs/server/Resp/AdminCommands.cs:728— RespServerSession.NetworkDebug has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.FlushDb (cognitive 25) libs/server/Resp/BasicCommands.cs:1864— RespServerSession.FlushDb has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespCommandsInfo.TryInitializeRespCommandsInfo (cognitive 25) libs/server/Resp/RespCommandsInfo.cs:137— RespCommandsInfo.TryInitializeRespCommandsInfo has cognitive complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorManager.QueueVectorReplay (cognitive 25) libs/server/Resp/Vector/VectorManager.Replication.cs:519— VectorManager.QueueVectorReplay has cognitive complexity 25 (threshold 15). Most of this is not in the body itself: 6 of the 25 points are its own statements and the rest belongs to 3 function items inside it that branch (StartReplicaTaskAsync, ApplyVectorSetReplay, StartReplicationReplayTasks). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
StorageSession.StringBitOperation (cognitive 25) libs/server/Storage/Session/MainStore/BitmapOps.cs:70— StorageSession.StringBitOperation has cognitive complexity 25 (threshold 15). Of this number, 24 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MallocFixedPageSize.InternalAllocate (cognitive 25) libs/storage/Tsavorite/cs/src/core/Allocator/MallocFixedPageSize.cs:351— MallocFixedPageSize.InternalAllocate has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteKV.CreateNewRecordUpsert (cognitive 25) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:297— TsavoriteKV.CreateNewRecordUpsert has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlobManager.PerformWithRetriesAsync (cognitive 25) libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/StorageOperations.cs:14— BlobManager.PerformWithRetriesAsync has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
JsonPath.TryParseArrayLiteral (cognitive 25) modules/GarnetJSON/JSONPath/JsonPath.cs:900— JsonPath.TryParseArrayLiteral has cognitive complexity 25 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ScanMultipleFilter.ExecuteFilter (cognitive 25) modules/GarnetJSON/JSONPath/ScanMultipleFilter.cs:32— ScanMultipleFilter.ExecuteFilter has cognitive complexity 25 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
BitOp.__bitop_multikey_simdX256_and (cognitive 25) playground/Bitmap/BitOp.cs:1083— BitOp.__bitop_multikey_simdX256_and has cognitive complexity 25 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ClusterConfig.MergeWorkerInfo (cognitive 24) libs/cluster/Server/ClusterConfig.cs:1152— ClusterConfig.MergeWorkerInfo has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterSession.NetworkClusterReplicate (cognitive 24) libs/cluster/Session/RespClusterReplicationCommands.cs:53— ClusterSession.NetworkClusterReplicate has cognitive complexity 24 (threshold 15). 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.
GarnetAppendOnlyFile.ComputeAofSyncReplayAddress (cognitive 24) libs/server/AOF/GarnetAppendOnlyFile.cs:160— GarnetAppendOnlyFile.ComputeAofSyncReplayAddress has cognitive complexity 24 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
GlobUtils.Match (cognitive 24) libs/server/GlobUtils.cs:21— GlobUtils.Match has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuaRunner.UnsafeRunPreambleForRunner (cognitive 24) libs/server/Lua/LuaRunner.Functions.cs:58— LuaRunner.UnsafeRunPreambleForRunner has cognitive complexity 24 (threshold 15). Of this number, 23 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.
LuaRunner.StructPack::TryEncodeInteger (cognitive 24) libs/server/Lua/LuaRunner.Functions.Struct.cs:392— LuaRunner.StructPack::TryEncodeInteger has cognitive complexity 24 (threshold 15). Drivers by points: if/else 15 (22 pts), boolean chains 1, match/switch 1 (nesting depth added 7). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (LuaRunner.StructPack) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
BitmapManager.CheckBitfieldOverflow::CheckSignedBitfieldOverflow (cognitive 24) libs/server/Resp/Bitmap/BitmapManagerBitfield.cs:150— BitmapManager.CheckBitfieldOverflow::CheckSignedBitfieldOverflow has cognitive complexity 24 (threshold 15). Drivers by points: if/else 5 (10 pts), ternaries 4 (8 pts), boolean chains 5, 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.
HyperLogLog.DumpSparseRegs (cognitive 24) libs/server/Resp/HyperLogLog/HyperLogLog.cs:1234— HyperLogLog.DumpSparseRegs has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.ListBlockingPopMultiple (cognitive 24) libs/server/Resp/Objects/ListCommands.cs:847— RespServerSession.ListBlockingPopMultiple has cognitive complexity 24 (threshold 15). 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.
RespServerSession.SimdFastParse (cognitive 24) libs/server/Resp/Parser/RespCommand.cs:948— RespServerSession.SimdFastParse has cognitive complexity 24 (threshold 15). 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. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RangeIndexChunkedSerializer.MoveNext (cognitive 24) libs/server/Resp/RangeIndex/RangeIndexChunkedSerializer.cs:90— RangeIndexChunkedSerializer.MoveNext has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkRISCAN (cognitive 24) libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:342— RespServerSession.NetworkRISCAN has cognitive complexity 24 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RespServerSession.NetworkCONFIG_GET (cognitive 24) libs/server/ServerConfig.cs:32— RespServerSession.NetworkCONFIG_GET has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageSession.ComputeLCSWithIndices (cognitive 24) libs/server/Storage/Session/MainStore/MainStoreOps.cs:690— StorageSession.ComputeLCSWithIndices has cognitive complexity 24 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
StorageSession.ListMove (cognitive 24) libs/server/Storage/Session/ObjectStore/ListOps.cs:212— StorageSession.ListMove has cognitive complexity 24 (threshold 15). 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.
ObjectAllocatorImpl.EvictRecordsInRange (cognitive 24) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:383— ObjectAllocatorImpl.EvictRecordsInRange has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LocalStorageNamedDeviceFactory.Delete (cognitive 24) libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/LocalStorageNamedDeviceFactory.cs:113— LocalStorageNamedDeviceFactory.Delete has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BlobManager.AcquireOwnership (cognitive 24) libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/BlobManager.cs:157— BlobManager.AcquireOwnership has cognitive complexity 24 (threshold 15). Of this number, 18 points are the body's own statements and 6 belong to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ArrayIndexFilter.ExecuteFilterMultiple (cognitive 24) modules/GarnetJSON/JSONPath/ArrayIndexFilter.cs:94— ArrayIndexFilter.ExecuteFilterMultiple has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CommandInfoUpdater.GetUpdatedCommandsInfo (cognitive 24) playground/CommandInfoUpdater/CommandInfoUpdater.cs:240— CommandInfoUpdater.GetUpdatedCommandsInfo has cognitive complexity 24 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientRequestProvider.RunOnlineGarnetClientParallel (cognitive 23) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:381— ClientRequestProvider.RunOnlineGarnetClientParallel has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespOnlineBench.OpRunnerGarnetClientSessionParallel (cognitive 23) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:660— RespOnlineBench.OpRunnerGarnetClientSessionParallel has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespOnlineBench.OpRunnerGarnetClientParallel (cognitive 23) benchmark/Resp.benchmark/OnlineBench/RespOnlineBench.cs:937— RespOnlineBench.OpRunnerGarnetClientParallel has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplicationManager.TryReplicateDisklessSyncAsync (cognitive 23) libs/cluster/Server/Replication/ReplicaOps/ReplicaDisklessSync.cs:25— ReplicationManager.TryReplicateDisklessSyncAsync has cognitive complexity 23 (threshold 15). 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.
ClusterSession.NetworkClusterSync (cognitive 23) libs/cluster/Session/RespClusterReplicationCommands.cs:528— ClusterSession.NetworkClusterSync has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AofChunkedRecordReader.ReadChunk (cognitive 23) libs/server/AOF/AofChunkedRecordReader.cs:155— AofChunkedRecordReader.ReadChunk has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SingleDatabaseManager.RecoverCheckpointAsync (cognitive 23) libs/server/Databases/SingleDatabaseManager.cs:57— SingleDatabaseManager.RecoverCheckpointAsync has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GarnetInfoMetrics.PopulateStatsInfo (cognitive 23) libs/server/Metrics/Info/GarnetInfoMetrics.cs:181— GarnetInfoMetrics.PopulateStatsInfo has cognitive complexity 23 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
HashObject.Scan (cognitive 23) libs/server/Objects/Hash/HashObject.cs:354— HashObject.Scan has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
HashObject.HashRandomField (cognitive 23) libs/server/Objects/Hash/HashObjectImpl.cs:108— HashObject.HashRandomField has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollectionItemBroker.TryGetResult (cognitive 23) libs/server/Objects/ItemBroker/CollectionItemBroker.cs:566— CollectionItemBroker.TryGetResult has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkRESTORE (cognitive 23) libs/server/Resp/KeyAdminCommands.cs:25— RespServerSession.NetworkRESTORE has cognitive complexity 23 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.ListPopMultiple (cognitive 23) libs/server/Resp/Objects/ListCommands.cs:189— RespServerSession.ListPopMultiple has cognitive complexity 23 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.SortedSetRandomMember (cognitive 23) libs/server/Resp/Objects/SortedSetCommands.cs:812— RespServerSession.SortedSetRandomMember has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkRICONFIG (cognitive 23) libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:516— RespServerSession.NetworkRICONFIG has cognitive complexity 23 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.NetworkRIMETRICS (cognitive 23) libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:600— RespServerSession.NetworkRIMETRICS has cognitive complexity 23 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
NativeStorageDevice.Dispose (cognitive 23) libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:1924— NativeStorageDevice.Dispose has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteKV.CreateNewRecordDelete (cognitive 23) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:208— TsavoriteKV.CreateNewRecordDelete has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FreeRecordBin.TryTakeBestFit (cognitive 23) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/Revivification/FreeRecordPool.cs:363— FreeRecordBin.TryTakeBestFit has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
TsavoriteLog.RestoreLatestAsync (cognitive 23) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2958— TsavoriteLog.RestoreLatestAsync has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BitOp.__bitop_multikey_simdX128_and (cognitive 23) playground/Bitmap/BitOp.cs:865— BitOp.__bitop_multikey_simdX128_and has cognitive complexity 23 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. Note what this body is, though: it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
Program.Main (cognitive 23) playground/LightEpochLitmus/Program.cs:21— Program.Main has cognitive complexity 23 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
KvBenchmark.RunWorkers (cognitive 23) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvBenchmark.cs:152— KvBenchmark.RunWorkers has cognitive complexity 23 (threshold 15). 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.
TestLoader.TestLoader.ctor (cognitive 23) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/TestLoader.cs:44— TestLoader.TestLoader.ctor has cognitive complexity 23 (threshold 15). Of this number, 22 points are the body's own statements and 1 belongs to one function item inside it that branches. To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClientRequestProvider.RunOfflineLightClient (cognitive 22) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Offline.cs:365— ClientRequestProvider.RunOfflineLightClient has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientRequestProvider.ExecuteOfflineBatchGarnetSession (cognitive 22) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:380— ClientRequestProvider.ExecuteOfflineBatchGarnetSession has cognitive complexity 22 (threshold 15). 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 5 other methods here (ClientRequestProvider.ExecuteOfflineBatchGarnetClient, ClientRequestProvider.ExecuteOfflineBatchSERedis, ClientRequestProvider.SendOfflineBatchGarnetSession, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ClientRequestProvider.ExecuteOfflineBatchGarnetClient (cognitive 22) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:435— ClientRequestProvider.ExecuteOfflineBatchGarnetClient has cognitive complexity 22 (threshold 15). 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 5 other methods here (ClientRequestProvider.ExecuteOfflineBatchGarnetSession, ClientRequestProvider.ExecuteOfflineBatchSERedis, ClientRequestProvider.SendOfflineBatchGarnetSession, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ClientRequestProvider.ExecuteOfflineBatchSERedis (cognitive 22) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:490— ClientRequestProvider.ExecuteOfflineBatchSERedis has cognitive complexity 22 (threshold 15). 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 5 other methods here (ClientRequestProvider.ExecuteOfflineBatchGarnetSession, ClientRequestProvider.ExecuteOfflineBatchGarnetClient, ClientRequestProvider.SendOfflineBatchGarnetSession, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ClientRequestProvider.SendOfflineBatchGarnetSession (cognitive 22) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:611— ClientRequestProvider.SendOfflineBatchGarnetSession has cognitive complexity 22 (threshold 15). 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 5 other methods here (ClientRequestProvider.ExecuteOfflineBatchGarnetSession, ClientRequestProvider.ExecuteOfflineBatchGarnetClient, ClientRequestProvider.ExecuteOfflineBatchSERedis, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ClientRequestProvider.SendOfflineBatchGarnetClient (cognitive 22) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:664— ClientRequestProvider.SendOfflineBatchGarnetClient has cognitive complexity 22 (threshold 15). 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 5 other methods here (ClientRequestProvider.ExecuteOfflineBatchGarnetSession, ClientRequestProvider.ExecuteOfflineBatchGarnetClient, ClientRequestProvider.ExecuteOfflineBatchSERedis, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ClientRequestProvider.SendOfflineBatchSERedis (cognitive 22) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.WorkerPool.cs:718— ClientRequestProvider.SendOfflineBatchSERedis has cognitive complexity 22 (threshold 15). 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free. This shape REPEATS in the file: 5 other methods here (ClientRequestProvider.ExecuteOfflineBatchGarnetSession, ClientRequestProvider.ExecuteOfflineBatchGarnetClient, ClientRequestProvider.ExecuteOfflineBatchSERedis, …) have the same decision points, in the same order, at the same nesting depths — so this is one pattern written 6 times rather than 6 independent problems. Splitting this body alone leaves the other 5 exactly as they are. Where these are variations on one operation, the change that clears all 6 is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ClusterSession.ProcessPrimaryStream (cognitive 22) libs/cluster/Server/Replication/ReplicaOps/AOFReplay/ReplicaReplaySession.cs:26— ClusterSession.ProcessPrimaryStream has cognitive complexity 22 (threshold 15). 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.
RecoverLogDriver.Consume (cognitive 22) libs/server/AOF/Recover/RecoverLogDriver.cs:93— RecoverLogDriver.Consume has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkSetETagConditional (cognitive 22) libs/server/Resp/BasicEtagCommands.cs:194— RespServerSession.NetworkSetETagConditional has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BitmapManager.BitPosDriver (cognitive 22) libs/server/Resp/Bitmap/BitmapManagerBitPos.cs:21— BitmapManager.BitPosDriver has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AttributeExtractor.ParseArrayToken (cognitive 22) libs/server/Resp/Vector/AttributeExtractor.cs:256— AttributeExtractor.ParseArrayToken has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkVRANDMEMBER (cognitive 22) libs/server/Resp/Vector/RespServerSessionVectors.cs:2117— RespServerSession.NetworkVRANDMEMBER has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StoreWrapper.StoreWrapper.ctor (cognitive 22) libs/server/StoreWrapper.cs:200— StoreWrapper.StoreWrapper.ctor has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AllocatorBase.ShiftBeginAddress (cognitive 22) libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorBase.cs:1719— AllocatorBase.ShiftBeginAddress has cognitive complexity 22 (threshold 15). Of this number, 18 points are the body's own statements and 4 belong to one function literal 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.
TsavoriteKV.CompactScan (cognitive 22) libs/storage/Tsavorite/cs/src/core/Compaction/TsavoriteCompaction.cs:130— TsavoriteKV.CompactScan has cognitive complexity 22 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteLog.CommitInternal (cognitive 22) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:3359— TsavoriteLog.CommitInternal has cognitive complexity 22 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ClientRequestProvider.RunOnlineGarnetClientSession (cognitive 21) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:131— ClientRequestProvider.RunOnlineGarnetClientSession has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterManager.TryPrepareSlotForOwnershipChange (cognitive 21) libs/cluster/Server/ClusterManagerSlotState.cs:330— ClusterManager.TryPrepareSlotForOwnershipChange has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterManager.TryAddReplicaAsync (cognitive 21) libs/cluster/Server/ClusterManagerWorkerState.cs:161— ClusterManager.TryAddReplicaAsync has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GossipVersionNegotiation.ExchangeAsync (cognitive 21) libs/cluster/Server/Gossip/GossipVersionNegotiation.cs:29— GossipVersionNegotiation.ExchangeAsync has cognitive complexity 21 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
ClusterSession.TryParseSlots (cognitive 21) libs/cluster/Session/ClusterCommands.cs:56— ClusterSession.TryParseSlots has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
NumUtils.CountDigits (cognitive 21) libs/common/NumUtils.cs:425— NumUtils.CountDigits has cognitive complexity 21 (threshold 15). 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.
ServerSettingsManager.ConsolidateFlagArguments (cognitive 21) libs/host/ServerSettingsManager.cs:366— ServerSettingsManager.ConsolidateFlagArguments has cognitive complexity 21 (threshold 15). Of this number, 18 points are the body's own statements and 3 belong to one function literal 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.
ModuleUtils.LoadAssemblies (cognitive 21) libs/server/Module/ModuleUtils.cs:200— ModuleUtils.LoadAssemblies has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortedSetObject.Scan (cognitive 21) libs/server/Objects/SortedSet/SortedSetObject.cs:459— SortedSetObject.Scan has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkLCS (cognitive 21) libs/server/Resp/ArrayCommands.cs:417— RespServerSession.NetworkLCS has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ExprCompiler.ParseTuple (cognitive 21) libs/server/Resp/Vector/ExprCompiler.cs:315— ExprCompiler.ParseTuple has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorManager.RunCleanupTaskAsync (cognitive 21) libs/server/Resp/Vector/VectorManager.Cleanup.cs:265— VectorManager.RunCleanupTaskAsync has cognitive complexity 21 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
HeapObjectBase.CacheSerializedObjectData (cognitive 21) libs/storage/Tsavorite/cs/src/core/Allocator/HeapObjectBase.cs:108— HeapObjectBase.CacheSerializedObjectData has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ObjectAllocatorImpl.ClearSerializedObjectData (cognitive 21) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:1502— ObjectAllocatorImpl.ClearSerializedObjectData has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ObjectLogWriter.WriteDirect (cognitive 21) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectSerialization/ObjectLogWriter.cs:171— ObjectLogWriter.WriteDirect has cognitive complexity 21 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MigrateSlotWalk.Run (cognitive 21) playground/MigrateBench/MigrateSlotWalk.cs:41— MigrateSlotWalk.Run has cognitive complexity 21 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ClientRequestProvider.RunOnlineLightClient (cognitive 20) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:48— ClientRequestProvider.RunOnlineLightClient has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AofGen.GeneratePages (cognitive 20) benchmark/Resp.benchmark/OfflineBench/AOFBench/AofGen.cs:335— AofGen.GeneratePages has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespReadResponseUtils.TryReadStringArrayWithLengthHeader (cognitive 20) libs/client/RespReadResponseUtils.cs:161— RespReadResponseUtils.TryReadStringArrayWithLengthHeader has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ReplicaSyncSession.SendCheckpointAsync (cognitive 20) libs/cluster/Server/Replication/PrimaryOps/DiskbasedReplication/ReplicaSyncSession.cs:86— ReplicaSyncSession.SendCheckpointAsync has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespReadUtils.TryReadSignedLengthHeader (cognitive 20) libs/common/RespReadUtils.cs:364— RespReadUtils.TryReadSignedLengthHeader has cognitive complexity 20 (threshold 15). 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
User.AddCategory (cognitive 20) libs/server/ACL/User.cs:106— User.AddCategory has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (User.RemoveCategory) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
User.RemoveCategory (cognitive 20) libs/server/ACL/User.cs:236— User.RemoveCategory has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (User.AddCategory) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
LuaRunner.RunForRunner (cognitive 20) libs/server/Lua/LuaRunner.cs:1193— LuaRunner.RunForRunner has cognitive complexity 20 (threshold 15). Of this number, 12 points are the body's own statements and 8 belong to one function item inside it that branches. To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ListObject.ListRemove (cognitive 20) libs/server/Objects/List/ListObjectImpl.cs:16— ListObject.ListRemove has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SetObject.SetRandomMember (cognitive 20) libs/server/Objects/Set/SetObjectImpl.cs:153— SetObject.SetRandomMember has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.HashRandomField (cognitive 20) libs/server/Resp/Objects/HashCommands.cs:214— RespServerSession.HashRandomField has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorManager.RandomMembers (cognitive 20) libs/server/Resp/Vector/VectorManager.cs:1696— VectorManager.RandomMembers has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (VectorManager.RandomMembers::ProcessResults) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
StorageSession.RangeIndexGet (cognitive 20) libs/server/Storage/Session/MainStore/RangeIndexOps.cs:272— StorageSession.RangeIndexGet has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageSession.RENAME (cognitive 20) libs/server/Storage/Session/UnifiedStore/UnifiedStoreOps.cs:255— StorageSession.RENAME has cognitive complexity 20 (threshold 15). 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.
TsavoriteKV.ConditionalCopyToTail (cognitive 20) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/ConditionalCopyToTail.cs:26— TsavoriteKV.ConditionalCopyToTail has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
AzureStorageDevice.StartAsync (cognitive 20) libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs:156— AzureStorageDevice.StartAsync has cognitive complexity 20 (threshold 15). Of this number, 18 points are the body's own statements and 2 belong to one function literal 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.
GarnetJsonObject.Set (cognitive 20) modules/GarnetJSON/GarnetJsonObject.cs:351— GarnetJsonObject.Set has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BooleanQueryExpression.EqualsWithStrictMatch (cognitive 20) modules/GarnetJSON/JSONPath/QueryExpression.cs:427— BooleanQueryExpression.EqualsWithStrictMatch has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryScanFilter.ExecuteFilter (cognitive 20) modules/GarnetJSON/JSONPath/QueryScanFilter.cs:34— QueryScanFilter.ExecuteFilter has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Program.Main (cognitive 20) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/Program.cs:18— Program.Main has cognitive complexity 20 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClientRequestProvider.RunOnlineGarnetClient (cognitive 19) benchmark/Resp.benchmark/ClusterBench/ClientRequestProvider.Online.cs:310— ClientRequestProvider.RunOnlineGarnetClient has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespPerfBench.LoadDatabaseStringSet (cognitive 19) benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:611— RespPerfBench.LoadDatabaseStringSet has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterManager.TryPrepareSlotsForImport (cognitive 19) libs/cluster/Server/ClusterManagerSlotState.cs:267— ClusterManager.TryPrepareSlotsForImport has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterManager.TryClusterPublishAsync (cognitive 19) libs/cluster/Server/Gossip/Gossip.cs:225— ClusterManager.TryClusterPublishAsync has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReplicationManager.TryReplicateDiskbasedSyncAsync (cognitive 19) libs/cluster/Server/Replication/ReplicaOps/ReplicaDiskbasedSync.cs:31— ReplicationManager.TryReplicateDiskbasedSyncAsync has cognitive complexity 19 (threshold 15). 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.
LightClientRequest.LightReceive (cognitive 19) libs/common/LightClientRequest.cs:118— LightClientRequest.LightReceive has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MultiDatabaseManager.RecoverCheckpointAsync (cognitive 19) libs/server/Databases/MultiDatabaseManager.cs:84— MultiDatabaseManager.RecoverCheckpointAsync has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.TryEVALSHA (cognitive 19) libs/server/Lua/LuaCommands.cs:16— RespServerSession.TryEVALSHA has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.NetworkLatencyReset (cognitive 19) libs/server/Metrics/Latency/RespLatencyCommands.cs:86— RespServerSession.NetworkLatencyReset has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GarnetObjectBase.ReadScanInput (cognitive 19) libs/server/Objects/Types/GarnetObjectBase.cs:119— GarnetObjectBase.ReadScanInput has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkCOMMAND_DOCS (cognitive 19) libs/server/Resp/BasicCommands.cs:1240— RespServerSession.NetworkCOMMAND_DOCS has cognitive complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.NetworkAUTH (cognitive 19) libs/server/Resp/BasicCommands.cs:1545— RespServerSession.NetworkAUTH has cognitive complexity 19 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.NetworkSETWITHETAG (cognitive 19) libs/server/Resp/BasicEtagCommands.cs:142— RespServerSession.NetworkSETWITHETAG has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.NetworkCLIENTKILL::IsMatch (cognitive 19) libs/server/Resp/ClientCommands.cs:416— RespServerSession.NetworkCLIENTKILL::IsMatch has cognitive complexity 19 (threshold 15). Drivers by points: if/else 11 (14 pts), ternaries 1 (3 pts), boolean chains 2 (nesting depth added 5). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (RespServerSession.NetworkCLIENTKILL) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespServerSession.MakeUpperCase (cognitive 19) libs/server/Resp/RespServerSession.cs:831— RespServerSession.MakeUpperCase has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
UnifiedSessionFunctions.GetRMWModifiedFieldInfo (cognitive 19) libs/server/Storage/Functions/UnifiedStore/VarLenInputMethods.cs:15— UnifiedSessionFunctions.GetRMWModifiedFieldInfo has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageSession.HyperLogLogLength (cognitive 19) libs/server/Storage/Session/MainStore/HyperLogLogOps.cs:88— StorageSession.HyperLogLogLength has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteKVIterator.GetNext (cognitive 19) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/TsavoriteIterator.cs:114— TsavoriteKVIterator.GetNext has cognitive complexity 19 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TaskScaling.ShortRunningTask (cognitive 19) playground/GarnetClientStress/TaskScaling.cs:191— TaskScaling.ShortRunningTask has cognitive complexity 19 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
StoreScan.Reader (cognitive 18) libs/cluster/Server/Migration/MigrateScanFunctions.cs:28— StoreScan.Reader has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
CheckpointStore.DeleteOutdatedCheckpoints (cognitive 18) libs/cluster/Server/Replication/CheckpointStore.cs:175— CheckpointStore.DeleteOutdatedCheckpoints has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ReaderWriterLock.WaitForGrant (cognitive 18) libs/common/ReaderWriterLock.cs:140— ReaderWriterLock.WaitForGrant has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AofReplayCoordinator.AddOrReplayTransactionOperation (cognitive 18) libs/server/AOF/ReplayCoordinator/AofReplayCoordinator.cs:147— AofReplayCoordinator.AddOrReplayTransactionOperation has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RuntimeServerConfig.TrySet (cognitive 18) libs/server/Config/RuntimeServerConfig.cs:381— RuntimeServerConfig.TrySet has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
CollectionItemBroker.TryAssignItemFromKey (cognitive 18) libs/server/Objects/ItemBroker/CollectionItemBroker.cs:304— CollectionItemBroker.TryAssignItemFromKey has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ListObject.ReadListPositionInput (cognitive 18) libs/server/Objects/List/ListObjectImpl.cs:464— ListObject.ReadListPositionInput has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortedSetObject.SortedSetCount (cognitive 18) libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:294— SortedSetObject.SortedSetCount has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkStringBitCount (cognitive 18) libs/server/Resp/Bitmap/BitmapCommands.cs:206— RespServerSession.NetworkStringBitCount has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.HashSet (cognitive 18) libs/server/Resp/Objects/HashCommands.cs:24— RespServerSession.HashSet has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.HashExpire (cognitive 18) libs/server/Resp/Objects/HashCommands.cs:582— RespServerSession.HashExpire has cognitive complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.SetRandomMember (cognitive 18) libs/server/Resp/Objects/SetCommands.cs:631— RespServerSession.SetRandomMember has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.SortedSetExpire (cognitive 18) libs/server/Resp/Objects/SortedSetCommands.cs:1741— RespServerSession.SortedSetExpire has cognitive complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.GeoSearchCommands (cognitive 18) libs/server/Resp/Objects/SortedSetGeoCommands.cs:216— RespServerSession.GeoSearchCommands has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.FastParseCommand (cognitive 18) libs/server/Resp/Parser/RespCommand.cs:821— RespServerSession.FastParseCommand has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, it works in explicit hardware vector and instruction-set types, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. A kernel divided across a call boundary passes its vectors between the parts and depends on the runtime putting them back together, so the division can cost more than the complexity it removes. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RespServerSession.NetworkRISET (cognitive 18) libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:196— RespServerSession.NetworkRISET has cognitive complexity 18 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespCommandDocs.ToRespFormat (cognitive 18) libs/server/Resp/RespCommandDocs.cs:212— RespCommandDocs.ToRespFormat has cognitive complexity 18 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
RespServerSession.NetworkVLINKS (cognitive 18) libs/server/Resp/Vector/RespServerSessionVectors.cs:2013— RespServerSession.NetworkVLINKS has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
VectorManager.PrepareVectorData (cognitive 18) libs/server/Resp/Vector/VectorManager.ElementData.cs:89— VectorManager.PrepareVectorData has cognitive complexity 18 (threshold 15). Most of this is not in the body itself: 7 of the 18 points are its own statements and the rest belongs to 7 function items inside it that branch (ConvertF32ToU8, ConvertI8ToU8, ConvertF32ToI8, …). Those helpers are already separate functions, so extracting the branching again is not available. To reduce it, move them out of the body to the enclosing scope, where each is measured, reviewed and tested on its own, and reduce whichever one then reads as the largest.
StorageSession.ProcessRespIntegerArrayOutput (cognitive 18) libs/server/Storage/Session/ObjectStore/Common.cs:409— StorageSession.ProcessRespIntegerArrayOutput has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (StorageSession.ProcessRespInt64ArrayOutput) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
StorageSession.ProcessRespInt64ArrayOutput (cognitive 18) libs/server/Storage/Session/ObjectStore/Common.cs:477— StorageSession.ProcessRespInt64ArrayOutput has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (StorageSession.ProcessRespIntegerArrayOutput) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
StorageSession.SetIntersect (cognitive 18) libs/server/Storage/Session/ObjectStore/SetOps.cs:442— StorageSession.SetIntersect has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StoreWrapper.ScheduledCheckpointTaskAsync (cognitive 18) libs/server/StoreWrapper.cs:727— StoreWrapper.ScheduledCheckpointTaskAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkEXEC (cognitive 18) libs/server/Transaction/TxnRespCommands.cs:38— RespServerSession.NetworkEXEC has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AllocatorBase.ConditionalScanPush (cognitive 18) libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorScan.cs:282— AllocatorBase.ConditionalScanPush has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ObjectAllocatorImpl.OnDispose (cognitive 18) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectAllocatorImpl.cs:324— ObjectAllocatorImpl.OnDispose has cognitive complexity 18 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ObjectLogReader.Read (cognitive 18) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectSerialization/ObjectLogReader.cs:144— ObjectLogReader.Read has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteKV.ReinitializeExpiredRecord (cognitive 18) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:693— TsavoriteKV.ReinitializeExpiredRecord has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteKV.FindInReadCache (cognitive 18) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/ReadCache.cs:17— TsavoriteKV.FindInReadCache has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteLog.TsavoriteLog.ctor (cognitive 18) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:218— TsavoriteLog.TsavoriteLog.ctor has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteLog.CommitAsync (cognitive 18) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2056— TsavoriteLog.CommitAsync has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FieldMultipleFilter.ExecuteFilter (cognitive 18) modules/GarnetJSON/JSONPath/FieldMultipleFilter.cs:75— FieldMultipleFilter.ExecuteFilter has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BooleanQueryExpression.IsMatch (cognitive 18) modules/GarnetJSON/JSONPath/QueryExpression.cs:154— BooleanQueryExpression.IsMatch has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
QueryFilter.ExecuteFilter (cognitive 18) modules/GarnetJSON/JSONPath/QueryFilter.cs:66— QueryFilter.ExecuteFilter has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Program.GetDevice (cognitive 18) libs/storage/Tsavorite/cs/benchmark/Device.benchmark/Program.cs:214— Program.GetDevice has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ObjectYcsbBenchmark.SetupYcsbUnsafeContext (cognitive 18) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ObjectYcsbBenchmark.cs:423— ObjectYcsbBenchmark.SetupYcsbUnsafeContext has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ObjectYcsbBenchmark.SetupYcsbSafeContext) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ObjectYcsbBenchmark.SetupYcsbSafeContext (cognitive 18) libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ObjectYcsbBenchmark.cs:471— ObjectYcsbBenchmark.SetupYcsbSafeContext has cognitive complexity 18 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (ObjectYcsbBenchmark.SetupYcsbUnsafeContext) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Program.Main (cognitive 17) benchmark/BDN.benchmark/Program.cs:19— Program.Main has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BaseConfig.BaseConfig.ctor (cognitive 17) benchmark/BDN.benchmark/Program.cs:83— BaseConfig.BaseConfig.ctor has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespPerfBench.LightOperate (cognitive 17) benchmark/Resp.benchmark/OfflineBench/RespPerfBench.cs:327— RespPerfBench.LightOperate has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Options.ParseSize (cognitive 17) benchmark/Resp.benchmark/Options.cs:188— Options.ParseSize has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GarnetClient.ProcessReplyAsString (cognitive 17) libs/client/GarnetClientProcessReplies.cs:19— GarnetClient.ProcessReplyAsString has cognitive complexity 17 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
NetworkWriter.AsyncFlushPages (cognitive 17) libs/client/NetworkWriter.cs:281— NetworkWriter.AsyncFlushPages has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterManager.TryPrepareSlotsForMigration (cognitive 17) libs/cluster/Server/ClusterManagerSlotState.cs:146— ClusterManager.TryPrepareSlotsForMigration has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FailoverSession.WaitForFirstReplicaSyncAsync (cognitive 17) libs/cluster/Server/Failover/PrimaryFailoverSession.cs:31— FailoverSession.WaitForFirstReplicaSyncAsync has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterSession.NetworkClusterSetConfigEpoch (cognitive 17) libs/cluster/Session/RespClusterBasicCommands.cs:293— ClusterSession.NetworkClusterSetConfigEpoch has cognitive complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ClusterSession.NetworkClusterAppendLog (cognitive 17) libs/cluster/Session/RespClusterReplicationCommands.cs:177— ClusterSession.NetworkClusterAppendLog has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ClusterSession.NetworkClusterSetSlotsRange (cognitive 17) libs/cluster/Session/RespClusterSlotManagementCommands.cs:516— ClusterSession.NetworkClusterSetSlotsRange has cognitive complexity 17 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
Format.TryCreateEndpoint (cognitive 17) libs/common/Format.cs:91— Format.TryCreateEndpoint has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (Format.TryCreateEndpointAsync) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
Format.TryCreateEndpointAsync (cognitive 17) libs/common/Format.cs:166— Format.TryCreateEndpointAsync has cognitive complexity 17 (threshold 15). Of this number, 16 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. This shape REPEATS in the file: one other method here (Format.TryCreateEndpoint) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
RespMemoryWriter.ReallocateOutput (cognitive 17) libs/common/RespMemoryWriter.cs:504— RespMemoryWriter.ReallocateOutput has cognitive complexity 17 (threshold 15). 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. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RespServerSession.NetworkIncrement (cognitive 17) libs/server/Resp/BasicCommands.cs:865— RespServerSession.NetworkIncrement has cognitive complexity 17 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
RespServerSession.NetworkASYNC (cognitive 17) libs/server/Resp/BasicCommands.cs:1725— RespServerSession.NetworkASYNC has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.SetIntersectLength (cognitive 17) libs/server/Resp/Objects/SetCommands.cs:158— RespServerSession.SetIntersectLength has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.SortedSetLengthByValue (cognitive 17) libs/server/Resp/Objects/SortedSetCommands.cs:585— RespServerSession.SortedSetLengthByValue has cognitive complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.SortedSetIntersectLength (cognitive 17) libs/server/Resp/Objects/SortedSetCommands.cs:1170— RespServerSession.SortedSetIntersectLength has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.SortedSetTimeToLive (cognitive 17) libs/server/Resp/Objects/SortedSetCommands.cs:1843— RespServerSession.SortedSetTimeToLive has cognitive complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.GeoAdd (cognitive 17) libs/server/Resp/Objects/SortedSetGeoCommands.cs:19— RespServerSession.GeoAdd has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.GeoCommands (cognitive 17) libs/server/Resp/Objects/SortedSetGeoCommands.cs:115— RespServerSession.GeoCommands has cognitive complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.NetworkSUBSCRIBE (cognitive 17) libs/server/Resp/PubSubCommands.cs:182— RespServerSession.NetworkSUBSCRIBE has cognitive complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.NetworkRIRANGE (cognitive 17) libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:420— RespServerSession.NetworkRIRANGE has cognitive complexity 17 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
ServerOptions.ParseSize (cognitive 17) libs/server/Servers/ServerOptions.cs:230— ServerOptions.ParseSize has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SessionParseStateExtensions.TryGetInfoMetricsType (cognitive 17) libs/server/SessionParseStateExtensions.cs:25— SessionParseStateExtensions.TryGetInfoMetricsType has cognitive complexity 17 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
MainSessionFunctions.Reader (cognitive 17) libs/server/Storage/Functions/MainStore/ReadMethods.cs:16— MainSessionFunctions.Reader has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
MainSessionFunctions.HandleSetIfMatchInPlaceUpdate (cognitive 17) libs/server/Storage/Functions/MainStore/RMWMethods.Etags.cs:54— MainSessionFunctions.HandleSetIfMatchInPlaceUpdate has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
StorageSession.DbScan (cognitive 17) libs/server/Storage/Session/Common/ArrayKeyIterationFunctions.cs:50— StorageSession.DbScan has cognitive complexity 17 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages.
TsavoriteKV.ContinuePendingRMW (cognitive 17) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/ContinuePending.cs:231— TsavoriteKV.ContinuePendingRMW has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteLog.SerialCommitCallbackWorker (cognitive 17) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2825— TsavoriteLog.SerialCommitCallbackWorker has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
TsavoriteLogScanIterator.GetNext (cognitive 17) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:229— TsavoriteLogScanIterator.GetNext has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GarnetJsonObject.TryGet (cognitive 17) modules/GarnetJSON/GarnetJsonObject.cs:283— GarnetJsonObject.TryGet has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BitOp.__bitop_multikey_scalar_and (cognitive 17) playground/Bitmap/BitOp.cs:780— BitOp.__bitop_multikey_scalar_and has cognitive complexity 17 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
BuggyLightEpoch.ToString (cognitive 17) playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:699— BuggyLightEpoch.ToString has cognitive complexity 17 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GarnetClient.ProcessReplyAsMemoryByte (cognitive 16) libs/client/GarnetClientProcessReplies.cs:147— GarnetClient.ProcessReplyAsMemoryByte has cognitive complexity 16 (threshold 15). The drivers above price the dispatch low by construction — a dispatch is charged once however many cases it lists, while each branch inside an arm is charged in full — so most of this count is what the case bodies hold, and the arms are where it can be reduced. To reduce it, keep the dispatch but shrink the arms: move each non-trivial case body into its own named function (or onto the value being matched) so the dispatch reads one line per case, and group related cases into a sub-dispatch. Keep every case explicit, and make the behaviour for cases you do not list a deliberate choice rather than an accident.
RespReadResponseUtils.TryReadStringArrayWithLengthHeader (cognitive 16) libs/client/RespReadResponseUtils.cs:211— RespReadResponseUtils.TryReadStringArrayWithLengthHeader has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ClusterSession.NetworkClusterCountKeysInSlot (cognitive 16) libs/cluster/Session/RespClusterSlotManagementCommands.cs:132— ClusterSession.NetworkClusterCountKeysInSlot has cognitive complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
ClusterSession.NetworkClusterGetKeysInSlot (cognitive 16) libs/cluster/Session/RespClusterSlotManagementCommands.cs:337— ClusterSession.NetworkClusterGetKeysInSlot has cognitive complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
HashUtils.MurmurHash3x128 (cognitive 16) libs/common/HashUtils.cs:109— HashUtils.MurmurHash3x128 has cognitive complexity 16 (threshold 15). To reduce it, split the body: this score is breadth rather than depth — many checks laid out side by side rather than nested inside one another, so inverting conditions into early returns has nothing left to flatten. Group the statements between the checks into named steps and move each step into its own function, so the body reads as a short sequence of named stages. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
LimitedFixedBufferPool.Dispose (cognitive 16) libs/common/Memory/LimitedFixedBufferPool.cs:320— LimitedFixedBufferPool.Dispose has cognitive complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RespReadUtils.TryReadUInt64 (cognitive 16) libs/common/RespReadUtils.cs:53— RespReadUtils.TryReadUInt64 has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
RedisConfigSerializer.TryPopulateOptions (cognitive 16) libs/host/Configuration/Redis/RedisConfigSerializer.cs:182— RedisConfigSerializer.TryPopulateOptions has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
GarnetServer.ValidateCustomCommandACLs (cognitive 16) libs/host/GarnetServer.cs:354— GarnetServer.ValidateCustomCommandACLs has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
AofProcessor.StoreRMW (cognitive 16) libs/server/AOF/AofProcessor.cs:573— AofProcessor.StoreRMW has cognitive complexity 16 (threshold 15). 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.
LuaRunner.Bitop (cognitive 16) libs/server/Lua/LuaRunner.Functions.cs:985— LuaRunner.Bitop has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuaRunner.StructSize (cognitive 16) libs/server/Lua/LuaRunner.Functions.Struct.cs:989— LuaRunner.StructSize has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
LuaRunner.PrepareLoaderBlockBytes (cognitive 16) libs/server/Lua/LuaRunner.Loader.cs:378— LuaRunner.PrepareLoaderBlockBytes has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.NetworkLatencyHistogram (cognitive 16) libs/server/Metrics/Latency/RespLatencyCommands.cs:40— RespServerSession.NetworkLatencyHistogram has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
ModuleUtils.LoadModuleDependencies (cognitive 16) libs/server/Module/ModuleUtils.cs:87— ModuleUtils.LoadModuleDependencies has cognitive complexity 16 (threshold 15). Of this number, 15 points are the body's own statements and 1 belongs to one function literal inside it that branches. To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
SortedSetObject.CopyDiff (cognitive 16) libs/server/Objects/SortedSet/SortedSetObject.cs:537— SortedSetObject.CopyDiff has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SortedSetObject.SortedSetTimeToLive (cognitive 16) libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:898— SortedSetObject.SortedSetTimeToLive has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
SubscribeBroker.Broadcast (cognitive 16) libs/server/PubSub/SubscribeBroker.cs:77— SubscribeBroker.Broadcast has cognitive complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
RespServerSession.NetworkModuleLoad (cognitive 16) libs/server/Resp/AdminCommands.cs:571— RespServerSession.NetworkModuleLoad has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
RespServerSession.ArrayParseCommand (cognitive 16) libs/server/Resp/Parser/RespCommand.cs:1287— RespServerSession.ArrayParseCommand has cognitive complexity 16 (threshold 15). 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.
RespServerSession.NetworkVISMEMBER (cognitive 16) libs/server/Resp/Vector/RespServerSessionVectors.cs:1956— RespServerSession.NetworkVISMEMBER has cognitive complexity 16 (threshold 15). 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.
RespServerSession.NetworkVSETATTR (cognitive 16) libs/server/Resp/Vector/RespServerSessionVectors.cs:2257— RespServerSession.NetworkVSETATTR has cognitive complexity 16 (threshold 15). 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.
VectorManager.RandomMembers::ProcessResults (cognitive 16) libs/server/Resp/Vector/VectorManager.cs:1798— VectorManager.RandomMembers::ProcessResults has cognitive complexity 16 (threshold 15). Drivers by points: if/else 6 (12 pts), loops 2 (4 pts) (nesting depth added 8). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. This shape REPEATS in the file: one other method here (VectorManager.RandomMembers) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
GarnetServerBase.DisposeActiveHandlers (cognitive 16) libs/server/Servers/GarnetServerBase.cs:210— GarnetServerBase.DisposeActiveHandlers has cognitive complexity 16 (threshold 15). To reduce it, break up the iteration: give each loop body a named function, and split a multi-phase loop into one function per phase so no single body carries the whole pipeline.
AllocatorBase.IterateHashChain (cognitive 16) libs/storage/Tsavorite/cs/src/core/Allocator/AllocatorScan.cs:100— AllocatorBase.IterateHashChain has cognitive complexity 16 (threshold 15). To reduce it, flatten the nesting: invert conditions into early returns or guard clauses so the happy path stays at one level, and lift the deepest nested block into its own named function.
TransactionalContext.DoTransactionalTryLock (cognitive 16) libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:100— TransactionalContext.DoTransactionalTryLock has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
ShardedStorageDevice.WriteAsync (cognitive 16) libs/storage/Tsavorite/cs/src/core/Device/ShardedStorageDevice.cs:206— ShardedStorageDevice.WriteAsync has cognitive complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 232). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This shape REPEATS in the file: one other method here (ShardedStorageDevice.ReadAsync) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
ShardedStorageDevice.ReadAsync (cognitive 16) libs/storage/Tsavorite/cs/src/core/Device/ShardedStorageDevice.cs:289— ShardedStorageDevice.ReadAsync has cognitive complexity 16 (threshold 15). Most of this is not in the body itself: 6 of the 16 points are its own statements and the rest belongs to one function literal inside it that branches (line 313). The decisions are inside the literal, which nothing outside this body can call, review or test on its own, so splitting the enclosing body is not the move available here. To reduce it, lift the literal's work into a named function or method at the enclosing scope and have the literal call it, then reduce whichever part then reads as the largest. This shape REPEATS in the file: one other method here (ShardedStorageDevice.WriteAsync) has the same decision points, in the same order, at the same nesting depths — so this is one pattern written twice rather than two separate problems. Splitting this body alone leaves the other exactly as it is. Where these are variations on one operation, the change that clears both is the shared one: lift the common shape into a single routine the variants call, parameterised by whatever genuinely differs between them, and keep in each method only the part that is not shared.
TsavoriteKV.TsavoriteKV.ctor (cognitive 16) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Tsavorite.cs:211— TsavoriteKV.TsavoriteKV.ctor has cognitive complexity 16 (threshold 15). 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.
TsavoriteBase.FindOtherSlotForThisTagMaybeTentativeInternal (cognitive 16) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/TsavoriteBase.cs:474— TsavoriteBase.FindOtherSlotForThisTagMaybeTentativeInternal has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body. Note what this body is, though: it carries an aggressive-inlining request, so its author has asked in the source for this body to be inlined into every caller, and it works in raw pointers or stack-allocated memory, whose lifetime is this stack frame. Each part pulled out of it becomes a call the runtime has to decide to inline again, against a size budget — so the split can quietly turn one inlined body into several real calls, on the path the marker exists to protect. Anything extracted from it has to take that memory as a parameter rather than reach for it. The measurement stands — a hot path is not a licence to be unreadable — but the move that pays here is to lift the COLD parts out first (argument validation, fallback and error paths, one-off setup) and leave the kernel whole. Where the kernel itself has to be divided, ask for the extracted parts to be inlined as well, and measure the result rather than assuming the division is free.
SectorAlignedBufferPool.SealAndDrainShard (cognitive 16) libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.OriginReturn.cs:953— SectorAlignedBufferPool.SealAndDrainShard has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
FieldFilter.ExecuteFilter (cognitive 16) modules/GarnetJSON/JSONPath/FieldFilter.cs:37— FieldFilter.ExecuteFilter has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
BuggyLightEpoch.BumpCurrentEpoch (cognitive 16) playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:396— BuggyLightEpoch.BumpCurrentEpoch has cognitive complexity 16 (threshold 15). To reduce it, split the body into named stages: move each independent step or branch into its own named function so the body reads as a short sequence of named calls rather than one long body.
Change-coupling hub: ReplicationManager.cs → ClusterManagerWorkerState.cs, ReplicaFailoverSession.cs, ReplicaSyncSession.cs libs/cluster/Server/Replication/ReplicationManager.cs— `libs/cluster/Server/Replication/ReplicationManager.cs` changes together with 3 other files — `libs/cluster/Server/ClusterManagerWorkerState.cs`, `libs/cluster/Server/Failover/ReplicaFailoverSession.cs`, `libs/cluster/Server/Replication/PrimaryOps/DiskbasedReplication/ReplicaSyncSession.cs` — none of which declares a dependency on it: one file is the hub of 3 separate couplings, not 3 unrelated pairs. Read the hub first: if the others each duplicate a part of what it does, the shared concern belongs in ONE unit and extracting it clears every edge at once; if the hub is a registry, dispatcher or barrel that must name each of them, the coupling is structural and the question is whether that list can be discovered instead of enumerated. Fixing the hub is one change; breaking the couplings one pair at a time is 3.
D4 · Code Duplication· Near-duplicate member family (4 members, 88 shared lines) · ×1
Near-duplicate member family (4 members, 88 shared lines) playground/Bitmap/BitOp.cs:106— playground/Bitmap/BitOp.cs:106-210 | playground/Bitmap/BitOp.cs:213-409 | playground/Bitmap/BitOp.cs:412-579 | playground/Bitmap/BitOp.cs:582-778 — These 4 members are variants of one another: a block of 88 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (4 members, 83 shared lines) · ×1
Near-duplicate member family (4 members, 83 shared lines) libs/client/GarnetClient.cs:678— libs/client/GarnetClient.cs:678-788 | libs/client/GarnetClient.cs:791-902 | libs/client/GarnetClient.cs:999-1106 | libs/client/GarnetClient.cs:1117-1221 — These 4 members are variants of one another: a block of 83 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 4 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 4 times.
D4 · Code Duplication· Near-duplicate member family (3 members, 21 shared lines) · ×1
Near-duplicate member family (3 members, 21 shared lines) libs/server/Resp/Vector/VectorManager.Filter.cs:104— libs/server/Resp/Vector/VectorManager.Filter.cs:104-183 | libs/server/Resp/Vector/VectorManager.cs:961-1157 | libs/server/Resp/Vector/VectorManager.cs:1177-1350 — These 3 members are variants of one another: a block of 21 lines reported below appears in every one of them, and the pairwise near-duplicate rows they would otherwise produce are collapsed into this row. Read them as one construct written 3 times. The repair is at the members' grain — factor the shared implementation out once and have all of them call it with their differences as parameters or as an injected step, or, where the difference is systematic, generate them from one template. Extracting the individual blocks below is not the same fix: it leaves every body in place and the next edit still has to be made 3 times.
Near-duplicate member pair (50 shared lines) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:56— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:56-250 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:54-195 — These two members are variants of one another: 50 of their lines are already reported as duplicated blocks below, spread through both bodies rather than gathered into one. Read them as a single construct written twice. The repair is at the members' grain — factor the shared pipeline into one implementation the two call with their differences as parameters or as an injected step, or, where the difference is systematic (sync against async, one transport against another), generate one from the other. Extracting the individual blocks below is not the same fix: it leaves the two bodies in place and the next edit still has to be made twice.
D4 · Code Duplication· Members sharing a duplicated core (14 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (14 members, 50+ identical tokens) libs/server/Resp/Objects/HashCommands.cs:308— libs/server/Resp/Objects/HashCommands.cs:308-342 | libs/server/Resp/Objects/HashCommands.cs:352-384 | libs/server/Resp/Objects/HashCommands.cs:394-426 | libs/server/Resp/Objects/HashCommands.cs:436-467 | libs/server/Resp/Objects/ListCommands.cs:604-639 | libs/server/Resp/Objects/ListCommands.cs:649-693 | libs/server/Resp/Objects/SetCommands.cs:317-351 | libs/server/Resp/Objects/SetCommands.cs:361-395 | libs/server/Resp/Objects/SetCommands.cs:586-619 | libs/server/Resp/Objects/SortedSetCommands.cs:61-92 | libs/server/Resp/Objects/SortedSetCommands.cs:102-135 | libs/server/Resp/Objects/SortedSetCommands.cs:538-572 | libs/server/Resp/Objects/SortedSetCommands.cs:587-640 | libs/server/Resp/Objects/SortedSetCommands.cs:763-804 — These 14 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 14 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 14 times.
D4 · Code Duplication· Members sharing a duplicated core (13 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (13 members, 50+ identical tokens) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1086— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1086-1108 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1118-1141 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1153-1179 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1188-1211 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1223-1250 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1260-1282 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1289-1315 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1323-1349 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1362-1390 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1399-1422 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1525-1561 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1575-1613 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1624-1658 — These 13 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 13 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 13 times.
D4 · Code Duplication· Members sharing a duplicated core (10 members, 50+ identical tokens) · ×1
Members sharing a duplicated core (10 members, 50+ identical tokens) libs/client/ClientSession/GarnetClientSession.cs:521— libs/client/ClientSession/GarnetClientSession.cs:521-600 | libs/client/ClientSession/GarnetClientSessionMigrationExtensions.cs:89-163 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:39-111 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:121-176 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:188-260 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:271-341 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:361-441 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:450-490 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:558-600 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:613-687 — 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 (79 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:205— libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:205-283 | libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs:204-282 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 236 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:205` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20–78 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctions.cs:167— libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctions.cs:167-244 | libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctionsWrapper.cs:41-60 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctions.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctionsWrapper.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (76–77 lines × 3) playground/Bitmap/BitOp.cs:787— playground/Bitmap/BitOp.cs:787-863 | playground/Bitmap/BitOp.cs:1006-1081 | playground/Bitmap/BitOp.cs:1226-1301 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitOp.cs:787` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (21–76 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctions.cs:259— libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctions.cs:259-334 | libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctionsWrapper.cs:65-85 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctions.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctionsWrapper.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (56–57 lines × 2) libs/server/Resp/Vector/RespServerSessionVectors.cs:1308— libs/server/Resp/Vector/RespServerSessionVectors.cs:1308-1364 | libs/server/Resp/Vector/RespServerSessionVectors.cs:1451-1506 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/RespServerSessionVectors.cs:1308` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (55 lines × 2) libs/client/LightEpoch.cs:99— libs/client/LightEpoch.cs:99-153 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:112-166 — before extracting anything, compare `libs/client/LightEpoch.cs` and `playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs` as WHOLE FILES: this scan already matched 15 separate duplicated blocks between them, totalling at least 326 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 (51–54 lines × 2) libs/server/Lua/LuaRunner.cs:2221— libs/server/Lua/LuaRunner.cs:2221-2274 | libs/server/Lua/LuaRunner.cs:2308-2358 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.cs:2221` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (9–51 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctions.cs:22— libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctions.cs:22-72 | libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctionsWrapper.cs:20-28 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctions.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctionsWrapper.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 205 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (49–50 lines × 3) libs/server/Storage/Session/ObjectStore/SetOps.cs:390— libs/server/Storage/Session/ObjectStore/SetOps.cs:390-439 | libs/server/Storage/Session/ObjectStore/SetOps.cs:561-610 | libs/server/Storage/Session/ObjectStore/SetOps.cs:829-877 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SetOps.cs:390` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (42 lines × 3) libs/server/Resp/Vector/DiskANNService.cs:236— libs/server/Resp/Vector/DiskANNService.cs:236-277 | libs/server/Resp/Vector/DiskANNService.cs:324-365 | libs/server/Resp/Vector/DiskANNService.cs:404-445 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/DiskANNService.cs:236` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Resp/Vector/DiskANNService.cs:231` calls `AsPointer`, `GetReference` and `libs/server/Resp/Vector/DiskANNService.cs:400` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (40–47 lines × 2) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:3009— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:3009-3048 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:3101-3147 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:3009` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (43 lines × 2) libs/server/Lua/LuaRunner.cs:2283— libs/server/Lua/LuaRunner.cs:2283-2325 | libs/server/Lua/LuaRunner.cs:2443-2485 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.cs:2283` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/server/Lua/LuaRunner.cs:2487` calls `Pop` and `libs/server/Lua/LuaRunner.cs:2327` does not — after which the two agree again for 4 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (30 lines × 2) libs/server/Lua/LuaRunner.cs:2404— libs/server/Lua/LuaRunner.cs:2404-2433 | libs/server/Lua/LuaRunner.cs:2482-2511 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.cs:2404` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (43 lines × 4) libs/client/GarnetClient.cs:745— libs/client/GarnetClient.cs:745-787 | libs/client/GarnetClient.cs:858-900 | libs/client/GarnetClient.cs:1062-1104 | libs/client/GarnetClient.cs:1177-1219 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/GarnetClient.cs:745` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (4–43 lines × 3) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:165— libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:165-168 | libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:268-310 | libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:419-461 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (41 lines × 2) libs/server/Resp/Objects/SortedSetCommands.cs:1123— libs/server/Resp/Objects/SortedSetCommands.cs:1123-1163 | libs/server/Resp/Objects/SortedSetCommands.cs:1423-1463 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/SortedSetCommands.cs:1123` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (40–41 lines × 4) libs/client/GarnetClient.cs:699— libs/client/GarnetClient.cs:699-739 | libs/client/GarnetClient.cs:812-852 | libs/client/GarnetClient.cs:1015-1055 | libs/client/GarnetClient.cs:1132-1171 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/GarnetClient.cs:699` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `op` to `Memory<byte>` in one and `string` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (37–41 lines × 2) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:766— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:766-806 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:904-940 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLogScanIterator.cs:766` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (39 lines × 3) libs/client/LightEpoch.cs:677— libs/client/LightEpoch.cs:677-715 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:748-786 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:701-739 — before extracting anything, compare `libs/client/LightEpoch.cs` and `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 184 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (39 lines × 2) libs/client/ClientSession/GarnetClientSession.cs:363— libs/client/ClientSession/GarnetClientSession.cs:363-401 | libs/client/GarnetClient.cs:435-473 — 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. Each matched range is the entire body of the declaration above it, so the region is already a complete unit: move that whole declaration to the shared location and have each site call it, rather than lifting the lines out of their bodies. Any `return` inside it is the body's own exit and keeps its meaning in the moved unit.
Duplicated block (35 lines × 4) playground/Bitmap/BitOp.cs:165— playground/Bitmap/BitOp.cs:165-199 | playground/Bitmap/BitOp.cs:364-398 | playground/Bitmap/BitOp.cs:534-568 | playground/Bitmap/BitOp.cs:733-767 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitOp.cs:165` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (37–39 lines × 2) libs/cluster/Server/Migration/MigrateSessionKeys.cs:77— libs/cluster/Server/Migration/MigrateSessionKeys.cs:77-115 | libs/cluster/Server/Migration/MigrateSessionSlots.cs:132-168 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Server/Migration/MigrateSessionKeys.cs:77` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (38 lines × 3) libs/client/LightEpoch.cs:89— libs/client/LightEpoch.cs:89-126 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:90-127 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:102-139 — before extracting anything, compare `libs/client/LightEpoch.cs` and `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 184 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 (35–36 lines × 2) libs/common/Networking/NetworkHandler.cs:646— libs/common/Networking/NetworkHandler.cs:646-681 | libs/common/Networking/NetworkHandler.cs:723-757 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (32–35 lines × 2) libs/cluster/Session/SlotVerification/ClusterSlotVerify.cs:30— libs/cluster/Session/SlotVerification/ClusterSlotVerify.cs:30-64 | libs/cluster/Session/SlotVerification/ClusterSlotVerify.cs:83-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Session/SlotVerification/ClusterSlotVerify.cs:30` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24–35 lines × 2) libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:1697— libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:1697-1731 | libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:1785-1808 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs:1697` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (33–34 lines × 2) libs/common/Synchronization/ReadOptimizedLock.cs:462— libs/common/Synchronization/ReadOptimizedLock.cs:462-495 | libs/common/Synchronization/ReadOptimizedLock.cs:507-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/common/Synchronization/ReadOptimizedLock.cs:462` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (33 lines × 2) libs/client/ClientSession/GarnetClientSession.cs:527— libs/client/ClientSession/GarnetClientSession.cs:527-559 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:621-653 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once.
Duplicated block (31–32 lines × 2) libs/server/Resp/Vector/VectorManager.cs:1052— libs/server/Resp/Vector/VectorManager.cs:1052-1082 | libs/server/Resp/Vector/VectorManager.cs:1095-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/VectorManager.cs:1052` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (30–31 lines × 3) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:609— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:609-638 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1153-1183 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1411-1441 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:609` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (31 lines × 2) libs/server/Resp/Vector/VectorManager.cs:1249— libs/server/Resp/Vector/VectorManager.cs:1249-1279 | libs/server/Resp/Vector/VectorManager.cs:1292-1322 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/VectorManager.cs:1249` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (28–30 lines × 2) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:173— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:173-200 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:221-250 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:173` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (28–29 lines × 2) libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs:437— libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs:437-465 | libs/storage/Tsavorite/cs/src/devices/AzureStorageDevice/AzureStorageDevice.cs:510-537 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited.
Duplicated block (4–28 lines × 5) playground/Bitmap/BitCount.cs:41— playground/Bitmap/BitCount.cs:41-44 | playground/Bitmap/BitCount.cs:89-92 | playground/Bitmap/BitCount.cs:201-228 | playground/Bitmap/BitCount.cs:345-372 | playground/Bitmap/BitCount.cs:490-517 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitCount.cs:201` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (28 lines × 2) libs/server/Resp/Objects/SortedSetCommands.cs:1290— libs/server/Resp/Objects/SortedSetCommands.cs:1290-1317 | libs/server/Resp/Objects/SortedSetCommands.cs:1389-1416 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/SortedSetCommands.cs:1290` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (24–27 lines × 2) libs/cluster/Server/ClusterManagerSlotState.cs:82— libs/cluster/Server/ClusterManagerSlotState.cs:82-105 | libs/cluster/Server/ClusterManagerSlotState.cs:147-173 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Server/ClusterManagerSlotState.cs:82` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/cluster/Server/ClusterManagerSlotState.cs:175` calls `foreach` and `libs/cluster/Server/ClusterManagerSlotState.cs:107` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (27 lines × 2) libs/common/NumUtils.cs:350— libs/common/NumUtils.cs:350-376 | libs/common/NumUtils.cs:389-415 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/common/NumUtils.cs:350` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (25–26 lines × 2) libs/server/Lua/LuaRunner.Functions.cs:2866— libs/server/Lua/LuaRunner.Functions.cs:2866-2891 | libs/server/Lua/LuaRunner.Functions.cs:2946-2970 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.cs:2866` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (23–26 lines × 2) libs/server/Resp/PubSubCommands.cs:40— libs/server/Resp/PubSubCommands.cs:40-65 | libs/server/Resp/PubSubCommands.cs:87-109 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/PubSubCommands.cs:40` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Resp/PubSubCommands.cs:87` calls `WriteDirectLargeRespString` and `libs/server/Resp/PubSubCommands.cs:40` does not — after which the two agree again for 5 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (23 lines × 4) libs/server/Lua/LuaRunner.cs:2194— libs/server/Lua/LuaRunner.cs:2194-2216 | libs/server/Lua/LuaRunner.cs:2279-2301 | libs/server/Lua/LuaRunner.cs:2363-2385 | libs/server/Lua/LuaRunner.cs:2439-2461 — 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 (25 lines × 4) playground/Bitmap/BitOp.cs:115— playground/Bitmap/BitOp.cs:115-139 | playground/Bitmap/BitOp.cs:309-333 | playground/Bitmap/BitOp.cs:479-503 | playground/Bitmap/BitOp.cs:678-702 — 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 (23–25 lines × 2) libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteAllocatorImpl.cs:55— libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteAllocatorImpl.cs:55-79 | libs/storage/Tsavorite/cs/src/core/Allocator/TsavoriteLogAllocatorImpl.cs:58-80 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteAllocatorImpl.cs` and `libs/storage/Tsavorite/cs/src/core/Allocator/TsavoriteLogAllocatorImpl.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 58 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place.
Duplicated block (22 lines × 6) libs/server/Resp/Objects/HashCommands.cs:650— libs/server/Resp/Objects/HashCommands.cs:650-671 | libs/server/Resp/Objects/HashCommands.cs:737-758 | libs/server/Resp/Objects/HashCommands.cs:796-817 | libs/server/Resp/Objects/SortedSetCommands.cs:1808-1829 | libs/server/Resp/Objects/SortedSetCommands.cs:1898-1919 | libs/server/Resp/Objects/SortedSetCommands.cs:1964-1985 — before extracting anything, compare `libs/server/Resp/Objects/HashCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 196 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/HashCommands.cs:650` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (17–24 lines × 2) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:328— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:328-351 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:256-272 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs` as WHOLE FILES: this scan already matched 8 separate duplicated blocks between them, totalling at least 117 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:328` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22 lines × 4) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2215— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2215-2236 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2327-2348 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2384-2405 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2442-2463 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (22–23 lines × 2) libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:528— libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:528-550 | libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:611-632 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/RangeIndex/RespServerSessionRangeIndex.cs:528` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (21–23 lines × 2) libs/server/Storage/Functions/MainStore/RMWMethods.Etags.cs:84— libs/server/Storage/Functions/MainStore/RMWMethods.Etags.cs:84-106 | libs/server/Storage/Functions/MainStore/RMWMethods.Etags.cs:130-150 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Storage/Functions/MainStore/RMWMethods.Etags.cs:126` calls `MethodImpl`, `HandleSetWithEtagInPlaceUpdate` and `libs/server/Storage/Functions/MainStore/RMWMethods.Etags.cs:81` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (20–22 lines × 3) libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:91— libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:91-110 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:97-118 | libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs:96-117 — before extracting anything, compare `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs` and `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 37 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:91` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (21–22 lines × 2) libs/server/Storage/Session/ObjectStore/Common.cs:247— libs/server/Storage/Session/ObjectStore/Common.cs:247-267 | libs/server/Storage/Session/ObjectStore/Common.cs:380-401 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/Common.cs:247` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (20–22 lines × 2) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2640— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2640-2661 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2673-2692 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:2640` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (21 lines × 3) libs/server/Lua/LuaRunner.cs:1792— libs/server/Lua/LuaRunner.cs:1792-1812 | libs/server/Lua/LuaRunner.cs:1832-1852 | libs/server/Lua/LuaRunner.cs:1872-1893 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.cs:1792` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (17–21 lines × 2) libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.Legacy.cs:71— libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.Legacy.cs:71-91 | libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.OriginReturn.cs:468-484 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single shared function the call sites can all reach — a file they already depend on, or a new one alongside them — and call it from both call sites, so a change lands once. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/Utilities/BufferPool.Legacy.cs:71` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19–20 lines × 6) libs/server/Storage/Session/ObjectStore/SetOps.cs:390— libs/server/Storage/Session/ObjectStore/SetOps.cs:390-409 | libs/server/Storage/Session/ObjectStore/SetOps.cs:561-580 | libs/server/Storage/Session/ObjectStore/SetOps.cs:829-848 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:589-607 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1133-1151 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1391-1409 — before extracting anything, compare `libs/server/Storage/Session/ObjectStore/SetOps.cs` and `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SetOps.cs:390` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. Note first that the copies are not typed on the same thing: the declarations holding them bind `keys` to `PinnedSpanByte[]` in one and `ReadOnlySpan<PinnedSpanByte>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (18 lines × 3) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1528— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1528-1545 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1578-1595 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1627-1644 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1528` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–20 lines × 2) libs/server/Objects/Hash/HashObjectImpl.cs:442— libs/server/Objects/Hash/HashObjectImpl.cs:442-461 | libs/server/Objects/SortedSet/SortedSetObjectImpl.cs:899-909 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Objects/Hash/HashObjectImpl.cs:442` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (19 lines × 10) libs/client/ClientSession/GarnetClientSession.cs:525— libs/client/ClientSession/GarnetClientSession.cs:525-543 | libs/client/ClientSession/GarnetClientSessionMigrationExtensions.cs:93-116 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:43-61 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:125-143 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:192-210 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:281-299 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:365-383 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:454-472 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:559-578 | libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:619-637 — there are 10 copies across 3 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 10 sites; resolving a subset leaves the remainder to drift apart. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs:617` calls `Enqueue` and `libs/client/ClientSession/GarnetClientSession.cs:522` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (18–19 lines × 4) libs/server/Resp/Objects/HashCommands.cs:98— libs/server/Resp/Objects/HashCommands.cs:98-115 | libs/server/Resp/Objects/ListCommands.cs:104-122 | libs/server/Resp/Objects/SortedSetCommands.cs:276-293 | libs/server/Resp/Objects/SortedSetCommands.cs:733-750 — before extracting anything, compare `libs/server/Resp/Objects/HashCommands.cs` and `libs/server/Resp/Objects/ListCommands.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/HashCommands.cs:98` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (19 lines × 4) modules/GarnetJSON/JSONPath/ScanArrayMultipleIndexFilter.cs:50— modules/GarnetJSON/JSONPath/ScanArrayMultipleIndexFilter.cs:50-68 | modules/GarnetJSON/JSONPath/ScanArraySliceFilter.cs:85-103 | modules/GarnetJSON/JSONPath/ScanFilter.cs:42-60 | modules/GarnetJSON/JSONPath/ScanMultipleFilter.cs:37-55 — before extracting anything, compare `modules/GarnetJSON/JSONPath/ScanFilter.cs` and `modules/GarnetJSON/JSONPath/ScanMultipleFilter.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 60 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `modules/GarnetJSON/JSONPath/ScanArrayMultipleIndexFilter.cs:50` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it.
Duplicated block (18–19 lines × 3) libs/server/Resp/Objects/HashCommands.cs:505— libs/server/Resp/Objects/HashCommands.cs:505-522 | libs/server/Resp/Objects/SortedSetCommands.cs:188-206 | libs/server/Resp/Objects/SortedSetCommands.cs:390-408 — before extracting anything, compare `libs/server/Resp/Objects/HashCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 196 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/HashCommands.cs:505` it begins part-way through the construct above it, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (18–19 lines × 2) libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:556— libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:556-573 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1106-1124 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:556` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (3–18 lines × 8) playground/Bitmap/BitOp.cs:141— playground/Bitmap/BitOp.cs:141-158 | playground/Bitmap/BitOp.cs:159-161 | playground/Bitmap/BitOp.cs:338-355 | playground/Bitmap/BitOp.cs:356-358 | playground/Bitmap/BitOp.cs:508-525 | playground/Bitmap/BitOp.cs:526-528 | playground/Bitmap/BitOp.cs:707-724 | playground/Bitmap/BitOp.cs:725-727 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (16–17 lines × 4) libs/server/Storage/Session/ObjectStore/SetOps.cs:347— libs/server/Storage/Session/ObjectStore/SetOps.cs:347-363 | libs/server/Storage/Session/ObjectStore/SetOps.cs:520-536 | libs/server/Storage/Session/ObjectStore/SetOps.cs:788-804 | libs/server/Storage/Session/ObjectStore/SetOps.cs:948-963 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SetOps.cs:347` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note first that the copies are not typed on the same thing: the declarations holding them bind `keys` to `PinnedSpanByte[]` in one and `ReadOnlySpan<PinnedSpanByte>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14–15 lines × 8) libs/server/Resp/Objects/HashCommands.cs:322— libs/server/Resp/Objects/HashCommands.cs:322-336 | libs/server/Resp/Objects/HashCommands.cs:365-379 | libs/server/Resp/Objects/HashCommands.cs:408-421 | libs/server/Resp/Objects/HashCommands.cs:449-462 | libs/server/Resp/Objects/SetCommands.cs:331-345 | libs/server/Resp/Objects/SetCommands.cs:375-389 | libs/server/Resp/Objects/SortedSetCommands.cs:74-87 | libs/server/Resp/Objects/SortedSetCommands.cs:115-129 — before extracting anything, compare `libs/server/Resp/Objects/HashCommands.cs` and `libs/server/Resp/Objects/SortedSetCommands.cs` as WHOLE FILES: this scan already matched 11 separate duplicated blocks between them, totalling at least 196 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/HashCommands.cs:322` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (13–15 lines × 4) playground/Bitmap/BitCount.cs:61— playground/Bitmap/BitCount.cs:61-75 | playground/Bitmap/BitCount.cs:196-208 | playground/Bitmap/BitCount.cs:340-352 | playground/Bitmap/BitCount.cs:485-497 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited.
Duplicated block (15 lines × 3) libs/common/RespReadUtils.cs:722— libs/common/RespReadUtils.cs:722-736 | libs/common/RespReadUtils.cs:785-799 | libs/common/RespReadUtils.cs:892-906 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/common/RespReadUtils.cs:722` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `ptr` to `ref byte*` in one and `scoped ref byte*` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14–15 lines × 3) libs/server/Resp/Vector/VectorManager.Filter.cs:111— libs/server/Resp/Vector/VectorManager.Filter.cs:111-125 | libs/server/Resp/Vector/VectorManager.cs:999-1012 | libs/server/Resp/Vector/VectorManager.cs:1198-1211 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Vector/VectorManager.Filter.cs:111` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Resp/Vector/VectorManager.cs:1194` calls `EnsureDistanceBufferSize`, `EnsureIdBufferSize` and `libs/server/Resp/Vector/VectorManager.cs:991` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (13–15 lines × 3) libs/server/Lua/LuaRunner.Functions.Struct.cs:462— libs/server/Lua/LuaRunner.Functions.Struct.cs:462-476 | libs/server/Lua/LuaRunner.Functions.Struct.cs:478-492 | libs/server/Lua/LuaRunner.Functions.Struct.cs:500-512 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.Functions.Struct.cs:462` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (13–14 lines × 14) libs/server/Resp/Objects/HashCommands.cs:329— libs/server/Resp/Objects/HashCommands.cs:329-342 | libs/server/Resp/Objects/HashCommands.cs:372-384 | libs/server/Resp/Objects/HashCommands.cs:414-426 | libs/server/Resp/Objects/HashCommands.cs:455-467 | libs/server/Resp/Objects/ListCommands.cs:626-639 | libs/server/Resp/Objects/ListCommands.cs:680-693 | libs/server/Resp/Objects/SetCommands.cs:338-351 | libs/server/Resp/Objects/SetCommands.cs:382-395 | libs/server/Resp/Objects/SetCommands.cs:606-619 | libs/server/Resp/Objects/SortedSetCommands.cs:80-92 | libs/server/Resp/Objects/SortedSetCommands.cs:122-135 | libs/server/Resp/Objects/SortedSetCommands.cs:559-572 | libs/server/Resp/Objects/SortedSetCommands.cs:627-640 | libs/server/Resp/Objects/SortedSetCommands.cs:792-804 — before extracting anything, compare `libs/server/Resp/Objects/HashCommands.cs` and `libs/server/Resp/Objects/ListCommands.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 48 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Objects/HashCommands.cs:329` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 8) libs/server/Storage/Session/ObjectStore/SetOps.cs:344— libs/server/Storage/Session/ObjectStore/SetOps.cs:344-353 | libs/server/Storage/Session/ObjectStore/SetOps.cs:517-526 | libs/server/Storage/Session/ObjectStore/SetOps.cs:785-794 | libs/server/Storage/Session/ObjectStore/SetOps.cs:945-954 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:537-546 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1087-1096 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1321-1330 | libs/server/Storage/Session/ObjectStore/SortedSetOps.cs:1450-1459 — before extracting anything, compare `libs/server/Storage/Session/ObjectStore/SetOps.cs` and `libs/server/Storage/Session/ObjectStore/SortedSetOps.cs` as WHOLE FILES: this scan already matched 3 separate duplicated blocks between them, totalling at least 40 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. If that is what happened, the fix is to keep one copy and have the other call it (or delete it), which resolves this row and its siblings together — extracting one helper per block leaves the fork in place. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SetOps.cs:344` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it. Note first that the copies are not typed on the same thing: the declarations holding them bind `keys` to `PinnedSpanByte[]` in one and `ReadOnlySpan<PinnedSpanByte>` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (14 lines × 5) libs/server/Lua/LuaRunner.cs:758— libs/server/Lua/LuaRunner.cs:758-772 | libs/server/Lua/LuaRunner.cs:842-856 | libs/server/Lua/LuaRunner.cs:971-985 | libs/server/Lua/LuaRunner.cs:1022-1036 | libs/server/Lua/LuaRunner.cs:1082-1095 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Lua/LuaRunner.cs:753` calls `TryReadSignedMapLength` and `libs/server/Lua/LuaRunner.cs:966` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (11–14 lines × 2) libs/server/AOF/AofProcessor.ChunkReplay.cs:277— libs/server/AOF/AofProcessor.ChunkReplay.cs:277-287 | libs/server/AOF/AofProcessor.cs:746-759 — the copies sit in sibling files of one directory, so a shared home is within easy reach: extract the block into a single 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/AOF/AofProcessor.cs:746` calls `FromV3` and `libs/server/AOF/AofProcessor.ChunkReplay.cs:277` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (4–14 lines × 4) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:221— libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:221-224 | libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:258-271 | playground/Bitmap/BitCount.cs:139-142 | playground/Bitmap/BitCount.cs:176-189 — before extracting anything, compare `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs` and `playground/Bitmap/BitCount.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–14 lines × 2) libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:69— libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:69-80 | libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:114-127 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/ClientSession/TransactionalContext.cs:69` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (12–13 lines × 4) libs/server/Storage/Session/ObjectStore/SetOps.cs:34— libs/server/Storage/Session/ObjectStore/SetOps.cs:34-45 | libs/server/Storage/Session/ObjectStore/SetOps.cs:67-79 | libs/server/Storage/Session/ObjectStore/SetOps.cs:97-108 | libs/server/Storage/Session/ObjectStore/SetOps.cs:131-142 — all 4 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/ObjectStore/SetOps.cs:34` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (12–13 lines × 3) libs/server/Storage/Functions/MainStore/RMWMethods.Etags.cs:91— libs/server/Storage/Functions/MainStore/RMWMethods.Etags.cs:91-103 | libs/server/Storage/Functions/MainStore/RMWMethods.Etags.cs:136-147 | libs/server/Storage/Functions/MainStore/RMWMethods.cs:540-552 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Functions/MainStore/RMWMethods.Etags.cs:91` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (11–13 lines × 2) libs/cluster/Session/RespClusterBasicCommands.cs:610— libs/cluster/Session/RespClusterBasicCommands.cs:610-620 | libs/cluster/Session/RespClusterBasicCommands.cs:645-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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Session/RespClusterBasicCommands.cs:610` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (11–12 lines × 5) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1167— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1167-1178 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1200-1210 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1239-1249 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1548-1559 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1600-1611 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1167` it runs out through the closing brace of the declaration holding it and carries on into the declaration that follows — the window is the tail of one member plus the head of the next, so no call can be substituted for those exact lines, and the smallest declaration that contains all of them is the type they sit in. The repeated unit is the member each site sits in: where those members' bodies are the same, move one whole member to the shared location and have the others delegate to it; where the copies are a run of near-identical overloads or wrappers that differ only in their signatures, the repetition IS the run — a one-line delegation has no helper inside it to lift — so generate the run from the set it enumerates, or accept it and keep each member's own documentation with it. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1237` calls `SerializeTo`, `TotalSize` and `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1166` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (9–12 lines × 2) libs/server/Objects/Hash/HashObject.cs:425— libs/server/Objects/Hash/HashObject.cs:425-436 | libs/server/Objects/SortedSet/SortedSetObject.cs:685-693 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Objects/Hash/HashObject.cs:425` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (10–11 lines × 5) libs/common/RespWriteUtils.cs:23— libs/common/RespWriteUtils.cs:23-32 | libs/common/RespWriteUtils.cs:38-47 | libs/common/RespWriteUtils.cs:71-80 | libs/common/RespWriteUtils.cs:86-95 | libs/common/RespWriteUtils.cs:330-340 — 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. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (10 lines × 5) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1089— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1089-1098 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1121-1130 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1226-1235 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1263-1272 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1292-1301 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1089` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1132` calls `SerializeTo` and `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1099` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (8–11 lines × 3) libs/cluster/Session/RespClusterBasicCommands.cs:569— libs/cluster/Session/RespClusterBasicCommands.cs:569-579 | libs/cluster/Session/RespClusterBasicCommands.cs:609-616 | libs/cluster/Session/RespClusterBasicCommands.cs:643-653 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/cluster/Session/RespClusterBasicCommands.cs:655` calls `TryWriteNewLine`, `SendAndReset` and `libs/cluster/Session/RespClusterBasicCommands.cs:580` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (10–11 lines × 2) libs/cluster/Server/ClusterUtils.cs:74— libs/cluster/Server/ClusterUtils.cs:74-84 | libs/common/StreamProvider.cs:90-99 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Server/ClusterUtils.cs:74` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (3–11 lines × 4) libs/common/HashUtils.cs:150— libs/common/HashUtils.cs:150-152 | libs/common/HashUtils.cs:153-163 | libs/common/HashUtils.cs:165-168 | libs/common/HashUtils.cs:169-179 — 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. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (10 lines × 6) libs/client/LightEpoch.cs:381— libs/client/LightEpoch.cs:381-390 | libs/client/LightEpoch.cs:477-486 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:424-433 | libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs:510-519 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:415-424 | playground/LightEpochLitmus/helpers/BuggyLightEpoch.cs:501-510 — before extracting anything, compare `libs/client/LightEpoch.cs` and `libs/storage/Tsavorite/cs/src/core/Epochs/LightEpoch.cs` as WHOLE FILES: this scan already matched 10 separate duplicated blocks between them, totalling at least 184 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/LightEpoch.cs:381` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (9 lines × 6) libs/server/Storage/Session/MainStore/RangeIndexOps.cs:278— libs/server/Storage/Session/MainStore/RangeIndexOps.cs:278-286 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:417-425 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:473-481 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:525-533 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:613-621 | libs/server/Storage/Session/MainStore/RangeIndexOps.cs:663-671 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Storage/Session/MainStore/RangeIndexOps.cs:278` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8–10 lines × 5) libs/client/GarnetClientProcessReplies.cs:57— libs/client/GarnetClientProcessReplies.cs:57-66 | libs/client/GarnetClientProcessReplies.cs:88-96 | libs/client/GarnetClientProcessReplies.cs:136-145 | libs/client/GarnetClientProcessReplies.cs:186-195 | libs/client/GarnetClientProcessReplies.cs:206-213 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/client/GarnetClientProcessReplies.cs:57` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (8–10 lines × 2) libs/cluster/Session/ClusterSession.cs:185— libs/cluster/Session/ClusterSession.cs:185-192 | libs/server/Resp/RespServerSession.cs:1540-1549 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere both call sites can already reach — a location they all depend on today, or a new shared one if there is none — and call it from each site; until then, every change has to be made twice. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Session/ClusterSession.cs:185` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (9 lines × 5) libs/server/Lua/LuaRunner.cs:2192— libs/server/Lua/LuaRunner.cs:2192-2200 | libs/server/Lua/LuaRunner.cs:2277-2285 | libs/server/Lua/LuaRunner.cs:2361-2369 | libs/server/Lua/LuaRunner.cs:2437-2445 | libs/server/Lua/LuaRunner.cs:2541-2550 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Lua/LuaRunner.cs:2192` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The matched lines also transfer control out of the body holding them, which cannot survive a move into a called unit unchanged: have the extracted unit return that decision and let each site act on it.
Duplicated block (7–9 lines × 5) playground/Bitmap/BitCount.cs:46— playground/Bitmap/BitCount.cs:46-52 | playground/Bitmap/BitCount.cs:94-102 | playground/Bitmap/BitCount.cs:230-237 | playground/Bitmap/BitCount.cs:374-382 | playground/Bitmap/BitCount.cs:519-527 — 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. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitCount.cs:46` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on.
Duplicated block (8–9 lines × 2) libs/server/Lua/LuaRunner.cs:433— libs/server/Lua/LuaRunner.cs:433-440 | libs/server/Lua/LuaRunner.cs:1254-1262 — both copies are in the same file, so extract the block into one function there and call it from each site — the copies drift apart the first time only one of them is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/server/Lua/LuaRunner.cs:1264` calls `MapRespToObject`, `Assert` and `libs/server/Lua/LuaRunner.cs:441` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (4–9 lines × 3) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:170— libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:170-173 | libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:312-319 | libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:463-471 — all 3 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:312` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that. The `return` at the foot of the matched lines is the enclosing body's own terminal exit, not an early one: it moves with them unchanged, and each site calls the extracted unit from the position that `return` occupied — no decision has to be handed back and re-acted on. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately.
Duplicated block (7 lines × 5) libs/cluster/Server/Migration/MigrateSessionCommonUtils.cs:64— libs/cluster/Server/Migration/MigrateSessionCommonUtils.cs:64-70 | libs/server/Resp/Vector/VectorManager.Replication.cs:856-862 | libs/server/Resp/Vector/VectorManager.cs:666-672 | libs/server/Storage/Session/ObjectStore/CompletePending.cs:22-28 | libs/server/Storage/Session/UnifiedStore/CompletePending.cs:22-28 — the copies span different directories, so extracting a shared function means choosing where it lives: put it somewhere all 5 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 5 times. Read the line range as the matched WINDOW rather than a finished unit: at `libs/cluster/Server/Migration/MigrateSessionCommonUtils.cs:64` it runs out through the closing brace of the declaration holding it — the window is that declaration's tail, not a fragment that begins part-way through something, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7–8 lines × 3) libs/server/Resp/Vector/VectorManager.Filter.cs:126— libs/server/Resp/Vector/VectorManager.Filter.cs:126-133 | libs/server/Resp/Vector/VectorManager.cs:1013-1019 | libs/server/Resp/Vector/VectorManager.cs:1212-1218 — there are 3 copies across 2 file(s) — more copies than files, so at least one file holds the block twice. Extract it once into a single shared function every call site can reach and call it from all 3 sites; resolving a subset leaves the remainder to drift apart.
Duplicated block (7 lines × 8) playground/Bitmap/BitOp.cs:114— playground/Bitmap/BitOp.cs:114-120 | playground/Bitmap/BitOp.cs:171-177 | playground/Bitmap/BitOp.cs:308-314 | playground/Bitmap/BitOp.cs:370-376 | playground/Bitmap/BitOp.cs:478-484 | playground/Bitmap/BitOp.cs:540-546 | playground/Bitmap/BitOp.cs:677-683 | playground/Bitmap/BitOp.cs:739-745 — all 8 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. Read the line range as the matched WINDOW rather than a finished unit: at `playground/Bitmap/BitOp.cs:114` it does not close everything it opens, so those exact lines cannot be lifted as they stand — widen the region to the smallest complete statement or declaration that contains it, and extract that.
Duplicated block (7 lines × 4) libs/server/Custom/CustomCommandManager.cs:94— libs/server/Custom/CustomCommandManager.cs:94-100 | libs/server/Custom/CustomCommandManager.cs:122-128 | libs/server/Custom/CustomCommandManager.cs:175-182 | libs/server/Custom/CustomCommandManager.cs:205-212 — 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. Note first that the copies are not typed on the same thing: the declarations holding them bind `name` to `string` in one and `int subCommand) Register(string` in another, and the duplicated lines use it. The extracted unit therefore needs a parameter type that fits BOTH — their common supertype where they have one, or a new abstraction over them where they do not — and settling that is the step that comes BEFORE the extraction above. Where the two types are deliberately unrelated, the duplication is the price of that separation and the honest resolution is to record the decision rather than to extract.
Duplicated block (3–7 lines × 6) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:222— libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:222-225 | libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:226-228 | libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:230-236 | playground/Bitmap/BitCount.cs:140-143 | playground/Bitmap/BitCount.cs:144-146 | playground/Bitmap/BitCount.cs:148-154 — before extracting anything, compare `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs` and `playground/Bitmap/BitCount.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place. Note that the copies do not run to the end of the range shown: their LAST lines are different code, not the same code under different names — the matched region ends inside that line. Extract the lines above it, and read the last line of each site separately. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just before the matched lines, `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:224` calls `Add`, `Shuffle`, `And` and `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:222` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (6 lines × 5) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1164— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1164-1169 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1234-1239 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1373-1378 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1545-1550 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1595-1600 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1240` calls `TotalSize`, `SerializeTo` and `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1170` does not — after which the two agree again for 3 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 5) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1164— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1164-1168 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1234-1238 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1300-1304 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1334-1338 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1373-1377 — 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. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1240` calls `TotalSize`, `SerializeTo` and `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1170` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (5 lines × 7) libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1164— libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1164-1168 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1234-1238 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1300-1304 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1334-1338 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1373-1377 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1545-1549 | libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1595-1599 — all 7 copies are in the same file, so extract the block into one function there and call it from every one of those sites — resolving only two of them leaves the rest to drift apart the first time one is edited. ★ These copies have DRIFTED, and that is worth reading before extracting anything: just after the matched lines, `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1240` calls `TotalSize`, `SerializeTo` and `libs/storage/Tsavorite/cs/src/core/TsavoriteLog/TsavoriteLog.cs:1170` does not — after which the two agree again for 2 more lines. One of those two behaviours is the intended one and the other is what a copy-paste left behind, so decide which BEFORE unifying them: extracting the shared part will silently settle it, and if the copy that skips the call is the wrong one, that bug is already live.
Duplicated block (3–5 lines × 6) libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:365— libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:365-368 | libs/server/Resp/Bitmap/BitmapManagerBitCount.cs:371-373 | playground/Bitmap/BitCount.cs:275-279 | playground/Bitmap/BitCount.cs:282-284 | playground/Bitmap/BitCount.cs:420-424 | playground/Bitmap/BitCount.cs:427-429 — before extracting anything, compare `libs/server/Resp/Bitmap/BitmapManagerBitCount.cs` and `playground/Bitmap/BitCount.cs` as WHOLE FILES: this scan already matched 7 separate duplicated blocks between them, totalling at least 65 lines, which is the signature of one file having been copied from the other rather than of a helper waiting to be extracted. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
Duplicated block (26 lines × 3) libs/server/Storage/Functions/MainStore/MainSessionFunctions.cs:24— libs/server/Storage/Functions/MainStore/MainSessionFunctions.cs:24-50 | libs/server/Storage/Functions/ObjectStore/ObjectSessionFunctions.cs:24-50 | libs/server/Storage/Functions/UnifiedStore/UnifiedSessionFunctions.cs:21-46 — before extracting anything, compare `libs/server/Storage/Functions/MainStore/MainSessionFunctions.cs` and `libs/server/Storage/Functions/ObjectStore/ObjectSessionFunctions.cs` as WHOLE FILES: 86% of the shorter file's lines also appear in the other, so this reads as one file having been copied from the other rather than as a helper waiting to be extracted. The 1 duplicated block(s) this scan matched between them are fragments of that copy, not the extent of it — treat the file pair as the unit. The two sit in different directories, so one cannot simply be deleted in favour of the other while both are reached separately: hoist the shared part into a location both already depend on and have each file call it, and retire whichever file turns out to have no caller of its own left. Extracting one helper per block leaves the fork in place.
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.
IC1 · Incompleteness & stubs· Both branches are identical · ×1
Both branches are identical — the condition decides nothing libs/common/LightClientRequest.cs:90— The `if` and its `else` contain the same 1 statement, so no input can make the condition matter. Implement the distinction that was intended, or drop the branch and keep the body.
IC1 · Incompleteness & stubs· Both branches open with the same statements · ×1
Both branches open with the same statements — the condition does not decide them libs/server/Resp/ArrayCommands.cs:320— The first 1 statement of the `if` and of the `else` are identical, so it runs on both paths regardless of the condition. Lift it above the `if` — leaving it duplicated inside makes the branches read as though they handled this differently.
Fake-async — async method never awaits libs/server/ServerConfig.cs:263— `HandleIndexSizeChangeAsync` is declared `async` but never awaits anything, so it runs synchronously while pretending to be asynchronous. Drop `async` or do the real async work.
IC1 · Incompleteness & stubs· Dead `#if false` region · ×1
Dead `#if false` region libs/storage/Tsavorite/cs/src/core/Allocator/LogRecord.cs:1712— Code inside a `#if false` block is permanently excluded from the build — disabled code that should be removed or restored.
Hollow method — returns a constant without doing the work libs/storage/Tsavorite/cs/src/core/Compaction/ICompactionFunctions.cs:25— `IsDeleted` looks like it should compute a result but its body just returns a constant — a placeholder return that was never filled in.
Condition was already decided — an earlier guard makes this test constant modules/GarnetJSON/JSONPath/QueryExpression.cs:287— Control only reaches here when `leftValue is null` is false, because the guard on line 275 exits otherwise. This test is therefore always false and everything it guards is unreachable. Implement the distinction that was intended, or delete the test.
X13 · Undrained process stream· Redirected process stream is never drained (deadlock) · ×1
Redirected process stream is never drained (deadlock) libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvOutput.cs:262— `RedirectStandardError` is set here, but nothing in this type ever reads `StandardError` — while `StandardOutput` is read to the end. The child blocks as soon as it fills the StandardError pipe (~4 KB, never more than 64 KB), and it can then never finish writing StandardOutput, so the read-to-end above never returns and the `WaitForExit` timeout beside it does not help: the timeout bounds the WAIT, not the read that precedes it. Drain both — read one stream on a background thread (`BeginErrorReadLine()` with an `ErrorDataReceived` handler, or a `Task` running the second `ReadToEndAsync()`) and await both before `WaitForExit()` — or stop redirecting the stream you do not consume.
X20 · Mistyped argument guard· Argument guard throws the exception its own condition disproves · ×1
Argument guard throws the exception its own condition disproves libs/server/Custom/CustomProcedureWrapper.cs:37— The guard on line 36 rejects `name` and line 37 reports that rejection as `ArgumentNullException` — but the condition's own test `string.IsNullOrEmpty(name)` is true of a value that is NOT null: it is satisfied by an EMPTY `name`, and on that path `name` was already proven non-null by the very expression that decided it (`||` short-circuits, so the null test to its left had to be false to get here). So a caller who passes a valid empty argument is told a parameter was null. That is not a wording problem: the exception type is the contract. A caller catching `ArgumentNullException` to handle a real null swallows the empty case with it, and whoever reads the stack trace later is told a failure the source disproves. .NET separates the two on purpose — `ArgumentNullException.ThrowIfNull` and `ArgumentException.ThrowIfNullOrEmpty` are two helpers because they are two failures. Throw `ArgumentException` for the empty case, or split the guard and throw each on its own condition.
X29 · Per-element action decided by a fixed element· Per-element action decided by a fixed element · ×1
Per-element action decided by a fixed element libs/cluster/Server/ClusterConfig.cs:304— This loop runs once per element of `workers`, and the statement it guards acts on the element it is on — `workers[i]`. The test deciding whether that statement runs does not: `replicaOf != null && replicaOf.Equals(workers[LOCAL_WORKER_ID].Nodeid, String...` reads `workers[LOCAL_WORKER_ID]`, a subscript that does not move, so whatever it answers for that one element it answers for ALL of them. One `if` names the same collection at two different subscripts, which is the contradiction: either the test was meant to be per-element, in which case every element that differs from the fixed one is handled wrongly and all in the same direction, or it really is one answer for the whole collection, in which case it is being re-asked on every pass and belongs above the loop. The `if` is in the wrong place under both readings. Give the test the loop variable, or hoist it out.
X5 · Nullable reference types· Null guard scopes only part of the work it protects · ×1
Null guard scopes only part of the work it protects libs/cluster/Server/Replication/PrimaryOps/DisklessReplication/ReplicaSyncSession.cs:148— This method contradicts itself about `task`: line 141 tests it for null before doing anything with it — the author's own statement that null is an input this code expects — but that `if` scopes only the block beneath it, and line 148 then dereferences `task` as `task.ConfigureAwait` AFTER the block has closed, where the guard no longer applies. A null `task` skips the guarded body and reaches that line anyway, throwing NullReferenceException on exactly the input the guard was written for. If the dereference belongs to the guarded work, move it inside the block; if `task` truly cannot be null by then, the guard above is misleading and should go.
Orphaned file modules/GarnetJSON/JSONPath/QueryExpression.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/RoaringBitmap/RoaringBitmap.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file libs/server/Resp/RespCommandDocs.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file libs/server/Resp/Objects/SortedSetGeoCommands.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file libs/server/Custom/ExpandableMap.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file libs/server/Module/ModuleRegistrar.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file libs/server/Resp/RespCommandInfoSimplifiedStructs.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/GarnetJSON/JSONPath/ScanArraySliceFilter.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file libs/server/Resp/Parser/ParseUtils.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file libs/server/Resp/RespCommandDataProvider.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/RoaringBitmap/RoaringBitmapCommands.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/GarnetJSON/JSONPath/ArraySliceFilter.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/RoaringBitmap/Containers/BitmapContainer.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/RoaringBitmap/Containers/ArrayContainer.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file libs/client/GarnetClientAPI/GarnetClientListCommands.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/GarnetJSON/JSONPath/FieldFilter.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/GarnetJSON/JSONPath/ArrayIndexFilter.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file libs/host/Configuration/CompactObjectJsonConverter.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file libs/common/AsciiUtils.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/GarnetJSON/JSONPath/ScanArrayIndexFilter.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/RoaringBitmap/RoaringBitmapObject.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file libs/server/Objects/ItemBroker/CollectionItemObserver.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/GarnetJSON/JSONPath/ScanArrayMultipleIndexFilter.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/GarnetJSON/JSONPath/FieldMultipleFilter.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Orphaned file modules/GarnetJSON/JSONPath/ScanFilter.cs:1— No one still active in this repository holds living knowledge of this file: everyone who made a meaningful change to it has gone quiet, or what the current team did to it (moves, reformatting, log-level or import edits, renames) never needed understanding it. If it breaks, no one currently understands it. Attach the read to the next change that touches it: have a second person review that change, and leave behind a short comment or test recording what the file is for.
Duplicated predicate libs/server/Resp/RespCommandDocs.cs:170— `!IsInitialized && !TryInitialize(logger)` appears character-identically in 2 files — libs/server/Resp/RespCommandDocs.cs, libs/server/Resp/RespCommandsInfo.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs:126— `!Native32.IsExtendedLengthPath(filename) && filename.Length > Native32.WIN32_MAX_PATH - 11` appears character-identically in 2 files — libs/storage/Tsavorite/cs/src/core/Device/LocalStorageDevice.cs, libs/storage/Tsavorite/cs/src/core/Device/NativeStorageDevice.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:244— `!RevivificationManager.UseFreeRecordPool || !TryTransferToFreeList<TInput, TOutput, TContext, TSessionFunctionsWrapper>(sessionFunctions, ne…` appears character-identically in 3 files — libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs, libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs, libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/server/Resp/Vector/AttributeExtractor.cs:226— `!Utf8Parser.TryParse(numSpan, out double value, out var bytesConsumed) || bytesConsumed != numSpan.Length` appears character-identically in 2 files — libs/server/Resp/Vector/AttributeExtractor.cs, libs/server/Resp/Vector/ExprCompiler.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/server/Objects/Hash/HashObject.cs:176— `!expirations.TryGetValue(kvp.Key, out var expiration) || expiration >= now` appears character-identically in 2 files — libs/server/Objects/Hash/HashObject.cs, libs/server/Objects/SortedSet/SortedSetObject.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:230— `!includeClosedRecords && recordInfo.SkipOnScan` appears character-identically in 2 files — libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs, libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/server/Resp/Objects/SetCommands.cs:189— `!limitArg.ReadOnlySpan.EqualsUpperCaseSpanIgnoringCase(CmdStrings.LIMIT) || parseState.Count != nKeys + 3` appears character-identically in 2 files — libs/server/Resp/Objects/SetCommands.cs, libs/server/Resp/Objects/SortedSetCommands.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/server/Storage/Functions/MainStore/RMWMethods.cs:80— `!logRecord.DataHeader.HasETag && !logRecord.DataHeader.HasExpiration` appears character-identically in 2 files — libs/server/Storage/Functions/MainStore/RMWMethods.cs, libs/server/Storage/Functions/ObjectStore/RMWMethods.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/server/Resp/Objects/ListCommands.cs:83— `!parseState.TryGetInt(1, out popCount) || (popCount < 0)` appears character-identically in 2 files — libs/server/Resp/Objects/ListCommands.cs, libs/server/Resp/Objects/SortedSetCommands.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/server/Resp/Objects/ListCommands.cs:228— `!parseState.TryGetInt(currTokenId, out popCount) || popCount < 1` appears character-identically in 2 files — libs/server/Resp/Objects/ListCommands.cs, libs/server/Resp/Objects/SortedSetCommands.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:160— `!sessionFunctions.IsTransactionalLocking || LockTable.IsLockedExclusive(ref stackCtx.hei)` appears character-identically in 3 files — libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs, libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs, libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/client/Utility.cs:178— `!token.CanBeCanceled || task.IsCompleted` appears character-identically in 2 files — libs/client/Utility.cs, libs/storage/Tsavorite/cs/src/core/Utilities/Utility.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/cluster/Server/Migration/MigrateSessionKeys.cs:48— `(_namespaces?.Count ?? 0) > 0 && !await ReserveDestinationVectorSetsAsync().ConfigureAwait(false)` appears character-identically in 2 files — libs/cluster/Server/Migration/MigrateSessionKeys.cs, libs/cluster/Server/Migration/MigrationDriver.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/server/Objects/Hash/HashObject.cs:556— `(expireOption & ExpireOption.XX) == ExpireOption.XX || (expireOption & ExpireOption.GT) == ExpireOption.GT` appears character-identically in 2 files — libs/server/Objects/Hash/HashObject.cs, libs/server/Objects/SortedSet/SortedSetObject.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/FixedLenYcsbBenchmark.cs:59— `(testLoader.Options.NumaStyle == 0 && testLoader.Options.ThreadCount <= (numProcs - 1)) || (testLoader.Options.NumaStyle == 1 && testLoader.…` appears character-identically in 3 files — libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/FixedLenYcsbBenchmark.cs, libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/ObjectYcsbBenchmark.cs, libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/SpanByteYcsbBenchmark.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/server/Objects/Hash/HashObject.cs:574— `HasExpirableItems && expirationTimeSpanLookup.Remove(key)` appears character-identically in 2 files — libs/server/Objects/Hash/HashObject.cs, libs/server/Objects/Hash/HashObjectImpl.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs:167— `OperationStatusUtils.IsAppend(status) || OperationStatusUtils.BasicOpCode(status) != OperationStatus.SUCCESS` appears character-identically in 2 files — libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalDelete.cs, libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs:123— `RevivificationManager.IsEnabled && stackCtx.recSrc.LogicalAddress >= GetMinRevivifiableAddress()` appears character-identically in 2 files — libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalRMW.cs, libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/InternalUpsert.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/server/Databases/DatabaseManagerBase.cs:576— `StoreWrapper.serverOptions.EnableCluster && StoreWrapper.clusterProvider.IsReplica()` appears character-identically in 2 files — libs/server/Databases/DatabaseManagerBase.cs, libs/server/Databases/SingleDatabaseManager.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/server/Databases/DatabaseManagerBase.cs:639— `StoreWrapper.serverOptions.EnableCluster && StoreWrapper.serverOptions.EnableAOF` appears character-identically in 2 files — libs/server/Databases/DatabaseManagerBase.cs, libs/server/Databases/SingleDatabaseManager.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate benchmark/BDN.benchmark/Auth/IsAuthorizedBenchmark.cs:51— `_authorized && nowTicks >= _validFromTicks && nowTicks <= _validToTicks` appears character-identically in 2 files — benchmark/BDN.benchmark/Auth/IsAuthorizedBenchmark.cs, libs/server/Auth/GarnetAadAuthenticator.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/cluster/Session/RespClusterMigrateCommands.cs:170— `chunkLength < 0 || payloadPtr + chunkLength > payloadEndPtr` appears character-identically in 2 files — libs/cluster/Session/RespClusterMigrateCommands.cs, libs/cluster/Session/RespClusterReplicationCommands.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/server/Resp/RespServerSessionSlotVerify.cs:48— `cmdInfo.KeySpecs == null || cmdInfo.KeySpecs.Length == 0` appears character-identically in 2 files — libs/server/Resp/RespServerSessionSlotVerify.cs, libs/server/Transaction/TxnKeyManager.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:147— `currentAddress < headAddress && !assumeInMemory` appears character-identically in 2 files — libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs, libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
Duplicated predicate libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs:136— `currentAddress < hlogBase.BeginAddress && !assumeInMemory` appears character-identically in 2 files — libs/storage/Tsavorite/cs/src/core/Allocator/ObjectScanIterator.cs, libs/storage/Tsavorite/cs/src/core/Allocator/SpanByteScanIterator.cs. It is one line, so the duplication detector's token window never sees it; the copies drift when only one is corrected. Give the condition a name and one home.
README/code drift website/README.md:32— website/README.md documents the environment variable `USE_SSH`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift benchmark/Azure.benchmark/01-resources/README.md:34— benchmark/Azure.benchmark/01-resources/README.md runs `.\01-resources\deploy-common-resources.ps1`, but `01-resources/deploy-common-resources.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift benchmark/Azure.benchmark/01-resources/README.md:130— benchmark/Azure.benchmark/01-resources/README.md names `01-resources/security/manifest.json`, but no file or folder `01-resources/security/manifest.json` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift benchmark/Azure.benchmark/02-platform/README.md:66— benchmark/Azure.benchmark/02-platform/README.md runs `pwsh .\02-platform\REDACTED --help`, but `REDACTED` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift benchmark/Azure.benchmark/03-workload/README.md:27— benchmark/Azure.benchmark/03-workload/README.md runs `.\03-workload\bench\resp-bench.ps1 -Detail`, but `03-workload/bench/resp-bench.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift benchmark/Azure.benchmark/03-workload/README.md:28— benchmark/Azure.benchmark/03-workload/README.md runs `.\03-workload\bench\memtier-bench.ps1 -Background`, but `03-workload/bench/memtier-bench.ps1` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift benchmark/Azure.benchmark/03-workload/README.md:119— benchmark/Azure.benchmark/03-workload/README.md names `01-resources/security/manifest.json`, but no file or folder `01-resources/security/manifest.json` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/azure/quickstart.md:162— website/docs/azure/quickstart.md documents the environment variable `GARNET_HOST`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/azure/quickstart.md:163— website/docs/azure/quickstart.md documents the environment variable `GARNET_PORT`, but no code, script or configuration file names it. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/benchmarking/overview.md:10— website/docs/benchmarking/overview.md links to `resp-bench`, but `website/docs/benchmarking/resp-bench` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/benchmarking/results-resp-bench.md:22— website/docs/benchmarking/results-resp-bench.md links to `resp-bench`, but `website/docs/benchmarking/resp-bench` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/benchmarking/results-resp-bench.md:32— website/docs/benchmarking/results-resp-bench.md runs `dotnet run -c Release --framework=net10.0 --project Garnet/main/GarnetServer -- \`, but `Garnet/main/GarnetServer` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/benchmarking/results-resp-bench.md:99— website/docs/benchmarking/results-resp-bench.md runs `dotnet run -c Release --framework=net10.0 --project Garnet/benchmark/Resp.benchmark -- \`, but `Garnet/benchmark/Resp.benchmark` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/cluster/replication.md:255— website/docs/cluster/replication.md links to `../dev/cluster/replication-dev`, but `website/docs/dev/cluster/replication-dev` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/commands/roaring-bitmap.md:17— website/docs/commands/roaring-bitmap.md links to `raw-string`, but `website/docs/commands/raw-string` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/dev/range-index-resp-api.md:1440— website/docs/dev/range-index-resp-api.md names `test/Garnet.test/ReadOptimizedLockTests.cs`, but no file or folder `test/Garnet.test/ReadOptimizedLockTests.cs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/dev/range-index-resp-api.md:1697— website/docs/dev/range-index-resp-api.md names `libs/server/Storage/Functions/MainStore/DisposeMethods.cs`, but no file or folder `libs/server/Storage/Functions/MainStore/DisposeMethods.cs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/dev/range-index-resp-api.md:2303— website/docs/dev/range-index-resp-api.md names `test/Garnet.test/RangeIndexTests.cs`, but no file or folder `test/Garnet.test/RangeIndexTests.cs` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/getting-started/memory.md:11— website/docs/getting-started/memory.md links to `configuration`, but `website/docs/getting-started/configuration` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/getting-started/memory.md:50— website/docs/getting-started/memory.md links to `compaction`, but `website/docs/getting-started/compaction` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift website/docs/welcome/about-us.md:9— website/docs/welcome/about-us.md links to `/blog/brief-history`, but `blog/brief-history` does not exist. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift libs/storage/Tsavorite/cc/README.md:347— libs/storage/Tsavorite/cc/README.md names `src\Release\`, but no file or folder `src/Release` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift libs/storage/Tsavorite/cc/README.md:347— libs/storage/Tsavorite/cc/README.md names `src\Debug\`, but no file or folder `src/Debug` exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
README/code drift libs/storage/Tsavorite/cs/benchmark/Device.benchmark/README.md:16— libs/storage/Tsavorite/cs/benchmark/Device.benchmark/README.md changes into `benchmark/Device.benchmark`, but no such folder exists. Checked without a model against the repository: its files and folders, the scripts and dependencies of every package.json, the projects, namespaces, package references and target frameworks of the .NET build, the SDK and Node pins, and the identifiers of every file that is not a document; the documents' own text never counts. A footprint generated at build time, read only by a platform, or living outside this repository is not seen, and this row is then wrong.
Fat interface: INetworkSender (18 members) libs/common/Networking/INetworkSender.cs:11— `INetworkSender` declares 18 members: `GetMaxSizeSettings`, `RemoteEndpointName`, `LocalEndpointName`, `IsLocalConnection`, `Enter`, `EnterAndGetResponseObject`, `Exit`, `ExitAndReturnResponseObject`, `GetResponseObject`, `ReturnResponseObject`, `GetResponseObjectHead`, `GetResponseObjectTail`, `SendResponse`, `SendResponse`, `SendCallback`, `DisposeNetworkSender`, `Throttle`, `TryClose`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 18 declarations carry 17 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 17 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: IGarnetApi (137 members) libs/server/API/IGarnetApi.cs:14— `IGarnetApi` declares 137 members: `GETEX`, `SET`, `SET`, `SET_Conditional`, `SET_Conditional`, `SET_ETagConditional`, `DEL_ETagConditional`, `SET`, `SET`, `SET`, `SET`, `SETEX`, `SETEX`, `SETRANGE`, `MSET_Conditional`, `APPEND`, `APPEND`, `RENAME`, `RENAMENX`, `EXISTS`, `EXISTS`, `EXPIRE`, `EXPIRE`, `EXPIRE`, `EXPIREAT`, `PEXPIREAT`, `PERSIST`, `Increment`, `Increment`, `Decrement`, `IncrementByFloat`, `IncrementByFloat`, `DELETE`, `DELIFEXPIM`, `GETDEL`, `TYPE`, `MEMORYUSAGE`, `OBJECT`, `SortedSetAdd`, `SortedSetAdd`, and 97 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 137 declarations carry 88 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 88 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: IGarnetReadApi (88 members) libs/server/API/IGarnetApi.cs:1392— `IGarnetReadApi` declares 88 members: `GET`, `GETForMemoryResult`, `GET`, `GET`, `LCS`, `GETRANGE`, `TTL`, `EXPIRETIME`, `SortedSetLength`, `SortedSetLength`, `SortedSetRange`, `SortedSetScore`, `SortedSetScores`, `SortedSetCount`, `SortedSetCount`, `SortedSetLengthByValue`, `SortedSetRank`, `SortedSetRank`, `SortedSetRandomMember`, `SortedSetRange`, `SortedSetDifference`, `SortedSetUnion`, `SortedSetScan`, `SortedSetIntersect`, `SortedSetIntersectLength`, `SortedSetTimeToLive`, `SortedSetTimeToLive`, `GeoCommands`, `GeoSearchReadOnly`, `ListLength`, `ListLength`, `ListRange`, `ListIndex`, `SetLength`, `SetLength`, `SetMembers`, `SetMembers`, `SetIsMember`, `SetIsMember`, `SetScan`, and 48 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 88 declarations carry 67 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 67 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: IClusterProvider (24 members) libs/server/Cluster/IClusterProvider.cs:18— `IClusterProvider` declares 24 members: `CreateClusterSession`, `AllowDataLoss`, `FlushConfig`, `GetGossipStats`, `GetReplicationInfo`, `GetBufferPoolStats`, `GetPrimaryInfo`, `GetReplicaInfo`, `PurgeBufferPool`, `ClusterPublishAsync`, `IsPrimary`, `IsReplica`, `IsReplica`, `OnCheckpointInitiated`, `RecoverAsync`, `ResetGossipStats`, `AddNewCheckpointEntry`, `SafeTruncateAOF`, `Start`, `UpdateClusterAuth`, `GetCheckpointInfo`, `GetRunId`, `PreventRoleChange`, `AllowRoleChange`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 24 declarations carry 23 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 23 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: IClusterSession (21 members) libs/server/Cluster/IClusterSession.cs:13— `IClusterSession` declares 21 members: `RemoteNodeId`, `ReadOnlySession`, `IsInternalWriteSession`, `IsReplicating`, `Server`, `SetReadOnlySession`, `SetReadWriteSession`, `SetInternalWriteSession`, `LocalCurrentEpoch`, `AcquireCurrentEpoch`, `ReleaseCurrentEpoch`, `ProcessClusterCommands`, `ResetCachedSlotVerificationResult`, `NetworkIterativeSlotVerify`, `WriteCachedSlotVerificationMessage`, `NetworkMultiKeySlotVerify`, `NetworkMultiKeySlotVerifyNoResponse`, `SetUserHandle`, `UnsafeSetConfig`, `Dispose`, `ProcessPrimaryStream`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: IDatabaseManager (40 members) libs/server/Databases/IDatabaseManager.cs:16— `IDatabaseManager` declares 40 members: `DefaultDatabase`, `Store`, `AppendOnlyFile`, `LastSaveTime`, `SizeTracker`, `VersionMap`, `DatabaseCount`, `MaxDatabaseId`, `TryGetOrAddDatabase`, `TryPauseCheckpoints`, `ResumeCheckpoints`, `RecoverCheckpointAsync`, `TakeCheckpointAsync`, `TakeOnDemandCheckpointAsync`, `TaskCheckpointBasedOnAofSizeLimitAsync`, `CommitToAofAsync`, `CommitToAofAsync`, `WaitForCommitToAofAsync`, `RecoverAOFAsync`, `VerifyRecoveryIsComplete`, `ReplayAOF`, `DoCompactionAsync`, `GrowIndexesIfNeededAsync`, `ExecuteObjectCollection`, `ExpiredKeyDeletionScan`, `StartSizeTrackers`, `Reset`, `ResetRevivificationStats`, `EnqueueCommit`, `GetDatabasesSnapshot`, `TryGetDatabase`, `FlushDatabase`, `FlushAllDatabases`, `TrySwapDatabases`, `Clone`, `CreateFunctionsState`, `ExpiredKeyDeletionScan`, `GetKeyspaceStats`, `CollectHybridLogStats`, `RecoverVectorSets`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 40 declarations carry 38 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 38 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: IAllocator<TStoreFunctions> (17 members) libs/storage/Tsavorite/cs/src/core/Allocator/IAllocator.cs:37— `IAllocator<TStoreFunctions>` declares 17 members under just 14 distinct name(s): `GetBase`, `HasObjectLog`, `InitializeRecord`, `GetRMWCopyRecordSize`, `GetRMWInitialRecordSize`, `GetUpsertRecordSize`, `GetUpsertRecordSize`, `GetUpsertRecordSize`, `GetDeleteRecordSize`, `CreateLogRecord`, `CreateLogRecord`, `CreateRemappedLogRecordOverPinnedTransientMemory`, `TransientObjectIdMap`, `GetPageObjectIdMap`, `OnDispose`, `OnDisposeDiskRecord`, `EvictRecordsInRange`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. That is an OVERLOAD SET, not 17 separate responsibilities: a caller binds to 14 operation(s) and uses the overload it selected, so the Interface-Segregation harm does NOT apply on the caller's side and splitting this into role-interfaces would scatter one operation without relieving anything. The burden that does remain is the IMPLEMENTER's — all 17 signatures must be written and kept in step. Reduce it by collapsing overloads (optional or default parameters, or an options object) rather than by segregating the interface.
Fat interface: ISourceLogRecord (29 members) libs/storage/Tsavorite/cs/src/core/Allocator/ISourceLogRecord.cs:10— `ISourceLogRecord` declares 29 members: `PhysicalAddress`, `InfoRef`, `Info`, `DataHeader`, `RecordType`, `Namespace`, `ObjectIdMap`, `IsSet`, `Key`, `IsPinnedKey`, `PinnedKeyPointer`, `KeyOverflow`, `ValueSpan`, `ValueObject`, `IsPinnedValue`, `PinnedValuePointer`, `ValueOverflow`, `ValueSpanByteAndMemory`, `ETag`, `Expiration`, `ClearValueIfHeap`, `IsMemoryLogRecord`, `AsMemoryLogRecordRef`, `IsDiskLogRecord`, `AsDiskLogRecordRef`, `GetRecordFieldInfo`, `AllocatedSize`, `ActualSize`, `CalculateHeapMemorySize`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: ITsavoriteContext<TKey, TInput, TOutput, TContext, TFunctions, TStoreFunctions, TAllocator> (41 members) libs/storage/Tsavorite/cs/src/core/ClientSession/ITsavoriteContext.cs:28— `ITsavoriteContext<TKey, TInput, TOutput, TContext, TFunctions, TStoreFunctions, TAllocator>` declares 41 members under just 14 distinct name(s): `IsNull`, `Session`, `CompletePending`, `CompletePendingWithOutputs`, `CompletePendingAsync`, `CompletePendingWithOutputsAsync`, `Read`, `Read`, `Read`, `Read`, `Read`, `Read`, `Read`, `ReadAtAddress`, `ReadAtAddress`, `ReadWithPrefetch`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `Upsert`, `RMW`, `RMW`, `RMW`, `RMW`, `RMW`, `RMW`, `Delete`, `Delete`, `ResetModified`, and 1 more. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. That is an OVERLOAD SET, not 41 separate responsibilities: a caller binds to 14 operation(s) and uses the overload it selected, so the Interface-Segregation harm does NOT apply on the caller's side and splitting this into role-interfaces would scatter one operation without relieving anything. The burden that does remain is the IMPLEMENTER's — all 41 signatures must be written and kept in step. Reduce it by collapsing overloads (optional or default parameters, or an options object) rather than by segregating the interface.
Fat interface: IDevice (23 members) libs/storage/Tsavorite/cs/src/core/Device/IDevice.cs:30— `IDevice` declares 23 members: `SectorSize`, `FileName`, `Capacity`, `SegmentSize`, `StartSegment`, `EndSegment`, `ThrottleLimit`, `Initialize`, `TryComplete`, `TryCompleteMine`, `Throttle`, `WriteAsync`, `ReadAsync`, `WriteAsync`, `ReadAsync`, `TruncateUntilAddressAsync`, `TruncateUntilAddress`, `TruncateUntilSegmentAsync`, `TruncateUntilSegment`, `RemoveSegmentAsync`, `RemoveSegment`, `GetFileSize`, `Reset`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 23 declarations carry 21 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 21 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: ISessionFunctions<TInput, TOutput, TContext> (31 members) libs/storage/Tsavorite/cs/src/core/Index/Interfaces/ISessionFunctions.cs:11— `ISessionFunctions<TInput, TOutput, TContext>` declares 31 members: `Reader`, `ReadCompletionCallback`, `InitialWriter`, `InitialWriter`, `InitialWriter`, `PostInitialWriter`, `PostInitialWriter`, `PostInitialWriter`, `InPlaceWriter`, `InPlaceWriter`, `InPlaceWriter`, `PostUpsertOperation`, `PostUpsertOperation`, `NeedInitialUpdate`, `InitialUpdater`, `PostInitialUpdater`, `NeedCopyUpdate`, `CopyUpdater`, `PostCopyUpdater`, `InPlaceUpdater`, `PostRMWOperation`, `RMWCompletionCallback`, `InitialDeleter`, `PostInitialDeleter`, `InPlaceDeleter`, `PostDeleteOperation`, `ConvertOutputToHeap`, `PreSingleKeyConsistentRead`, `PostSingleKeyConsistentReadCallback`, `PreBatchKeyConsistentReadCallback`, `PostBatchKeyConsistentReadCallback`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. Those 31 declarations carry 24 distinct name(s), so part of the width is overloading rather than separate responsibilities — but 24 operations clears the >15 bar on its own, so the row is about responsibilities, not signatures. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: ICheckpointManager (20 members) libs/storage/Tsavorite/cs/src/core/Index/Recovery/ICheckpointManager.cs:31— `ICheckpointManager` declares 20 members: `PerformAutomaticCleanup`, `GetCookie`, `InitializeIndexCheckpoint`, `InitializeLogCheckpoint`, `CommitIndexCheckpoint`, `CleanupIndexCheckpoint`, `CommitLogCheckpointMetadata`, `CleanupLogCheckpoint`, `CheckpointVersionShiftStart`, `CheckpointVersionShiftEnd`, `GetIndexCheckpointMetadata`, `GetLogCheckpointMetadata`, `GetIndexCheckpointTokens`, `GetLogCheckpointTokens`, `GetIndexDevice`, `GetSnapshotLogDevice`, `GetSnapshotObjectLogDevice`, `Purge`, `PurgeAll`, `OnRecovery`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Fat interface: IStoreFunctions (23 members) libs/storage/Tsavorite/cs/src/core/Index/StoreFunctions/IStoreFunctions.cs:12— `IStoreFunctions` declares 23 members: `GetKeyHashCode64`, `KeysEqual`, `CreateValueObjectSerializer`, `HasValueSerializer`, `BeginSerializeValue`, `BeginDeserializeValue`, `CallOnFlush`, `CallOnEvict`, `CallOnDiskRead`, `CallPostCopyToTail`, `CallOnTruncate`, `OnDispose`, `OnDisposeDiskRecord`, `OnFlush`, `OnEvict`, `OnDiskRead`, `OnRecovery`, `OnRecoverySnapshotRead`, `OnCheckpoint`, `PostCopyToTail`, `OnTruncate`, `SetCheckpointCompletedCallback`, `OnCheckpointCompleted`. Counted as the author wrote them — a property is ONE member and its get/set accessors are not counted separately, and an event counts once. A wide interface forces every implementer and caller to depend on methods they don't use (the Interface-Segregation 'I' in SOLID). Split it into focused role-interfaces.
Off-boarding risk: anonymized user #1 — If anonymized user #1 becomes unavailable, 11 significant file(s) lose their only recent owner: libs/storage/Tsavorite/cs/benchmark/KV.benchmark/Options.cs, libs/server/Resp/Parser/RespCommandHashLookup.cs, libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvBenchmark.cs, libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvBenchmark.Worker.cs, libs/storage/Tsavorite/cs/benchmark/Device.benchmark/Program.cs, libs/storage/Tsavorite/cs/benchmark/KV.benchmark/EntryPoint.cs, libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvBenchmark.Setup.cs, libs/storage/Tsavorite/cs/src/core/Index/CheckpointManagement/LocalStorageNamedDeviceFactory.cs (+3 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #2 — If anonymized user #2 becomes unavailable, 11 significant file(s) lose their only recent owner: libs/server/AOF/ReadConsistency/ReadConsistencyManager.cs, libs/client/ClientSession/GarnetClientSessionReplicationExtensions.cs, libs/server/AOF/ReadConsistency/VirtualSublogReplayState.cs, libs/server/AOF/GarnetAppendOnlyFile.cs, libs/server/AOF/AofAddress.cs, libs/server/AOF/Recover/RecoverLogDriver.cs, libs/server/AOF/ReadConsistency/ReplicaReadSessionContext.cs, libs/cluster/Server/Replication/ReplicaOps/AOFReplay/ReplicaReplayTask.cs (+3 more). Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #3 — If anonymized user #3 becomes unavailable, 6 significant file(s) lose their only recent owner: libs/server/Resp/RangeIndex/RangeIndexManager.Migration.cs, libs/server/Resp/RangeIndex/RangeIndexMigrationReader.cs, libs/cluster/Server/Migration/MigrateSession.RangeIndex.cs, libs/cluster/Session/RangeIndexMigrationReceiveSession.cs, libs/storage/Tsavorite/cs/src/core/Allocator/RecordNamespace.cs, libs/server/Resp/Vector/Cleanup/VectorSetCleanupWorkChannel.cs. Pair on, review, or document these before any departure.
Off-boarding risk: anonymized user #4 — If anonymized user #4 becomes unavailable, 5 significant file(s) lose their only recent owner: libs/storage/Tsavorite/cs/src/core/Utilities/MultiLevelPageArray.cs, libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/Implementation/UpsertValueSelector.cs, libs/storage/Tsavorite/cs/src/core/Compaction/TsavoriteCompaction.cs, libs/storage/Tsavorite/cs/src/core/Index/Common/LogSettings.cs, libs/storage/Tsavorite/cs/benchmark/YCSB.benchmark/KeySpanByte.cs. Pair on, review, or document these before any departure.
Silent fallback default in catch libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvBenchmark.Setup.cs:71— `IsPidAlive` swallows every exception into `return false;` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvOutput.cs:255— `TryReadFirstLine` swallows every exception into `return "";` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default in catch libs/storage/Tsavorite/cs/benchmark/KV.benchmark/KvOutput.cs:275— `TryGitSha` swallows every exception into `return "";` — a data error becomes a silent behavior change with no trail. Log the failure or let validation throw.
Silent fallback default on parse failure libs/server/Resp/Vector/ExprRunner.cs:194— `ToNum` falls back to `0` when `Utf8Parser.TryParse(slice, out double result, out var consumed) && consumed == s…` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
Silent fallback default on parse failure modules/RoaringBitmap/RoaringBitmapCommands.cs:165— `Reader` returns `true` when `TryParseArgs(ref input, ref writer, out var bit, out var from)` is false, with no log or throw — a malformed value silently becomes that default. Log the input or fail validation. If that constant is the correct answer to the test rather than a stand-in for a value that could not be read, this is not a silent default: say so in a comment on the member and the row stops firing.
C2 · Access Controls· No named authorization policies · ×1
No named authorization policies — Authorization IS enforced here (by imperative guard methods that throw on violation) — this is NOT a claim that the code is unprotected. What's missing is a NAMED rule set: the guards encode the access rules inline, so the rules can't be listed, reviewed or tested apart from the call sites that apply them. Recommendation, not a defect.
D16 · Bus Factor· Further sole-owners (lower concentration) · ×1
Further sole-owners (lower concentration) — 3 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 (36 single-owned of 707 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 707 of the 999 production source files in this repository met that bar). They are anonymized user #5 (1 file(s)), anonymized user #6 (1 file(s)), anonymized user #7 (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/common/Synchronization/ReadOptimizedLock.cs, libs/common/HashUtils.cs, libs/storage/Tsavorite/cs/src/core/Index/Tsavorite/HashBucketEntry.cs.
Shell project: Garnet.resources libs/resources/Garnet.resources.csproj— `Garnet.resources` contributes only 6 significant line(s) — an empty/placeholder project is structural noise. Remove it or fold its contents into a real project.
No ADRs found — No ADRs found. No recognised ADR directory (`docs/adr/`, `docs/decisions/`, `adr/`, `docs/rfcs/`, an `ADR0001/` folder, or their siblings) exists anywhere in this tree. What was searched, so you can tell an empty log from a search that missed one: every directory under the tree (build output, dependencies and VCS metadata excepted), for a document that is either any non-index page inside a recognised ADR directory, whatever its name and however deeply nested (`docs/adr/use-postgres.md`, `docs/adr/2024/0001-x.md`); or a file anywhere whose name is ADR-shaped (`0001-use-postgres.md`, `adr-012-caching.md`); or, when neither turned anything up, a document carrying the decision-record signature (an "Architecture Decision Record" heading, or Status / Context / Decision / Consequences as section headings). A decision log that clears none of these — unnumbered files outside any recognised directory, without those headings — is not seen by this check and this row is then wrong. If that is your case, say so rather than renaming anything; otherwise, consider recording architectural decisions in `docs/adr/`.
D21 · Naming Consistency· Inconsistent naming for the concept of an Address/Offset in the Cluster/Replication domain. 'Worker.Address' uses a noun 'Address' for a network location, while 'ReplicationHistory.replicationOffset' uses 'Offset' for a log position, and 'PersistencInfo.CommittedUntilAddress' uses 'Address' for a log position. While 'Address' can mean network or log position, the mix of 'Address' and 'Offset' for log positions (and the typo in the containing type) creates confusion. Specifically, 'CommittedUntilAddress' is a log position, similar to 'replicationOffset', but named differently. · ×1
Inconsistent naming for the concept of an Address/Offset in the Cluster/Replication domain. 'Worker.Address' uses a noun 'Address' for a network location, while 'ReplicationHistory.replicationOffset' uses 'Offset' for a log position, and 'PersistencInfo.CommittedUntilAddress' uses 'Address' for a log position. While 'Address' can mean network or log position, the mix of 'Address' and 'Offset' for log positions (and the typo in the containing type) creates confusion. Specifically, 'CommittedUntilAddress' is a log position, similar to 'replicationOffset', but named differently. — Standardize log position fields to use 'Offset' (e.g., rename 'CommittedUntilAddress' to 'CommittedUntilOffset') or clearly distinguish network vs. log addresses in naming (e.g., 'NetworkAddress' vs 'LogOffset'). (symbols: Field: public string Garnet.cluster.Worker.Address, Field: private AofAddress Garnet.cluster.ReplicationHistory.replicationOffset, Field: public AofAddress Garnet.test.cluster.PersistencInfo.CommittedUntilAddress)
D21 · Naming Consistency· The field 'CommittedUntilAddress' in 'PersistencInfo' (note typo in type name) and 'replicationOffset' in 'ReplicationHistory' both represent AOF log positions (AofAddress). They use different conceptual names ('Address' vs 'Offset') for the same underlying type and semantic concept (a position in the AOF log). · ×1
The field 'CommittedUntilAddress' in 'PersistencInfo' (note typo in type name) and 'replicationOffset' in 'ReplicationHistory' both represent AOF log positions (AofAddress). They use different conceptual names ('Address' vs 'Offset') for the same underlying type and semantic concept (a position in the AOF log). — Use 'Offset' for log positions to align with 'replicationOffset', or use 'Address' consistently if that is the domain term, but 'Offset' is more precise for sequential log positions. (symbols: Field: public AofAddress Garnet.test.cluster.PersistencInfo.CommittedUntilAddress, Field: private AofAddress Garnet.cluster.ReplicationHistory.replicationOffset)
D26 · Project Cohesion· Projects may be oversized for their cohesion · ×1
Projects may be oversized for their cohesion — 2 of 63 project(s) overshoot their size bounds, lowering Project Cohesion to 9.4/10. The most over is `Garnet.server` (99257 LoC, 242 public types across 8 namespaces). Review these for cohesion — split a project that spans unrelated responsibilities.
D28 · Secrets (history)· Rotate the exposed credentials · ×1
REDACTED
D34 · Knowledge Freshness· Further orphaned files (smaller) · ×1
Further orphaned files (smaller) — 47 smaller file(s) also have no living knowledge — folded into the freshness score and metrics rather than raised one row each — most significant first: modules/GarnetJSON/JSONPath/QueryExpression.cs, modules/RoaringBitmap/RoaringBitmap.cs, libs/server/Resp/RespCommandDocs.cs, libs/server/Resp/Objects/SortedSetGeoCommands.cs, libs/server/Custom/ExpandableMap.cs, libs/server/Module/ModuleRegistrar.cs, libs/server/Resp/RespCommandInfoSimplifiedStructs.cs, modules/GarnetJSON/JSONPath/ScanArraySliceFilter.cs (and 39 more) (51 orphaned of 707 analysed files in total, counted over production source files of roughly 2,400 bytes or more, excluding vendored, generated and example/demo trees and test files identified by path convention, largest first; 707 of the 999 production source files in this repository met that bar). Attach the read to the next change that touches one of them: have a second person review that change, and leave behind a short comment or test recording what the file is for, so the knowledge comes back at the cost of a change you were making anyway.
D40 · Network Egress Confinement· No network policy · ×1
No network policy — No Kubernetes NetworkPolicy (or Cilium policy) found. Without one, every pod can talk to every other pod and reach out to the internet by default. Add a default-deny policy and open only the flows you need.
GD1 · Unfinished & placeholder code· Placeholder literal left in code · ×1
Placeholder literal left in code samples/ETag/Caching.cs:182— A placeholder string ("Lorem ipsum dolor sit amet, consectetur …") is still in shipped code — typical of generated boilerplate that was never filled in.
No ADRs — No Architecture Decision Records found — no conventional ADR directory, no numbered `NNNN-title` documents in any markup this check reads, and nothing ADR-shaped by content. Design rationale recorded elsewhere (a design-notes tree, a mailing list, pull-request discussion) is not visible to this check and is not re-findable per decision, so a future maintainer cannot ask why one choice was made and get an answer.
No src/ separation — Production code isn't grouped under a src/ folder — it's spread across several top-level directories, so there's no one place that says 'this is the product'.
Inconsistent root namespaces — Only 29/63 projects share a common root namespace — the code's module identity is inconsistent.
P12 · CI test-gate honesty· Sleep-based test synchronization · ×1
Sleep-based test synchronization — 341 Task.Delay/Thread.Sleep call(s) in test code synchronize with background work by sleeping — a known flakiness precursor on slow runners. Prefer polling with a deadline or completion signals.
No release approval gate — Deployment is automated and no gate that pauses it for a human is DECLARED IN THIS REPOSITORY'S PIPELINE FILES. What was read: every file under `.github/workflows/`, `.forgejo/workflows/`, `.gitea/workflows/`, `.azuredevops/` and `.azure-pipelines/`, plus `.gitlab-ci*` and `azure-pipelines*` — with comment text stripped, so documenting a gate is not declaring one. What would have counted: GitLab's `when: manual`, CircleCI's `type: approval`, an Azure `ManualValidation@` task or an `approvals:` block, a Jenkins `input` step, a `uses:` step naming an approval action, an `environment:` paired with `reviewers` / `required_reviewers` / `protection` / `wait-timer` / `deployment_branch_policy`, a draft-release step, a `workflow_dispatch` promotion, or a release-event gate. ★ What this cannot see, because none of it is a file: a GitHub environment whose required reviewers are configured in repo SETTINGS, a branch protection rule, or an organisation deployment policy — all of them real, enforced gates that live outside the repository. If yours is one of those, this row is wrong and nothing in the tree could have told us. Otherwise: whatever reaches the release trigger goes to production unreviewed, so a mistaken merge or tag is live before anyone can stop it.
Changelog looks stale/thin — The changelog this check read carries 2 versioned entries, against a bar of 3. Counted as either the distinct `x.y.z` versions it names (a link's target is not counted) or its version-shaped section headings (`## [1.2.0]`, `## V14.x.x`, `## Updates in 8.0.x`), whichever is the larger — so a log sectioned by minor series counts its sections, not its individual patch numbers. Entries recorded somewhere this check does not read — release notes generated at tag time from a generator config it did not recognise, or a log kept outside the repository — are not counted here, and this row is about what is re-findable in the tree rather than about how often you release.
X2 · Cancellation propagation· Not all async methods take a CancellationToken · ×1
Not all async methods take a CancellationToken — Only 184/383 async methods accept a CancellationToken, so in-flight work can't be stopped early when the caller gives up — whatever ends it in your host (shutdown signal, timeout, abandoned request, user cancel). Thread a token through the call chain and honour it at each await and loop; where a method genuinely cannot be interrupted, omitting it is a deliberate choice — judge against your hosting model.
Nullable reference types not enabled everywhere — 5/32 NRT-eligible project(s) enable <Nullable>enable</Nullable> (projects targeting a pre-C#-8 framework are excluded — NRTs aren't available there). NRTs catch a whole class of null-deref bugs at compile time.
Null-forgiving operator (`!`) suppressions reduce the NRT score — ~0.8 `!` suppressions per 1k syntax nodes — 17 suppression(s) across the 20164 syntax node(s) in code where nullable warnings are ENABLED, which is the only code a `!` can suppress anything in (a `!` under `#nullable disable` is inert and is not counted, and its file's nodes are not in the denominator). Each one tells the compiler to trust you about null, suppressing the very safety NRTs provide.
Skipped (documented): ClusterMigrateRangeIndexStressAsync test/cluster/Garnet.test.cluster.migrate.rangeindex/ClusterRangeIndexMigrateTests.cs:865— Skipped with a documented reason — a deferral, not lazy debt: RI.SET via cluster redirect not yet reliable during migration It synchronises against a background task with `Task.Delay(1_000)` — a fixed wait rather than a signal, which is the usual cause of exactly this kind of randomness.
Skipped (documented): ClusterMigrateHugeObjectChunked test/cluster/Garnet.test.cluster.migrate/ClusterMigrateTests.cs:1026— Skipped with a documented reason — a deferral, not lazy debt: Heavy: builds up to a >6 GB hash object (needs ~20 GB RAM); run on demand. Exercises migration object chunking past the 2 GB (int-overflow) boundary via the in-epoch segmented serialize.
Skipped (documented): ClusterDisklessSyncHugeObjectChunked test/cluster/Garnet.test.cluster.replication.disklesssync/ReplicationTests/ClusterReplicationDisklessSyncTests.cs:100— Skipped with a documented reason — a deferral, not lazy debt: Heavy: builds up to a >6 GB hash object (needs ~20 GB RAM); run on demand. Exercises diskless-sync object streaming past the 2 GB (int-overflow) boundary.
Skipped (documented): ParseACLRuleDescriptionShouldReduceTest test/standalone/Garnet.test.acl/Resp/ACL/AclParserTests.cs:75— Skipped with a documented reason — a deferral, not lazy debt: Fails due to issues with reducing the commands in the ACL.
Skipped (documented): ReadCacheIncreaseEmptyPageCountTest test/standalone/Garnet.test.extensions/CacheSizeTrackerTests.cs:231— Skipped with a documented reason — a deferral, not lazy debt: Revivification for readcache: update to be like SmallMainLogFineGrainedEvictionTest for readcache
Skipped (documented): StressTimeouts test/standalone/Garnet.test.scripting/LuaScriptTests.cs:3340— Skipped with a documented reason — a deferral, not lazy debt: Long running, disabled by default
Skipped (documented): MultiDatabaseSelectInTransactionTestLC test/standalone/Garnet.test.scripting/MultiDatabaseTests.cs:563— Skipped with a documented reason — a deferral, not lazy debt: Currently not supporting SELECT in a transaction
Skipped (documented): MultiDatabaseSwapDatabasesInTransactionTestLC test/standalone/Garnet.test.scripting/MultiDatabaseTests.cs:783— Skipped with a documented reason — a deferral, not lazy debt: Currently not supporting SWAPDB in a transaction
Skipped (documented): MultiDatabaseMultiSessionSwapDatabasesTestLC test/standalone/Garnet.test.scripting/MultiDatabaseTests.cs:878— Skipped with a documented reason — a deferral, not lazy debt: SWAPDB is currently disallowed for more than one client session. This test should be enabled once that changes.
Skipped (documented): AofHugeObjectChunkRecoverTest test/standalone/Garnet.test.scripting/RespAofChunkTests.cs:187— Skipped with a documented reason — a deferral, not lazy debt: Heavy: builds up to a >6 GB object (needs ~20 GB RAM); run on demand. Exercises AOF object chunking across and past the 2 GB (int-overflow) boundary at several sizes.
Skipped (documented): SimpleFixedLenTest libs/storage/Tsavorite/cs/test/test.recordops/RevivificationTests.cs:329— Skipped with a documented reason — a deferral, not lazy debt: Revivifiable boundary has changed
Skipped (documented): UnelideTest libs/storage/Tsavorite/cs/test/test.recordops/RevivificationTests.cs:368— Skipped with a documented reason — a deferral, not lazy debt: Revivifiable boundary has changed
Skipped (documented): SimpleMinAddressAddTest libs/storage/Tsavorite/cs/test/test.recordops/RevivificationTests.cs:410— Skipped with a documented reason — a deferral, not lazy debt: Revivifiable boundary has changed
Skipped (documented): DeleteAllRecordsAndRevivifyTest libs/storage/Tsavorite/cs/test/test.recordops/RevivificationTests.cs:1282— Skipped with a documented reason — a deferral, not lazy debt: Revivifiable boundary has changed
Skipped (documented): DeleteAllRecordsAndTakeSnapshotTest libs/storage/Tsavorite/cs/test/test.recordops/RevivificationTests.cs:1344— Skipped with a documented reason — a deferral, not lazy debt: Revivifiable boundary has changed
Skipped (documented): DeleteAllRecordsAndIterateTest libs/storage/Tsavorite/cs/test/test.recordops/RevivificationTests.cs:1370— Skipped with a documented reason — a deferral, not lazy debt: Revivifiable boundary has changed
Skipped (documented): LiveBinWrappingTest libs/storage/Tsavorite/cs/test/test.recordops/RevivificationTests.cs:1424— Skipped with a documented reason — a deferral, not lazy debt: Revivifiable boundary has changed
Skipped (documented): LiveBinWrappingNoRevivTest libs/storage/Tsavorite/cs/test/test.recordops/RevivificationTests.cs:1503— Skipped with a documented reason — a deferral, not lazy debt: Revivifiable boundary has changed
Skipped (documented): MultiListObjectTest libs/storage/Tsavorite/cs/test/test.recovery/LargeObjectTests.cs:115— Skipped with a documented reason — a deferral, not lazy debt: Long running, high-memory test
Appendix B — Reproduction & audit trail
Every external tool invocation behind a deep-scan dimension — the tool, its captured version, the exact command, how many findings it yielded, and a link to the retained raw output. To reproduce any finding: check out the same commit and run the command shown (repo-relative — never an absolute scratch path). The complete raw scanner output is retained verbatim under artifacts/raw/ (indexed in artifacts/raw/index.json); per-invocation exit codes and wall-clock durations are in sidecar.json — kept out of this table so the rendered report stays byte-identical across runs of the same commit.
semgrep: not applicable — No personal data was found crossing a boundary the PII/GDPR ruleset checks — nothing written to a log or console sink, placed in a URL or query string, or persisted to browser storage. That is a clean result for the LEAK surface only: this ruleset detects personal data escaping, it does not inventory the personal data a repository holds, so it is not evidence that this repository has no personal-data surface. The personal-data map (Appendix C) and the C1-C5 compliance cards are what speak to that. semgrep could not parse 117 file(s) — `benchmark/BDN.benchmark/Diagnostics/CpuDiagnoser.cs`, `benchmark/BDN.benchmark/Operations/JsonOperations.cs`, `benchmark/BDN.benchmark/Program.cs`, `benchmark/Resp.benchmark/OfflineBench/AOFBench/AofGen.cs`, `libs/cluster/Server/Replication/PrimaryOps/AofOperations/AofSyncDriverStore.cs`, … (+112 more) — so the PII/GDPR sweep did not cover the unparsed regions of them; rows reported elsewhere in those files are real.
runtime-hardening: not applicable — The repository ships application workloads but no cluster-governance resources (CRDs, admission webhooks, or a committed policy engine). Runtime threat-detection (Falco/Tetragon) and admission control (Kyverno/OPA-Gatekeeper/PodSecurity) are cluster-OPERATOR controls owned by the platform, not shipped by an application repo/chart — nothing for this repo to assess.
Run 01a167f2-d387-72e0-9132-8084a24facd2 · every finding is also locatable in findings.md, and the complete scoring record (with exit codes + durations) in sidecar.json.
Appendix C — Personal-data map
Every field, property and record parameter whose name is conventional personal data — 2 field(s) across 1 category, each with an exact repo-relative file:line. This is the data inventory a compliance review starts from — right-to-erasure, retention, minimisation. Detected by NAME, from the C# syntax tree, with a deliberately specific identifier classifier — the same one the C1–C5 compliance cards use to decide whether personal data is present, so CardDefinition or FileName don't trip. Two caveats stated rather than glossed: those cards additionally require corroboration (a persistence/account signal, or two distinct PII categories) that this inventory deliberately does not, so it lists more than they gate on; and D32 Data Compliance shares nothing with it — that dimension is a separate semgrep ruleset for personal data leaking into logs, URLs and browser storage, and a clean D32 result says nothing about this list. Informational — it feeds no score.
Issues: 180 · Warnings: 2181 · Recommendations: 154 · Info: 74 — Appendix A · all findings · full markdown report.
Generated by Watchdog — deterministic code-health analysis. 23-10-2026 @ 08:48 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.